From 712565cef2174c32f9f2cdfe5c314c1fe350df28 Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Mon, 25 Jun 2012 21:33:16 -0700 Subject: [PATCH 01/37] build fix: adding missing file LDAPUserAuthenticator.java --- .../{ => src/com/cloud/server/auth}/LDAPUserAuthenticator.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename plugins/user-authenticators/ldap/{ => src/com/cloud/server/auth}/LDAPUserAuthenticator.java (100%) diff --git a/plugins/user-authenticators/ldap/LDAPUserAuthenticator.java b/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java similarity index 100% rename from plugins/user-authenticators/ldap/LDAPUserAuthenticator.java rename to plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java From fc3ac862dcc1cb6b67c59b1636e607c91fa25352 Mon Sep 17 00:00:00 2001 From: David Nalley Date: Tue, 26 Jun 2012 10:44:04 -0400 Subject: [PATCH 02/37] applying the commits from Chip Childers licensing cleanup --- .../com/xensource/xenapi/APIVersion.java | 147 +- .../com/xensource/xenapi/Auth.java | 5 - .../com/xensource/xenapi/Blob.java | 5 - .../com/xensource/xenapi/Bond.java | 5 - .../com/xensource/xenapi/Connection.java | 5 - .../com/xensource/xenapi/Console.java | 5 - .../com/xensource/xenapi/Crashdump.java | 5 - .../com/xensource/xenapi/DataSource.java | 5 - .../com/xensource/xenapi/Event.java | 5 - .../com/xensource/xenapi/Host.java | 5 - .../com/xensource/xenapi/HostCpu.java | 5 - .../com/xensource/xenapi/HostCrashdump.java | 5 - .../com/xensource/xenapi/HostMetrics.java | 5 - .../com/xensource/xenapi/HostPatch.java | 5 - .../com/xensource/xenapi/Marshalling.java | 5 - .../com/xensource/xenapi/Message.java | 5 - .../com/xensource/xenapi/Network.java | 5 - .../com/xensource/xenapi/PBD.java | 5 - .../com/xensource/xenapi/PIF.java | 5 - .../com/xensource/xenapi/PIFMetrics.java | 5 - .../com/xensource/xenapi/Pool.java | 5 - .../com/xensource/xenapi/PoolPatch.java | 5 - .../com/xensource/xenapi/Role.java | 5 - .../com/xensource/xenapi/SM.java | 5 - .../com/xensource/xenapi/SR.java | 5 - .../com/xensource/xenapi/Secret.java | 5 - .../com/xensource/xenapi/Session.java | 5 - .../com/xensource/xenapi/Subject.java | 5 - .../com/xensource/xenapi/Task.java | 5 - .../com/xensource/xenapi/Tunnel.java | 5 - .../com/xensource/xenapi/Types.java | 5 - .../com/xensource/xenapi/User.java | 5 - .../com/xensource/xenapi/VBD.java | 5 - .../com/xensource/xenapi/VBDMetrics.java | 5 - .../com/xensource/xenapi/VDI.java | 5 - .../com/xensource/xenapi/VIF.java | 5 - .../com/xensource/xenapi/VIFMetrics.java | 5 - .../com/xensource/xenapi/VLAN.java | 5 - .../com/xensource/xenapi/VM.java | 5 - .../com/xensource/xenapi/VMGuestMetrics.java | 5 - .../com/xensource/xenapi/VMMetrics.java | 5 - .../com/xensource/xenapi/VMPP.java | 5 - .../com/xensource/xenapi/VTPM.java | 5 - .../com/xensource/xenapi/XenAPIObject.java | 5 - setup/apidoc/XmlToHtmlConverter.java | 29 +- setup/apidoc/build-apidoc.sh | 26 +- setup/apidoc/gen_toc.py | 26 +- setup/bindir/cloud-migrate-databases.in | 18 + setup/bindir/cloud-set-guest-password.in | 18 + setup/bindir/cloud-set-guest-sshkey.in | 18 + setup/bindir/cloud-setup-databases.in | 18 + setup/bindir/cloud-setup-encryption.in | 18 + setup/bindir/cloud-sysvmadm.in | 18 + setup/db/221to222upgrade.sh | 26 +- setup/db/22beta4to22GA.sql | 29 +- setup/db/create-database-premium.sql | 29 +- setup/db/create-database.sql | 127 +- setup/db/create-index-fk.sql | 185 +- setup/db/create-schema-premium.sql | 29 +- setup/db/create-schema-simulator.sql | 29 +- setup/db/data-20to21.sql | 72 +- setup/db/data-22beta1to22beta2.sql | 29 +- setup/db/db/data-217to218.sql | 29 +- setup/db/db/schema-20to21.sql | 397 ++-- setup/db/db/schema-217to218.sql | 32 +- setup/db/db/schema-21to22-cleanup.sql | 29 +- setup/db/db/schema-21to22-premium.sql | 157 +- setup/db/db/schema-21to22.sql | 2033 +++++++++-------- setup/db/db/schema-2210to2211.sql | 29 +- setup/db/db/schema-2211to2212-premium.sql | 119 +- setup/db/db/schema-2211to2212.sql | 121 +- setup/db/db/schema-2212to2213.sql | 161 +- setup/db/db/schema-2213to2214.sql | 167 +- setup/db/db/schema-2214to30-cleanup.sql | 28 +- setup/db/db/schema-2214to30.sql | 31 +- setup/db/db/schema-221to222-cleanup.sql | 29 +- setup/db/db/schema-221to222-premium.sql | 47 +- setup/db/db/schema-221to222.sql | 29 +- setup/db/db/schema-222to224-cleanup.sql | 30 +- setup/db/db/schema-222to224-premium.sql | 43 +- setup/db/db/schema-222to224.sql | 387 ++-- setup/db/db/schema-224to225-cleanup.sql | 29 +- setup/db/db/schema-224to225.sql | 29 +- setup/db/db/schema-225to226.sql | 29 +- setup/db/db/schema-227to228-premium.sql | 147 +- setup/db/db/schema-227to228.sql | 331 +-- setup/db/db/schema-228to229.sql | 187 +- setup/db/db/schema-229to2210.sql | 157 +- setup/db/db/schema-22beta1to22beta2.sql | 29 +- setup/db/db/schema-22beta3to22beta4.sql | 29 +- setup/db/db/schema-301to302-cleanup.sql | 29 +- setup/db/db/schema-301to302.sql | 119 +- setup/db/db/schema-302to303.sql | 355 +-- setup/db/db/schema-30to301.sql | 67 +- setup/db/db/schema-level.sql | 29 +- setup/db/db/schema-snapshot-217to224.sql | 29 +- setup/db/db/schema-snapshot-223to224.sql | 30 +- setup/db/deploy-db-dev.sh | 26 +- setup/db/deploy-db-simulator.sh | 26 +- setup/db/index-20to21.sql | 115 +- setup/db/index-212to213.sql | 30 +- setup/db/postprocess-20to21.sql | 65 +- setup/db/server-setup.sql | 29 +- setup/db/templates.kvm.sql | 29 +- setup/db/templates.simulator.sql | 30 +- setup/db/templates.sql | 29 +- setup/db/templates.vmware.sql | 195 +- setup/db/templates.xenserver.sql | 29 +- 108 files changed, 3703 insertions(+), 3529 deletions(-) diff --git a/deps/XenServerJava/com/xensource/xenapi/APIVersion.java b/deps/XenServerJava/com/xensource/xenapi/APIVersion.java index 497b2d9205e..c003fbc87f6 100644 --- a/deps/XenServerJava/com/xensource/xenapi/APIVersion.java +++ b/deps/XenServerJava/com/xensource/xenapi/APIVersion.java @@ -10,79 +10,74 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -package com.xensource.xenapi; - -public enum APIVersion -{ - API_1_1, API_1_2, API_1_3, API_1_4, API_1_5, API_1_6, API_1_7, UNKNOWN; - - public static APIVersion latest() - { - return API_1_7; - } - - public static APIVersion fromMajorMinor(long major, long minor) - { - if (major == 1 && minor == 7) - { - return API_1_7; - } - else if (major == 1 && minor == 6) - { - return API_1_6; - } - else if (major == 1 && minor == 5) - { - return API_1_5; - } - else if (major == 1 && minor == 4) - { - return API_1_4; - } - else if (major == 1 && minor == 3) - { - return API_1_3; - } - else if (major == 1 && minor == 2) - { - return API_1_2; - } - else if (major == 1 && minor == 1) - { - return API_1_1; - } - else - { - return UNKNOWN; - } - } - - @Override - public String toString() - { - switch (this) - { - case API_1_1: - return "1.1"; - case API_1_2: - return "1.2"; - case API_1_3: - return "1.3"; - case API_1_4: - return "1.4"; - case API_1_5: - return "1.5"; - case API_1_6: - return "1.6"; - case API_1_7: - return "1.7"; - default: - return "Unknown"; - } - } -} +package com.xensource.xenapi; + +public enum APIVersion +{ + API_1_1, API_1_2, API_1_3, API_1_4, API_1_5, API_1_6, API_1_7, UNKNOWN; + + public static APIVersion latest() + { + return API_1_7; + } + + public static APIVersion fromMajorMinor(long major, long minor) + { + if (major == 1 && minor == 7) + { + return API_1_7; + } + else if (major == 1 && minor == 6) + { + return API_1_6; + } + else if (major == 1 && minor == 5) + { + return API_1_5; + } + else if (major == 1 && minor == 4) + { + return API_1_4; + } + else if (major == 1 && minor == 3) + { + return API_1_3; + } + else if (major == 1 && minor == 2) + { + return API_1_2; + } + else if (major == 1 && minor == 1) + { + return API_1_1; + } + else + { + return UNKNOWN; + } + } + + @Override + public String toString() + { + switch (this) + { + case API_1_1: + return "1.1"; + case API_1_2: + return "1.2"; + case API_1_3: + return "1.3"; + case API_1_4: + return "1.4"; + case API_1_5: + return "1.5"; + case API_1_6: + return "1.6"; + case API_1_7: + return "1.7"; + default: + return "Unknown"; + } + } +} diff --git a/deps/XenServerJava/com/xensource/xenapi/Auth.java b/deps/XenServerJava/com/xensource/xenapi/Auth.java index 4c4074e85f9..142be36e31c 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Auth.java +++ b/deps/XenServerJava/com/xensource/xenapi/Auth.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Blob.java b/deps/XenServerJava/com/xensource/xenapi/Blob.java index afb7c1c7f45..9489d044f59 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Blob.java +++ b/deps/XenServerJava/com/xensource/xenapi/Blob.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Bond.java b/deps/XenServerJava/com/xensource/xenapi/Bond.java index 58ae9cca249..171d8b190fd 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Bond.java +++ b/deps/XenServerJava/com/xensource/xenapi/Bond.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Connection.java b/deps/XenServerJava/com/xensource/xenapi/Connection.java index 7a5f8fe2869..c856a7a7001 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Connection.java +++ b/deps/XenServerJava/com/xensource/xenapi/Connection.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import java.net.URL; diff --git a/deps/XenServerJava/com/xensource/xenapi/Console.java b/deps/XenServerJava/com/xensource/xenapi/Console.java index 79bd8aeb33d..04909e537aa 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Console.java +++ b/deps/XenServerJava/com/xensource/xenapi/Console.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Crashdump.java b/deps/XenServerJava/com/xensource/xenapi/Crashdump.java index 6d7b1dfda79..8dab0adf4c5 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Crashdump.java +++ b/deps/XenServerJava/com/xensource/xenapi/Crashdump.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/DataSource.java b/deps/XenServerJava/com/xensource/xenapi/DataSource.java index 015ab51314f..e623c10b725 100644 --- a/deps/XenServerJava/com/xensource/xenapi/DataSource.java +++ b/deps/XenServerJava/com/xensource/xenapi/DataSource.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Event.java b/deps/XenServerJava/com/xensource/xenapi/Event.java index 5ddf44571be..46e2d6c646f 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Event.java +++ b/deps/XenServerJava/com/xensource/xenapi/Event.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import java.io.PrintWriter; diff --git a/deps/XenServerJava/com/xensource/xenapi/Host.java b/deps/XenServerJava/com/xensource/xenapi/Host.java index 374e0801bc3..a80af94214b 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Host.java +++ b/deps/XenServerJava/com/xensource/xenapi/Host.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/HostCpu.java b/deps/XenServerJava/com/xensource/xenapi/HostCpu.java index cff81b88a05..f73b583b1e7 100644 --- a/deps/XenServerJava/com/xensource/xenapi/HostCpu.java +++ b/deps/XenServerJava/com/xensource/xenapi/HostCpu.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/HostCrashdump.java b/deps/XenServerJava/com/xensource/xenapi/HostCrashdump.java index 771f9dd2714..a465e4d2c12 100644 --- a/deps/XenServerJava/com/xensource/xenapi/HostCrashdump.java +++ b/deps/XenServerJava/com/xensource/xenapi/HostCrashdump.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/HostMetrics.java b/deps/XenServerJava/com/xensource/xenapi/HostMetrics.java index 04b2192a151..d7e447f0698 100644 --- a/deps/XenServerJava/com/xensource/xenapi/HostMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/HostMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/HostPatch.java b/deps/XenServerJava/com/xensource/xenapi/HostPatch.java index c7a8eef7c51..889a5c58fd7 100644 --- a/deps/XenServerJava/com/xensource/xenapi/HostPatch.java +++ b/deps/XenServerJava/com/xensource/xenapi/HostPatch.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Marshalling.java b/deps/XenServerJava/com/xensource/xenapi/Marshalling.java index f3b5ca73c9e..e2ee9d6ed9e 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Marshalling.java +++ b/deps/XenServerJava/com/xensource/xenapi/Marshalling.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import java.util.*; diff --git a/deps/XenServerJava/com/xensource/xenapi/Message.java b/deps/XenServerJava/com/xensource/xenapi/Message.java index 9f6146457a1..927ca5c7205 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Message.java +++ b/deps/XenServerJava/com/xensource/xenapi/Message.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Network.java b/deps/XenServerJava/com/xensource/xenapi/Network.java index 4400a51e27e..a013c89dd92 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Network.java +++ b/deps/XenServerJava/com/xensource/xenapi/Network.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/PBD.java b/deps/XenServerJava/com/xensource/xenapi/PBD.java index 0c9dc788a3d..af9e732b70e 100644 --- a/deps/XenServerJava/com/xensource/xenapi/PBD.java +++ b/deps/XenServerJava/com/xensource/xenapi/PBD.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/PIF.java b/deps/XenServerJava/com/xensource/xenapi/PIF.java index 75276c7bb3e..e23e9428c02 100644 --- a/deps/XenServerJava/com/xensource/xenapi/PIF.java +++ b/deps/XenServerJava/com/xensource/xenapi/PIF.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/PIFMetrics.java b/deps/XenServerJava/com/xensource/xenapi/PIFMetrics.java index 2a2c3dc6be0..e3b9eca7f68 100644 --- a/deps/XenServerJava/com/xensource/xenapi/PIFMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/PIFMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Pool.java b/deps/XenServerJava/com/xensource/xenapi/Pool.java index ed5f41c9b87..1ace8bfe82b 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Pool.java +++ b/deps/XenServerJava/com/xensource/xenapi/Pool.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/PoolPatch.java b/deps/XenServerJava/com/xensource/xenapi/PoolPatch.java index 0d20fe47887..2d2649fbfb3 100644 --- a/deps/XenServerJava/com/xensource/xenapi/PoolPatch.java +++ b/deps/XenServerJava/com/xensource/xenapi/PoolPatch.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Role.java b/deps/XenServerJava/com/xensource/xenapi/Role.java index e550bde286f..e0ac9de5061 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Role.java +++ b/deps/XenServerJava/com/xensource/xenapi/Role.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/SM.java b/deps/XenServerJava/com/xensource/xenapi/SM.java index 66490ed8a39..c138ac551d3 100644 --- a/deps/XenServerJava/com/xensource/xenapi/SM.java +++ b/deps/XenServerJava/com/xensource/xenapi/SM.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/SR.java b/deps/XenServerJava/com/xensource/xenapi/SR.java index c57d33dc3db..114a66a555a 100644 --- a/deps/XenServerJava/com/xensource/xenapi/SR.java +++ b/deps/XenServerJava/com/xensource/xenapi/SR.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Secret.java b/deps/XenServerJava/com/xensource/xenapi/Secret.java index 114a723a5f0..9e692d61ccb 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Secret.java +++ b/deps/XenServerJava/com/xensource/xenapi/Secret.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Session.java b/deps/XenServerJava/com/xensource/xenapi/Session.java index bbbcd811853..042ed1a3b4b 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Session.java +++ b/deps/XenServerJava/com/xensource/xenapi/Session.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Subject.java b/deps/XenServerJava/com/xensource/xenapi/Subject.java index d0d01c5ecce..cbba9a4fc10 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Subject.java +++ b/deps/XenServerJava/com/xensource/xenapi/Subject.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Task.java b/deps/XenServerJava/com/xensource/xenapi/Task.java index 9d8ee6b5c0f..ee688c7202b 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Task.java +++ b/deps/XenServerJava/com/xensource/xenapi/Task.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Tunnel.java b/deps/XenServerJava/com/xensource/xenapi/Tunnel.java index ca4c8f45222..660eafbf73c 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Tunnel.java +++ b/deps/XenServerJava/com/xensource/xenapi/Tunnel.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/Types.java b/deps/XenServerJava/com/xensource/xenapi/Types.java index 263a748ea8c..2e9f699b6b8 100644 --- a/deps/XenServerJava/com/xensource/xenapi/Types.java +++ b/deps/XenServerJava/com/xensource/xenapi/Types.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import java.util.Date; diff --git a/deps/XenServerJava/com/xensource/xenapi/User.java b/deps/XenServerJava/com/xensource/xenapi/User.java index f439c8767d2..0c107b92514 100644 --- a/deps/XenServerJava/com/xensource/xenapi/User.java +++ b/deps/XenServerJava/com/xensource/xenapi/User.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VBD.java b/deps/XenServerJava/com/xensource/xenapi/VBD.java index 7914561e852..d644688d391 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VBD.java +++ b/deps/XenServerJava/com/xensource/xenapi/VBD.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VBDMetrics.java b/deps/XenServerJava/com/xensource/xenapi/VBDMetrics.java index a5b4e22481e..245e48806ee 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VBDMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/VBDMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VDI.java b/deps/XenServerJava/com/xensource/xenapi/VDI.java index aea5b2e4605..99ab210defe 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VDI.java +++ b/deps/XenServerJava/com/xensource/xenapi/VDI.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VIF.java b/deps/XenServerJava/com/xensource/xenapi/VIF.java index ac025a19d31..25323de0205 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VIF.java +++ b/deps/XenServerJava/com/xensource/xenapi/VIF.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VIFMetrics.java b/deps/XenServerJava/com/xensource/xenapi/VIFMetrics.java index 10e5588d240..565747f7fe1 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VIFMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/VIFMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VLAN.java b/deps/XenServerJava/com/xensource/xenapi/VLAN.java index bbda8763cc1..5429077bd61 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VLAN.java +++ b/deps/XenServerJava/com/xensource/xenapi/VLAN.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VM.java b/deps/XenServerJava/com/xensource/xenapi/VM.java index 008431a96aa..1b26d974524 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VM.java +++ b/deps/XenServerJava/com/xensource/xenapi/VM.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VMGuestMetrics.java b/deps/XenServerJava/com/xensource/xenapi/VMGuestMetrics.java index c8498710df8..12dd26a87ea 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VMGuestMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/VMGuestMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VMMetrics.java b/deps/XenServerJava/com/xensource/xenapi/VMMetrics.java index 9e2c836b18c..47634e9a10e 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VMMetrics.java +++ b/deps/XenServerJava/com/xensource/xenapi/VMMetrics.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VMPP.java b/deps/XenServerJava/com/xensource/xenapi/VMPP.java index 8732c8b80e7..5df76ad51ff 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VMPP.java +++ b/deps/XenServerJava/com/xensource/xenapi/VMPP.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/VTPM.java b/deps/XenServerJava/com/xensource/xenapi/VTPM.java index a993fe5f292..a443d5194ff 100644 --- a/deps/XenServerJava/com/xensource/xenapi/VTPM.java +++ b/deps/XenServerJava/com/xensource/xenapi/VTPM.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; diff --git a/deps/XenServerJava/com/xensource/xenapi/XenAPIObject.java b/deps/XenServerJava/com/xensource/xenapi/XenAPIObject.java index f323f61ed6c..700e3299604 100644 --- a/deps/XenServerJava/com/xensource/xenapi/XenAPIObject.java +++ b/deps/XenServerJava/com/xensource/xenapi/XenAPIObject.java @@ -10,11 +10,6 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 - * follows: - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * permission to link this library with independent modules to produce an - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. package com.xensource.xenapi; public abstract class XenAPIObject diff --git a/setup/apidoc/XmlToHtmlConverter.java b/setup/apidoc/XmlToHtmlConverter.java index cf39bbd2d4c..8b7cfccb0f6 100644 --- a/setup/apidoc/XmlToHtmlConverter.java +++ b/setup/apidoc/XmlToHtmlConverter.java @@ -1,16 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 -// jdk1.4.1 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. import javax.xml.transform.*; import java.io.*; public class XmlToHtmlConverter extends XmlToHtmlConverterData { diff --git a/setup/apidoc/build-apidoc.sh b/setup/apidoc/build-apidoc.sh index 4e3752d109f..618273f74fe 100644 --- a/setup/apidoc/build-apidoc.sh +++ b/setup/apidoc/build-apidoc.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. # cloud-build-api-doc.sh -- builds api documentation. diff --git a/setup/apidoc/gen_toc.py b/setup/apidoc/gen_toc.py index 3775f9fbaf8..f7a34eb6341 100644 --- a/setup/apidoc/gen_toc.py +++ b/setup/apidoc/gen_toc.py @@ -1,16 +1,20 @@ #!/usr/bin/python -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. import os import os.path diff --git a/setup/bindir/cloud-migrate-databases.in b/setup/bindir/cloud-migrate-databases.in index 114bb921579..58a02d5cdfd 100644 --- a/setup/bindir/cloud-migrate-databases.in +++ b/setup/bindir/cloud-migrate-databases.in @@ -1,5 +1,23 @@ #!/usr/bin/env python +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + import os,logging,sys from optparse import OptionParser import MySQLdb diff --git a/setup/bindir/cloud-set-guest-password.in b/setup/bindir/cloud-set-guest-password.in index a3f80d2ec0c..97e6e3d7bee 100755 --- a/setup/bindir/cloud-set-guest-password.in +++ b/setup/bindir/cloud-set-guest-password.in @@ -5,6 +5,24 @@ # chkconfig: 345 98 02 # description: Password Download Client +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + # Modify this line to specify the user (default is root) user=root diff --git a/setup/bindir/cloud-set-guest-sshkey.in b/setup/bindir/cloud-set-guest-sshkey.in index 2f19f1feee0..69124dca4c1 100755 --- a/setup/bindir/cloud-set-guest-sshkey.in +++ b/setup/bindir/cloud-set-guest-sshkey.in @@ -5,6 +5,24 @@ # chkconfig: 345 98 02 # description: SSH Public Keys Download Client +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + # Modify this line to specify the user (default is root) user=root diff --git a/setup/bindir/cloud-setup-databases.in b/setup/bindir/cloud-setup-databases.in index 62c71359685..06d07d70f42 100755 --- a/setup/bindir/cloud-setup-databases.in +++ b/setup/bindir/cloud-setup-databases.in @@ -1,6 +1,24 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + import os import sys import subprocess diff --git a/setup/bindir/cloud-setup-encryption.in b/setup/bindir/cloud-setup-encryption.in index 009b69470e6..f2de2ec7b99 100755 --- a/setup/bindir/cloud-setup-encryption.in +++ b/setup/bindir/cloud-setup-encryption.in @@ -1,6 +1,24 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + import os import sys import subprocess diff --git a/setup/bindir/cloud-sysvmadm.in b/setup/bindir/cloud-sysvmadm.in index 3bb9c2fa3fa..0a7b454ef95 100755 --- a/setup/bindir/cloud-sysvmadm.in +++ b/setup/bindir/cloud-sysvmadm.in @@ -1,5 +1,23 @@ #!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + . /etc/rc.d/init.d/functions #set -x diff --git a/setup/db/221to222upgrade.sh b/setup/db/221to222upgrade.sh index c82439ff500..8fb1e7563c8 100644 --- a/setup/db/221to222upgrade.sh +++ b/setup/db/221to222upgrade.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/setup/db/22beta4to22GA.sql b/setup/db/22beta4to22GA.sql index 27f78decb02..913afb19780 100644 --- a/setup/db/22beta4to22GA.sql +++ b/setup/db/22beta4to22GA.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + --step 1 -- drop all constraints for user_ip_address ALTER TABLE firewall_rules DROP foreign key fk_firewall_rules__ip_address ; diff --git a/setup/db/create-database-premium.sql b/setup/db/create-database-premium.sql index d214c44e980..18af181a56d 100644 --- a/setup/db/create-database-premium.sql +++ b/setup/db/create-database-premium.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI'; DROP DATABASE IF EXISTS `cloud_usage`; diff --git a/setup/db/create-database.sql b/setup/db/create-database.sql index 41fcef807ce..51f56565bf4 100644 --- a/setup/db/create-database.sql +++ b/setup/db/create-database.sql @@ -1,61 +1,66 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 -SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI'; - -USE `mysql`; - -DROP PROCEDURE IF EXISTS `mysql`.`cloud_drop_user_if_exists` ; -DELIMITER $$ -CREATE PROCEDURE `mysql`.`cloud_drop_user_if_exists`() -BEGIN - DECLARE foo BIGINT DEFAULT 0 ; - SELECT COUNT(*) - INTO foo - FROM `mysql`.`user` - WHERE `User` = 'cloud' and host = 'localhost'; - - IF foo > 0 THEN - DROP USER 'cloud'@'localhost' ; - END IF; - - SELECT COUNT(*) - INTO foo - FROM `mysql`.`user` - WHERE `User` = 'cloud' and host = '%'; - - IF foo > 0 THEN - DROP USER 'cloud'@'%' ; - END IF; -END $$ -DELIMITER ; - -CALL `mysql`.`cloud_drop_user_if_exists`() ; - -DROP PROCEDURE IF EXISTS `mysql`.`cloud_drop_users_if_exists` ; - -SET SQL_MODE=@OLD_SQL_MODE ; - -DROP DATABASE IF EXISTS `billing`; -DROP DATABASE IF EXISTS `cloud`; - -CREATE DATABASE `cloud`; - -CREATE USER cloud identified by 'cloud'; - -GRANT ALL ON cloud.* to cloud@`localhost` identified by 'cloud'; -GRANT ALL ON cloud.* to cloud@`%` identified by 'cloud'; - -GRANT process ON *.* TO cloud@`localhost`; -GRANT process ON *.* TO cloud@`%`; - -commit; +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI'; + +USE `mysql`; + +DROP PROCEDURE IF EXISTS `mysql`.`cloud_drop_user_if_exists` ; +DELIMITER $$ +CREATE PROCEDURE `mysql`.`cloud_drop_user_if_exists`() +BEGIN + DECLARE foo BIGINT DEFAULT 0 ; + SELECT COUNT(*) + INTO foo + FROM `mysql`.`user` + WHERE `User` = 'cloud' and host = 'localhost'; + + IF foo > 0 THEN + DROP USER 'cloud'@'localhost' ; + END IF; + + SELECT COUNT(*) + INTO foo + FROM `mysql`.`user` + WHERE `User` = 'cloud' and host = '%'; + + IF foo > 0 THEN + DROP USER 'cloud'@'%' ; + END IF; +END $$ +DELIMITER ; + +CALL `mysql`.`cloud_drop_user_if_exists`() ; + +DROP PROCEDURE IF EXISTS `mysql`.`cloud_drop_users_if_exists` ; + +SET SQL_MODE=@OLD_SQL_MODE ; + +DROP DATABASE IF EXISTS `billing`; +DROP DATABASE IF EXISTS `cloud`; + +CREATE DATABASE `cloud`; + +CREATE USER cloud identified by 'cloud'; + +GRANT ALL ON cloud.* to cloud@`localhost` identified by 'cloud'; +GRANT ALL ON cloud.* to cloud@`%` identified by 'cloud'; + +GRANT process ON *.* TO cloud@`localhost`; +GRANT process ON *.* TO cloud@`%`; + +commit; diff --git a/setup/db/create-index-fk.sql b/setup/db/create-index-fk.sql index f47d2968694..82284d42e2e 100755 --- a/setup/db/create-index-fk.sql +++ b/setup/db/create-index-fk.sql @@ -1,90 +1,95 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 - -ALTER TABLE `cloud`.`account` ADD CONSTRAINT `fk_account__domain_id` FOREIGN KEY `fk_account__domain_id` (`domain_id`) REFERENCES `domain` (`id`); -ALTER TABLE `cloud`.`account` ADD INDEX `i_account__domain_id`(`domain_id`); - -ALTER TABLE `cloud`.`account` ADD INDEX `i_account__cleanup_needed`(`cleanup_needed`); -ALTER TABLE `cloud`.`account` ADD INDEX `i_account__account_name__domain_id__removed`(`account_name`, `domain_id`, `removed`); - -ALTER TABLE `cloud`.`resource_limit` ADD CONSTRAINT `fk_resource_limit__domain_id` FOREIGN KEY `fk_resource_limit__domain_id` (`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`resource_limit` ADD INDEX `i_resource_limit__domain_id`(`domain_id`); -ALTER TABLE `cloud`.`resource_limit` ADD CONSTRAINT `fk_resource_limit__account_id` FOREIGN KEY `fk_resource_limit__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`resource_limit` ADD INDEX `i_resource_limit__account_id`(`account_id`); - -ALTER TABLE `cloud`.`event` ADD INDEX `i_event__created`(`created`); -ALTER TABLE `cloud`.`event` ADD INDEX `i_event__user_id`(`user_id`); -ALTER TABLE `cloud`.`event` ADD INDEX `i_event__account_id` (`account_id`); -ALTER TABLE `cloud`.`event` ADD INDEX `i_event__level_id`(`level`); -ALTER TABLE `cloud`.`event` ADD INDEX `i_event__type_id`(`type`); - -ALTER TABLE `cloud`.`vm_template` ADD INDEX `i_vm_template__public`(`public`); - -ALTER TABLE `cloud`.`upload` ADD CONSTRAINT `fk_upload__host_id` FOREIGN KEY `fk_upload__host_id` (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`upload` ADD INDEX `i_upload__host_id`(`host_id`); -ALTER TABLE `cloud`.`upload` ADD INDEX `i_upload__type_id`(`type_id`); - -ALTER TABLE `cloud`.`user_statistics` ADD CONSTRAINT `fk_user_statistics__account_id` FOREIGN KEY `fk_user_statistics__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`user_statistics` ADD INDEX `i_user_statistics__account_id`(`account_id`); - -ALTER TABLE `cloud`.`user_statistics` ADD INDEX `i_user_statistics__account_id_data_center_id`(`account_id`, `data_center_id`); - -ALTER TABLE `cloud`.`snapshots` ADD CONSTRAINT `fk_snapshots__account_id` FOREIGN KEY `fk_snapshots__account_id` (`account_id`) REFERENCES `account` (`id`); -ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__account_id`(`account_id`); -ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__volume_id`(`volume_id`); -ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__name`(`name`); -ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__snapshot_type`(`snapshot_type`); -ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__prev_snap_id`(`prev_snap_id`); - -ALTER TABLE `cloud`.`snapshot_policy` ADD INDEX `i_snapshot_policy__volume_id`(`volume_id`); - -ALTER TABLE `cloud`.`snapshot_schedule` ADD CONSTRAINT `fk__snapshot_schedule_volume_id` FOREIGN KEY `fk_snapshot_schedule__volume_id` (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`snapshot_schedule` ADD INDEX `i_snapshot_schedule__volume_id`(`volume_id`); -ALTER TABLE `cloud`.`snapshot_schedule` ADD CONSTRAINT `fk__snapshot_schedule_policy_id` FOREIGN KEY `fk_snapshot_schedule__policy_id` (`policy_id`) REFERENCES `snapshot_policy` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`snapshot_schedule` ADD INDEX `i_snapshot_schedule__policy_id`(`policy_id`); -ALTER TABLE `cloud`.`snapshot_schedule` ADD CONSTRAINT `fk__snapshot_schedule_async_job_id` FOREIGN KEY `fk_snapshot_schedule__async_job_id` (`async_job_id`) REFERENCES `async_job` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`snapshot_schedule` ADD INDEX `i_snapshot_schedule__async_job_id`(`async_job_id`); -ALTER TABLE `cloud`.`snapshot_schedule` ADD CONSTRAINT `fk__snapshot_schedule_snapshot_id` FOREIGN KEY `fk_snapshot_schedule__snapshot_id` (`snapshot_id`) REFERENCES `snapshots` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`snapshot_schedule` ADD INDEX `i_snapshot_schedule__snapshot_id`(`snapshot_id`); -ALTER TABLE `cloud`.`snapshot_schedule` ADD INDEX `i_snapshot_schedule__scheduled_timestamp`(`scheduled_timestamp`); - - -ALTER TABLE `cloud`.`stack_maid` ADD INDEX `i_stack_maid_msid_thread_id`(`msid`, `thread_id`); -ALTER TABLE `cloud`.`stack_maid` ADD INDEX `i_stack_maid_seq`(`msid`, `seq`); -ALTER TABLE `cloud`.`stack_maid` ADD INDEX `i_stack_maid_created`(`created`); - -ALTER TABLE `cloud`.`launch_permission` ADD INDEX `i_launch_permission_template_id`(`template_id`); - -ALTER TABLE `cloud`.`guest_os` ADD CONSTRAINT `fk_guest_os__category_id` FOREIGN KEY `fk_guest_os__category_id` (`category_id`) REFERENCES `guest_os_category` (`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`security_group` ADD CONSTRAINT `fk_security_group__account_id` FOREIGN KEY `fk_security_group__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`security_group` ADD CONSTRAINT `fk_security_group__domain_id` FOREIGN KEY `fk_security_group__domain_id` (`domain_id`) REFERENCES `domain` (`id`); -ALTER TABLE `cloud`.`security_group` ADD INDEX `i_security_group_name`(`name`); - -ALTER TABLE `cloud`.`security_group_rule` ADD CONSTRAINT `fk_security_group_rule___security_group_id` FOREIGN KEY `fk_security_group_rule__security_group_id` (`security_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`security_group_rule` ADD CONSTRAINT `fk_security_group_rule___allowed_network_id` FOREIGN KEY `fk_security_group_rule__allowed_network_id` (`allowed_network_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`security_group_rule` ADD INDEX `i_security_group_rule_network_id`(`security_group_id`); -ALTER TABLE `cloud`.`security_group_rule` ADD INDEX `i_security_group_rule_allowed_network`(`allowed_network_id`); - -ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___security_group_id` FOREIGN KEY `fk_security_group_vm_map___security_group_id` (`security_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___instance_id` FOREIGN KEY `fk_security_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`instance_group` ADD CONSTRAINT `fk_instance_group__account_id` FOREIGN KEY `fk_instance_group__account_id` (`account_id`) REFERENCES `account` (`id`); - -ALTER TABLE `cloud`.`instance_group_vm_map` ADD CONSTRAINT `fk_instance_group_vm_map___group_id` FOREIGN KEY `fk_instance_group_vm_map___group_id` (`group_id`) REFERENCES `instance_group` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`instance_group_vm_map` ADD CONSTRAINT `fk_instance_group_vm_map___instance_id` FOREIGN KEY `fk_instance_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `fk_ssh_keypairs__account_id` FOREIGN KEY `fk_ssh_keypair__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `fk_ssh_keypairs__domain_id` FOREIGN KEY `fk_ssh_keypair__domain_id` (`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`usage_event` ADD INDEX `i_usage_event__created`(`created`); +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + +ALTER TABLE `cloud`.`account` ADD CONSTRAINT `fk_account__domain_id` FOREIGN KEY `fk_account__domain_id` (`domain_id`) REFERENCES `domain` (`id`); +ALTER TABLE `cloud`.`account` ADD INDEX `i_account__domain_id`(`domain_id`); + +ALTER TABLE `cloud`.`account` ADD INDEX `i_account__cleanup_needed`(`cleanup_needed`); +ALTER TABLE `cloud`.`account` ADD INDEX `i_account__account_name__domain_id__removed`(`account_name`, `domain_id`, `removed`); + +ALTER TABLE `cloud`.`resource_limit` ADD CONSTRAINT `fk_resource_limit__domain_id` FOREIGN KEY `fk_resource_limit__domain_id` (`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`resource_limit` ADD INDEX `i_resource_limit__domain_id`(`domain_id`); +ALTER TABLE `cloud`.`resource_limit` ADD CONSTRAINT `fk_resource_limit__account_id` FOREIGN KEY `fk_resource_limit__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`resource_limit` ADD INDEX `i_resource_limit__account_id`(`account_id`); + +ALTER TABLE `cloud`.`event` ADD INDEX `i_event__created`(`created`); +ALTER TABLE `cloud`.`event` ADD INDEX `i_event__user_id`(`user_id`); +ALTER TABLE `cloud`.`event` ADD INDEX `i_event__account_id` (`account_id`); +ALTER TABLE `cloud`.`event` ADD INDEX `i_event__level_id`(`level`); +ALTER TABLE `cloud`.`event` ADD INDEX `i_event__type_id`(`type`); + +ALTER TABLE `cloud`.`vm_template` ADD INDEX `i_vm_template__public`(`public`); + +ALTER TABLE `cloud`.`upload` ADD CONSTRAINT `fk_upload__host_id` FOREIGN KEY `fk_upload__host_id` (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`upload` ADD INDEX `i_upload__host_id`(`host_id`); +ALTER TABLE `cloud`.`upload` ADD INDEX `i_upload__type_id`(`type_id`); + +ALTER TABLE `cloud`.`user_statistics` ADD CONSTRAINT `fk_user_statistics__account_id` FOREIGN KEY `fk_user_statistics__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`user_statistics` ADD INDEX `i_user_statistics__account_id`(`account_id`); + +ALTER TABLE `cloud`.`user_statistics` ADD INDEX `i_user_statistics__account_id_data_center_id`(`account_id`, `data_center_id`); + +ALTER TABLE `cloud`.`snapshots` ADD CONSTRAINT `fk_snapshots__account_id` FOREIGN KEY `fk_snapshots__account_id` (`account_id`) REFERENCES `account` (`id`); +ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__account_id`(`account_id`); +ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__volume_id`(`volume_id`); +ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__name`(`name`); +ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__snapshot_type`(`snapshot_type`); +ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__prev_snap_id`(`prev_snap_id`); + +ALTER TABLE `cloud`.`snapshot_policy` ADD INDEX `i_snapshot_policy__volume_id`(`volume_id`); + +ALTER TABLE `cloud`.`snapshot_schedule` ADD CONSTRAINT `fk__snapshot_schedule_volume_id` FOREIGN KEY `fk_snapshot_schedule__volume_id` (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`snapshot_schedule` ADD INDEX `i_snapshot_schedule__volume_id`(`volume_id`); +ALTER TABLE `cloud`.`snapshot_schedule` ADD CONSTRAINT `fk__snapshot_schedule_policy_id` FOREIGN KEY `fk_snapshot_schedule__policy_id` (`policy_id`) REFERENCES `snapshot_policy` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`snapshot_schedule` ADD INDEX `i_snapshot_schedule__policy_id`(`policy_id`); +ALTER TABLE `cloud`.`snapshot_schedule` ADD CONSTRAINT `fk__snapshot_schedule_async_job_id` FOREIGN KEY `fk_snapshot_schedule__async_job_id` (`async_job_id`) REFERENCES `async_job` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`snapshot_schedule` ADD INDEX `i_snapshot_schedule__async_job_id`(`async_job_id`); +ALTER TABLE `cloud`.`snapshot_schedule` ADD CONSTRAINT `fk__snapshot_schedule_snapshot_id` FOREIGN KEY `fk_snapshot_schedule__snapshot_id` (`snapshot_id`) REFERENCES `snapshots` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`snapshot_schedule` ADD INDEX `i_snapshot_schedule__snapshot_id`(`snapshot_id`); +ALTER TABLE `cloud`.`snapshot_schedule` ADD INDEX `i_snapshot_schedule__scheduled_timestamp`(`scheduled_timestamp`); + + +ALTER TABLE `cloud`.`stack_maid` ADD INDEX `i_stack_maid_msid_thread_id`(`msid`, `thread_id`); +ALTER TABLE `cloud`.`stack_maid` ADD INDEX `i_stack_maid_seq`(`msid`, `seq`); +ALTER TABLE `cloud`.`stack_maid` ADD INDEX `i_stack_maid_created`(`created`); + +ALTER TABLE `cloud`.`launch_permission` ADD INDEX `i_launch_permission_template_id`(`template_id`); + +ALTER TABLE `cloud`.`guest_os` ADD CONSTRAINT `fk_guest_os__category_id` FOREIGN KEY `fk_guest_os__category_id` (`category_id`) REFERENCES `guest_os_category` (`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`security_group` ADD CONSTRAINT `fk_security_group__account_id` FOREIGN KEY `fk_security_group__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`security_group` ADD CONSTRAINT `fk_security_group__domain_id` FOREIGN KEY `fk_security_group__domain_id` (`domain_id`) REFERENCES `domain` (`id`); +ALTER TABLE `cloud`.`security_group` ADD INDEX `i_security_group_name`(`name`); + +ALTER TABLE `cloud`.`security_group_rule` ADD CONSTRAINT `fk_security_group_rule___security_group_id` FOREIGN KEY `fk_security_group_rule__security_group_id` (`security_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`security_group_rule` ADD CONSTRAINT `fk_security_group_rule___allowed_network_id` FOREIGN KEY `fk_security_group_rule__allowed_network_id` (`allowed_network_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`security_group_rule` ADD INDEX `i_security_group_rule_network_id`(`security_group_id`); +ALTER TABLE `cloud`.`security_group_rule` ADD INDEX `i_security_group_rule_allowed_network`(`allowed_network_id`); + +ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___security_group_id` FOREIGN KEY `fk_security_group_vm_map___security_group_id` (`security_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___instance_id` FOREIGN KEY `fk_security_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`instance_group` ADD CONSTRAINT `fk_instance_group__account_id` FOREIGN KEY `fk_instance_group__account_id` (`account_id`) REFERENCES `account` (`id`); + +ALTER TABLE `cloud`.`instance_group_vm_map` ADD CONSTRAINT `fk_instance_group_vm_map___group_id` FOREIGN KEY `fk_instance_group_vm_map___group_id` (`group_id`) REFERENCES `instance_group` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`instance_group_vm_map` ADD CONSTRAINT `fk_instance_group_vm_map___instance_id` FOREIGN KEY `fk_instance_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `fk_ssh_keypairs__account_id` FOREIGN KEY `fk_ssh_keypair__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `fk_ssh_keypairs__domain_id` FOREIGN KEY `fk_ssh_keypair__domain_id` (`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`usage_event` ADD INDEX `i_usage_event__created`(`created`); diff --git a/setup/db/create-schema-premium.sql b/setup/db/create-schema-premium.sql index f0e68aaf7bc..d84718ee56a 100644 --- a/setup/db/create-schema-premium.sql +++ b/setup/db/create-schema-premium.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + SET foreign_key_checks = 0; DROP TABLE IF EXISTS `cloud_usage`.`cloud_usage`; DROP TABLE IF EXISTS `cloud_usage`.`usage_vm_instance`; diff --git a/setup/db/create-schema-simulator.sql b/setup/db/create-schema-simulator.sql index 70e40b9c347..b8168aaa3c9 100644 --- a/setup/db/create-schema-simulator.sql +++ b/setup/db/create-schema-simulator.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + DROP TABLE IF EXISTS `cloud`.`mockhost`; DROP TABLE IF EXISTS `cloud`.`mocksecstorage`; DROP TABLE IF EXISTS `cloud`.`mockstoragepool`; diff --git a/setup/db/data-20to21.sql b/setup/db/data-20to21.sql index cba37a1368f..d59b4833561 100644 --- a/setup/db/data-20to21.sql +++ b/setup/db/data-20to21.sql @@ -1,33 +1,39 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 -use cloud; - --- --- We don't want to mess up with customer's data, all data updates are wrapped in a big transactions --- hopefully we don't have a huge data set to deal with --- -START TRANSACTION; - -UPDATE service_offering SET guest_ip_type='VirtualNetwork'; -UPDATE vlan SET vlan_type='VirtualNetwork'; - -INSERT INTO configuration (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'management-server', 'linkLocalIp.nums', '10', 'The number of link local ip that needed by domR(in power of 2)'); -UPDATE host SET resource='com.cloud.hypervisor.xen.resource.XenServer56Resource' WHERE resource='com.cloud.resource.xen.XenServer56Resource'; - --- --- Delete orphan records to deal with DELETE ON CASCADE missing in following two tables --- -DELETE FROM console_proxy where id NOT IN (SELECT id FROM vm_instance WHERE type='ConsoleProxy'); -DELETE FROM secondary_storage_vm where id NOT IN (SELECT id FROM vm_instance WHERE type='SecondaryStorageVm'); - -COMMIT; +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + +use cloud; + +-- +-- We don't want to mess up with customer's data, all data updates are wrapped in a big transactions +-- hopefully we don't have a huge data set to deal with +-- +START TRANSACTION; + +UPDATE service_offering SET guest_ip_type='VirtualNetwork'; +UPDATE vlan SET vlan_type='VirtualNetwork'; + +INSERT INTO configuration (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'management-server', 'linkLocalIp.nums', '10', 'The number of link local ip that needed by domR(in power of 2)'); +UPDATE host SET resource='com.cloud.hypervisor.xen.resource.XenServer56Resource' WHERE resource='com.cloud.resource.xen.XenServer56Resource'; + +-- +-- Delete orphan records to deal with DELETE ON CASCADE missing in following two tables +-- +DELETE FROM console_proxy where id NOT IN (SELECT id FROM vm_instance WHERE type='ConsoleProxy'); +DELETE FROM secondary_storage_vm where id NOT IN (SELECT id FROM vm_instance WHERE type='SecondaryStorageVm'); + +COMMIT; diff --git a/setup/db/data-22beta1to22beta2.sql b/setup/db/data-22beta1to22beta2.sql index 16c8de1da27..eb922989e33 100644 --- a/setup/db/data-22beta1to22beta2.sql +++ b/setup/db/data-22beta1to22beta2.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + INSERT INTO sequence (name, value) VALUES ('snapshots_seq', '1') UPDATE cloud.sequence SET value=IF((SELECT COUNT(*) FROM cloud.snapshots) > 0, (SELECT max(id) FROM cloud.snapshots) + 1, 1) WHERE name='snapshots_seq' diff --git a/setup/db/db/data-217to218.sql b/setup/db/db/data-217to218.sql index 5b05f259614..a6bb1eaf66c 100755 --- a/setup/db/db/data-217to218.sql +++ b/setup/db/db/data-217to218.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + INSERT INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'default.page.size', '500', 'Default page size for API list* commands'); DELETE FROM `cloud`.`op_host_capacity` WHERE `capacity_type` in (2,6); diff --git a/setup/db/db/schema-20to21.sql b/setup/db/db/schema-20to21.sql index 499c8907263..cc41910e567 100644 --- a/setup/db/db/schema-20to21.sql +++ b/setup/db/db/schema-20to21.sql @@ -1,196 +1,201 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 -SET foreign_key_checks = 0; - --- --- Schema upgrade from 2.0 to 2.1 --- -CREATE TABLE `cloud`.`cluster` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', - `name` varchar(255) NOT NULL COMMENT 'name for the cluster', - `pod_id` bigint unsigned NOT NULL COMMENT 'pod id', - `data_center_id` bigint unsigned NOT NULL COMMENT 'data center id', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`ext_lun_alloc` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', - `size` bigint unsigned NOT NULL COMMENT 'virtual size', - `portal` varchar(255) NOT NULL COMMENT 'ip or host name to the storage server', - `target_iqn` varchar(255) NOT NULL COMMENT 'target iqn', - `data_center_id` bigint unsigned NOT NULL COMMENT 'data center id this belongs to', - `lun` int NOT NULL COMMENT 'lun', - `taken` datetime COMMENT 'time occupied', - `volume_id` bigint unsigned COMMENT 'vm taking this lun', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`ext_lun_details` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', - `ext_lun_id` bigint unsigned NOT NULL COMMENT 'lun id', - `tag` varchar(255) COMMENT 'tags associated with this vm', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`storage_pool_details` ( - `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', - `pool_id` bigint unsigned NOT NULL COMMENT 'pool the detail is related to', - `name` varchar(255) NOT NULL COMMENT 'name of the detail', - `value` varchar(255) NOT NULL COMMENT 'value of the detail', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`network_group` ( - `id` bigint unsigned NOT NULL auto_increment, - `name` varchar(255) NOT NULL, - `description` varchar(4096) NULL, - `domain_id` bigint unsigned NOT NULL, - `account_id` bigint unsigned NOT NULL, - `account_name` varchar(100) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`network_ingress_rule` ( - `id` bigint unsigned NOT NULL auto_increment, - `network_group_id` bigint unsigned NOT NULL, - `start_port` varchar(10) default NULL, - `end_port` varchar(10) default NULL, - `protocol` varchar(16) NOT NULL default 'TCP', - `allowed_network_id` bigint unsigned, - `allowed_network_group` varchar(255) COMMENT 'data duplicated from network_group table to avoid lots of joins when listing rules (the name of the group should be displayed rather than just id)', - `allowed_net_grp_acct` varchar(100) COMMENT 'data duplicated from network_group table to avoid lots of joins when listing rules (the name of the group owner should be displayed)', - `allowed_ip_cidr` varchar(44), - `create_status` varchar(32) COMMENT 'rule creation status', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`network_group_vm_map` ( - `id` bigint unsigned NOT NULL auto_increment, - `network_group_id` bigint unsigned NOT NULL, - `instance_id` bigint unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`op_nwgrp_work` ( - `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', - `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance that needs rules to be synced.', - `mgmt_server_id` bigint unsigned COMMENT 'management server that has taken up the work of doing rule sync', - `created` datetime NOT NULL COMMENT 'time the entry was requested', - `taken` datetime COMMENT 'time it was taken by the management server', - `step` varchar(32) NOT NULL COMMENT 'Step in the work', - `seq_no` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies ruleset update', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`op_vm_ruleset_log` ( - `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', - `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance that needs rules to be synced.', - `created` datetime NOT NULL COMMENT 'time the entry was requested', - `logsequence` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies ruleset update', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`account_vlan_map` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, - `account_id` bigint unsigned NOT NULL COMMENT 'account id. foreign key to account table', - `vlan_db_id` bigint unsigned NOT NULL COMMENT 'database id of vlan. foreign key to vlan table', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`op_dc_link_local_ip_address_alloc` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'primary key', - `ip_address` varchar(15) NOT NULL COMMENT 'ip address', - `data_center_id` bigint unsigned NOT NULL COMMENT 'data center it belongs to', - `pod_id` bigint unsigned NOT NULL COMMENT 'pod it belongs to', - `instance_id` bigint unsigned NULL COMMENT 'instance id', - `taken` datetime COMMENT 'Date taken', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`op_lock` MODIFY COLUMN `key` varchar(128) NOT NULL UNIQUE; -- add UNIQUE constraint -ALTER TABLE `cloud`.`op_lock` MODIFY COLUMN `thread` varchar(255) NOT NULL; -- change from varchar(256) to varchar(255) - -ALTER TABLE `cloud`.`volumes` DROP COLUMN `name_label`; -ALTER TABLE `cloud`.`volumes` DROP COLUMN `template_name`; -ALTER TABLE `cloud`.`volumes` ADD COLUMN `pool_type` varchar(64); -ALTER TABLE `cloud`.`volumes` ADD COLUMN `recreatable` tinyint(1) unsigned NOT NULL DEFAULT 0; -ALTER TABLE `cloud`.`volumes` ADD COLUMN `device_id` bigint unsigned NULL; - --- --- after we have data migrated, we can then enforce this at postprocess-20to21.sql --- ALTER TABLE `cloud`.`volumes` MODIFY COLUMN `disk_offering_id` bigint unsigned NOT NULL; -- add NOT NULL constraint - -ALTER TABLE `cloud`.`vlan` DROP COLUMN `vlan_name`; - -ALTER TABLE `cloud`.`host` ADD COLUMN `cluster_id` bigint unsigned; - --- --- enforced in postporcess-20to21.sql -ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `gateway` varchar(255); -- need to migrage data with user input - -ALTER TABLE `cloud`.`service_offering` ADD COLUMN `recreatable` tinyint(1) unsigned NOT NULL DEFAULT 0; -ALTER TABLE `cloud`.`service_offering` ADD COLUMN `tags` varchar(255); - -ALTER TABLE `cloud`.`user_vm` MODIFY COLUMN `domain_router_id` bigint unsigned; -- change from NOT NULL to NULL - -ALTER TABLE `cloud`.`event` ADD COLUMN `state` varchar(32) NOT NULL DEFAULT 'Completed'; -ALTER TABLE `cloud`.`event` ADD COLUMN `start_id` bigint unsigned NOT NULL DEFAULT 0; - -ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `tags` varchar(4096); -ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `created` datetime; -- will fill it with the oldest time in old data base - -ALTER TABLE `cloud`.`storage_pool` ADD COLUMN `cluster_id` bigint unsigned; -- need to setup default cluster for pods - -ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `last_host_id` bigint unsigned; - -ALTER TABLE `cloud`.`console_proxy` MODIFY COLUMN `gateway` varchar(15); -- remove NOT NULL constraint -ALTER TABLE `cloud`.`console_proxy` MODIFY COLUMN `public_netmask` varchar(15); -- remove NOT NULL constraint -ALTER TABLE `cloud`.`console_proxy` ADD COLUMN `guest_mac_address` varchar(17); -- NOT NULL UNIQUE constraint will be added in postprocess -ALTER TABLE `cloud`.`console_proxy` ADD COLUMN `guest_ip_address` varchar(15); -ALTER TABLE `cloud`.`console_proxy` ADD COLUMN `guest_netmask` varchar(15); - -ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `gateway` varchar(15); -- remove NOT NULL constraint -ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `public_netmask` varchar(15); -- remove NOT NULL constrait -ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `guest_mac_address` varchar(17); -- NOT NULL unique constrait will be added in postprocess -ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `guest_ip_address` varchar(15) UNIQUE; -ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `guest_netmask` varchar(15); - -CREATE TABLE `cloud`.`service_offering_21` ( - `id` bigint unsigned NOT NULL, - `cpu` int(10) unsigned NOT NULL COMMENT '# of cores', - `speed` int(10) unsigned NOT NULL COMMENT 'speed per core in mhz', - `ram_size` bigint unsigned NOT NULL, - `nw_rate` smallint unsigned default 200 COMMENT 'network rate throttle mbits/s', - `mc_rate` smallint unsigned default 10 COMMENT 'mcast rate throttle mbits/s', - `ha_enabled` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Enable HA', - `guest_ip_type` varchar(255) NOT NULL DEFAULT 'Virtualized' COMMENT 'Type of guest network -- direct or virtualized', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`disk_offering_21` ( - `id` bigint unsigned NOT NULL auto_increment, - `domain_id` bigint unsigned, - `name` varchar(255) NOT NULL, - `display_text` varchar(4096) NULL COMMENT 'Description text set by the admin for display purpose only', - `disk_size` bigint unsigned NOT NULL COMMENT 'disk space in mbs', - `mirrored` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT 'Enable mirroring?', - `type` varchar(32) COMMENT 'inheritted by who?', - `tags` varchar(4096) COMMENT 'comma separated tags about the disk_offering', - `recreatable` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'The root disk is always recreatable', - `use_local_storage` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Indicates whether local storage pools should be used', - `unique_name` varchar(32) UNIQUE COMMENT 'unique name', - `removed` datetime COMMENT 'date removed', - `created` datetime COMMENT 'date the disk offering was created', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +SET foreign_key_checks = 0; + +-- +-- Schema upgrade from 2.0 to 2.1 +-- +CREATE TABLE `cloud`.`cluster` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', + `name` varchar(255) NOT NULL COMMENT 'name for the cluster', + `pod_id` bigint unsigned NOT NULL COMMENT 'pod id', + `data_center_id` bigint unsigned NOT NULL COMMENT 'data center id', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ext_lun_alloc` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', + `size` bigint unsigned NOT NULL COMMENT 'virtual size', + `portal` varchar(255) NOT NULL COMMENT 'ip or host name to the storage server', + `target_iqn` varchar(255) NOT NULL COMMENT 'target iqn', + `data_center_id` bigint unsigned NOT NULL COMMENT 'data center id this belongs to', + `lun` int NOT NULL COMMENT 'lun', + `taken` datetime COMMENT 'time occupied', + `volume_id` bigint unsigned COMMENT 'vm taking this lun', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ext_lun_details` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', + `ext_lun_id` bigint unsigned NOT NULL COMMENT 'lun id', + `tag` varchar(255) COMMENT 'tags associated with this vm', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`storage_pool_details` ( + `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', + `pool_id` bigint unsigned NOT NULL COMMENT 'pool the detail is related to', + `name` varchar(255) NOT NULL COMMENT 'name of the detail', + `value` varchar(255) NOT NULL COMMENT 'value of the detail', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`network_group` ( + `id` bigint unsigned NOT NULL auto_increment, + `name` varchar(255) NOT NULL, + `description` varchar(4096) NULL, + `domain_id` bigint unsigned NOT NULL, + `account_id` bigint unsigned NOT NULL, + `account_name` varchar(100) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`network_ingress_rule` ( + `id` bigint unsigned NOT NULL auto_increment, + `network_group_id` bigint unsigned NOT NULL, + `start_port` varchar(10) default NULL, + `end_port` varchar(10) default NULL, + `protocol` varchar(16) NOT NULL default 'TCP', + `allowed_network_id` bigint unsigned, + `allowed_network_group` varchar(255) COMMENT 'data duplicated from network_group table to avoid lots of joins when listing rules (the name of the group should be displayed rather than just id)', + `allowed_net_grp_acct` varchar(100) COMMENT 'data duplicated from network_group table to avoid lots of joins when listing rules (the name of the group owner should be displayed)', + `allowed_ip_cidr` varchar(44), + `create_status` varchar(32) COMMENT 'rule creation status', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`network_group_vm_map` ( + `id` bigint unsigned NOT NULL auto_increment, + `network_group_id` bigint unsigned NOT NULL, + `instance_id` bigint unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`op_nwgrp_work` ( + `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', + `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance that needs rules to be synced.', + `mgmt_server_id` bigint unsigned COMMENT 'management server that has taken up the work of doing rule sync', + `created` datetime NOT NULL COMMENT 'time the entry was requested', + `taken` datetime COMMENT 'time it was taken by the management server', + `step` varchar(32) NOT NULL COMMENT 'Step in the work', + `seq_no` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies ruleset update', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`op_vm_ruleset_log` ( + `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', + `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance that needs rules to be synced.', + `created` datetime NOT NULL COMMENT 'time the entry was requested', + `logsequence` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies ruleset update', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`account_vlan_map` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, + `account_id` bigint unsigned NOT NULL COMMENT 'account id. foreign key to account table', + `vlan_db_id` bigint unsigned NOT NULL COMMENT 'database id of vlan. foreign key to vlan table', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`op_dc_link_local_ip_address_alloc` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'primary key', + `ip_address` varchar(15) NOT NULL COMMENT 'ip address', + `data_center_id` bigint unsigned NOT NULL COMMENT 'data center it belongs to', + `pod_id` bigint unsigned NOT NULL COMMENT 'pod it belongs to', + `instance_id` bigint unsigned NULL COMMENT 'instance id', + `taken` datetime COMMENT 'Date taken', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`op_lock` MODIFY COLUMN `key` varchar(128) NOT NULL UNIQUE; -- add UNIQUE constraint +ALTER TABLE `cloud`.`op_lock` MODIFY COLUMN `thread` varchar(255) NOT NULL; -- change from varchar(256) to varchar(255) + +ALTER TABLE `cloud`.`volumes` DROP COLUMN `name_label`; +ALTER TABLE `cloud`.`volumes` DROP COLUMN `template_name`; +ALTER TABLE `cloud`.`volumes` ADD COLUMN `pool_type` varchar(64); +ALTER TABLE `cloud`.`volumes` ADD COLUMN `recreatable` tinyint(1) unsigned NOT NULL DEFAULT 0; +ALTER TABLE `cloud`.`volumes` ADD COLUMN `device_id` bigint unsigned NULL; + +-- +-- after we have data migrated, we can then enforce this at postprocess-20to21.sql +-- ALTER TABLE `cloud`.`volumes` MODIFY COLUMN `disk_offering_id` bigint unsigned NOT NULL; -- add NOT NULL constraint + +ALTER TABLE `cloud`.`vlan` DROP COLUMN `vlan_name`; + +ALTER TABLE `cloud`.`host` ADD COLUMN `cluster_id` bigint unsigned; + +-- +-- enforced in postporcess-20to21.sql +ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `gateway` varchar(255); -- need to migrage data with user input + +ALTER TABLE `cloud`.`service_offering` ADD COLUMN `recreatable` tinyint(1) unsigned NOT NULL DEFAULT 0; +ALTER TABLE `cloud`.`service_offering` ADD COLUMN `tags` varchar(255); + +ALTER TABLE `cloud`.`user_vm` MODIFY COLUMN `domain_router_id` bigint unsigned; -- change from NOT NULL to NULL + +ALTER TABLE `cloud`.`event` ADD COLUMN `state` varchar(32) NOT NULL DEFAULT 'Completed'; +ALTER TABLE `cloud`.`event` ADD COLUMN `start_id` bigint unsigned NOT NULL DEFAULT 0; + +ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `tags` varchar(4096); +ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `created` datetime; -- will fill it with the oldest time in old data base + +ALTER TABLE `cloud`.`storage_pool` ADD COLUMN `cluster_id` bigint unsigned; -- need to setup default cluster for pods + +ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `last_host_id` bigint unsigned; + +ALTER TABLE `cloud`.`console_proxy` MODIFY COLUMN `gateway` varchar(15); -- remove NOT NULL constraint +ALTER TABLE `cloud`.`console_proxy` MODIFY COLUMN `public_netmask` varchar(15); -- remove NOT NULL constraint +ALTER TABLE `cloud`.`console_proxy` ADD COLUMN `guest_mac_address` varchar(17); -- NOT NULL UNIQUE constraint will be added in postprocess +ALTER TABLE `cloud`.`console_proxy` ADD COLUMN `guest_ip_address` varchar(15); +ALTER TABLE `cloud`.`console_proxy` ADD COLUMN `guest_netmask` varchar(15); + +ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `gateway` varchar(15); -- remove NOT NULL constraint +ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `public_netmask` varchar(15); -- remove NOT NULL constrait +ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `guest_mac_address` varchar(17); -- NOT NULL unique constrait will be added in postprocess +ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `guest_ip_address` varchar(15) UNIQUE; +ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `guest_netmask` varchar(15); + +CREATE TABLE `cloud`.`service_offering_21` ( + `id` bigint unsigned NOT NULL, + `cpu` int(10) unsigned NOT NULL COMMENT '# of cores', + `speed` int(10) unsigned NOT NULL COMMENT 'speed per core in mhz', + `ram_size` bigint unsigned NOT NULL, + `nw_rate` smallint unsigned default 200 COMMENT 'network rate throttle mbits/s', + `mc_rate` smallint unsigned default 10 COMMENT 'mcast rate throttle mbits/s', + `ha_enabled` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Enable HA', + `guest_ip_type` varchar(255) NOT NULL DEFAULT 'Virtualized' COMMENT 'Type of guest network -- direct or virtualized', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`disk_offering_21` ( + `id` bigint unsigned NOT NULL auto_increment, + `domain_id` bigint unsigned, + `name` varchar(255) NOT NULL, + `display_text` varchar(4096) NULL COMMENT 'Description text set by the admin for display purpose only', + `disk_size` bigint unsigned NOT NULL COMMENT 'disk space in mbs', + `mirrored` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT 'Enable mirroring?', + `type` varchar(32) COMMENT 'inheritted by who?', + `tags` varchar(4096) COMMENT 'comma separated tags about the disk_offering', + `recreatable` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'The root disk is always recreatable', + `use_local_storage` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Indicates whether local storage pools should be used', + `unique_name` varchar(32) UNIQUE COMMENT 'unique name', + `removed` datetime COMMENT 'date removed', + `created` datetime COMMENT 'date the disk offering was created', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/setup/db/db/schema-217to218.sql b/setup/db/db/schema-217to218.sql index 6ec4c59cb75..f2b6b291f78 100644 --- a/setup/db/db/schema-217to218.sql +++ b/setup/db/db/schema-217to218.sql @@ -1,15 +1,21 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + ALTER TABLE `cloud`.`account_vlan_map` modify `account_id` bigint unsigned default null; @@ -24,4 +30,4 @@ CREATE TABLE `cloud`.`version` ( `step` char(32) NOT NULL COMMENT 'Step in the upgrade to this version', PRIMARY KEY (`id`), INDEX `i_version__version`(`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/setup/db/db/schema-21to22-cleanup.sql b/setup/db/db/schema-21to22-cleanup.sql index 39d58217daf..9cfc10ad572 100644 --- a/setup/db/db/schema-21to22-cleanup.sql +++ b/setup/db/db/schema-21to22-cleanup.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + -- First the easy stuff. Drop useless tables DROP TABLE IF EXISTS `cloud`.`ext_lun_details`; DROP TABLE IF EXISTS `cloud`.`ext_lun_alloc`; diff --git a/setup/db/db/schema-21to22-premium.sql b/setup/db/db/schema-21to22-premium.sql index 7645353f311..9fb9859b2f0 100755 --- a/setup/db/db/schema-21to22-premium.sql +++ b/setup/db/db/schema-21to22-premium.sql @@ -1,76 +1,81 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.1 to 2.2; ---; -DROP TABLE IF EXISTS `cloud_usage`.`usage_port_forwarding`; -DROP TABLE IF EXISTS `cloud_usage`.`usage_network_offering`; -DROP TABLE IF EXISTS `cloud_usage`.`usage_event`; - -ALTER TABLE `cloud_usage`.`cloud_usage` modify `raw_usage` DOUBLE UNSIGNED NOT NULL; -ALTER TABLE `cloud_usage`.`cloud_usage` ADD COLUMN `type` varchar(32); - -ALTER TABLE `cloud_usage`.`usage_network` ADD COLUMN `host_id` bigint unsigned NOT NULL default 0; -ALTER TABLE `cloud_usage`.`usage_network` ADD COLUMN `host_type` varchar(32) default 'DomainRouter'; - -ALTER TABLE `cloud_usage`.`usage_network` drop PRIMARY KEY; -ALTER TABLE `cloud_usage`.`usage_network` add PRIMARY KEY (`account_id`, `zone_id`, `host_id`, `event_time_millis`); - -ALTER TABLE `cloud_usage`.`usage_ip_address` ADD COLUMN `id` bigint unsigned default 0; -ALTER TABLE `cloud_usage`.`usage_ip_address` ADD COLUMN `is_source_nat` smallint(1) NOT NULL default 0; - -ALTER TABLE `cloud_usage`.`account` ADD COLUMN `network_domain` varchar(100) COMMENT 'Network domain name of the Vms of the account'; - -ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `public_ip_address` varchar(15); -ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `device_id` bigint unsigned NOT NULL default 0; -ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `device_type` varchar(32) NOT NULL default 'DomainRouter'; - -CREATE TABLE `cloud_usage`.`usage_event` ( - `id` bigint unsigned NOT NULL auto_increment, - `type` varchar(32) NOT NULL, - `account_id` bigint unsigned NOT NULL, - `created` datetime NOT NULL, - `zone_id` bigint unsigned NOT NULL, - `resource_id` bigint unsigned, - `resource_name` varchar(255), - `offering_id` bigint unsigned, - `template_id` bigint unsigned, - `size` bigint unsigned, - `processed` tinyint NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud_usage`.`usage_port_forwarding` ( - `id` bigint unsigned NOT NULL, - `zone_id` bigint unsigned NOT NULL, - `account_id` bigint unsigned NOT NULL, - `domain_id` bigint unsigned NOT NULL, - `created` DATETIME NOT NULL, - `deleted` DATETIME NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud_usage`.`usage_network_offering` ( - `zone_id` bigint unsigned NOT NULL, - `account_id` bigint unsigned NOT NULL, - `domain_id` bigint unsigned NOT NULL, - `vm_instance_id` bigint unsigned NOT NULL, - `network_offering_id` bigint unsigned NOT NULL, - `is_default` smallint(1) NOT NULL, - `created` DATETIME NOT NULL, - `deleted` DATETIME NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -update `cloud_usage`.`usage_volume` set size = (size * 1048576); - - - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.1 to 2.2; +--; +DROP TABLE IF EXISTS `cloud_usage`.`usage_port_forwarding`; +DROP TABLE IF EXISTS `cloud_usage`.`usage_network_offering`; +DROP TABLE IF EXISTS `cloud_usage`.`usage_event`; + +ALTER TABLE `cloud_usage`.`cloud_usage` modify `raw_usage` DOUBLE UNSIGNED NOT NULL; +ALTER TABLE `cloud_usage`.`cloud_usage` ADD COLUMN `type` varchar(32); + +ALTER TABLE `cloud_usage`.`usage_network` ADD COLUMN `host_id` bigint unsigned NOT NULL default 0; +ALTER TABLE `cloud_usage`.`usage_network` ADD COLUMN `host_type` varchar(32) default 'DomainRouter'; + +ALTER TABLE `cloud_usage`.`usage_network` drop PRIMARY KEY; +ALTER TABLE `cloud_usage`.`usage_network` add PRIMARY KEY (`account_id`, `zone_id`, `host_id`, `event_time_millis`); + +ALTER TABLE `cloud_usage`.`usage_ip_address` ADD COLUMN `id` bigint unsigned default 0; +ALTER TABLE `cloud_usage`.`usage_ip_address` ADD COLUMN `is_source_nat` smallint(1) NOT NULL default 0; + +ALTER TABLE `cloud_usage`.`account` ADD COLUMN `network_domain` varchar(100) COMMENT 'Network domain name of the Vms of the account'; + +ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `public_ip_address` varchar(15); +ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `device_id` bigint unsigned NOT NULL default 0; +ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `device_type` varchar(32) NOT NULL default 'DomainRouter'; + +CREATE TABLE `cloud_usage`.`usage_event` ( + `id` bigint unsigned NOT NULL auto_increment, + `type` varchar(32) NOT NULL, + `account_id` bigint unsigned NOT NULL, + `created` datetime NOT NULL, + `zone_id` bigint unsigned NOT NULL, + `resource_id` bigint unsigned, + `resource_name` varchar(255), + `offering_id` bigint unsigned, + `template_id` bigint unsigned, + `size` bigint unsigned, + `processed` tinyint NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud_usage`.`usage_port_forwarding` ( + `id` bigint unsigned NOT NULL, + `zone_id` bigint unsigned NOT NULL, + `account_id` bigint unsigned NOT NULL, + `domain_id` bigint unsigned NOT NULL, + `created` DATETIME NOT NULL, + `deleted` DATETIME NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud_usage`.`usage_network_offering` ( + `zone_id` bigint unsigned NOT NULL, + `account_id` bigint unsigned NOT NULL, + `domain_id` bigint unsigned NOT NULL, + `vm_instance_id` bigint unsigned NOT NULL, + `network_offering_id` bigint unsigned NOT NULL, + `is_default` smallint(1) NOT NULL, + `created` DATETIME NOT NULL, + `deleted` DATETIME NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +update `cloud_usage`.`usage_volume` set size = (size * 1048576); + + + diff --git a/setup/db/db/schema-21to22.sql b/setup/db/db/schema-21to22.sql index f4a6c800b05..0c0ad7d66ff 100755 --- a/setup/db/db/schema-21to22.sql +++ b/setup/db/db/schema-21to22.sql @@ -1,1014 +1,1019 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.1 to 2.2; ---; -ALTER TABLE `cloud`.`cluster` ADD COLUMN `guid` varchar(255) UNIQUE DEFAULT NULL; -ALTER TABLE `cloud`.`cluster` ADD COLUMN `cluster_type` varchar(64) DEFAULT 'CloudManaged'; -ALTER TABLE `cloud`.`vm_template` ADD COLUMN `hypervisor_type` varchar(32) COMMENT 'hypervisor that the template is belonged to'; -ALTER TABLE `cloud`.`vm_template` ADD COLUMN `extractable` int(1) unsigned NOT NULL default 0 COMMENT 'Is this template extractable'; -ALTER TABLE `cloud`.`template_spool_ref` ADD CONSTRAINT `fk_template_spool_ref__template_id` FOREIGN KEY (`template_id`) REFERENCES `vm_template`(`id`); - -ALTER TABLE `cloud`.`guest_os` modify `name` varchar(255) ; - --- NOTE for tables below; --- these 2 tables were used in 2.1, but are not in 2.2; --- we will need a migration script for these tables when the migration is written; --- furthermore we have renamed the following in 2.2; --- network_group table --> security_group table; --- network_group_vm_map table --> security_group_vm_map table; -DROP TABLE `cloud`.`security_group`; -DROP TABLE `cloud`.`security_group_vm_map`; --- needs a migration step; -#ALTER TABLE `cloud`.`account` DROP COLUMN `network_domain`; - --- New migration from 2.1 to 2.2; - --- Easy stuff first. All new tables.; - -CREATE TABLE IF NOT EXISTS `cloud`.`version` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', - `version` char(40) NOT NULL UNIQUE COMMENT 'version', - `updated` datetime NOT NULL COMMENT 'Date this version table was updated', - `step` char(32) NOT NULL COMMENT 'Step in the upgrade to this version', - PRIMARY KEY (`id`), - INDEX `i_version__version`(`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`mshost` DROP KEY `msid`; -ALTER TABLE `cloud`.`mshost` MODIFY COLUMN `msid` bigint unsigned NOT NULL UNiQUE; - -CREATE TABLE `cloud`.`op_it_work` ( - `id` char(40) COMMENT 'reservation id', - `mgmt_server_id` bigint unsigned COMMENT 'management server id', - `created_at` bigint unsigned NOT NULL COMMENT 'when was this work detail created', - `thread` varchar(255) NOT NULL COMMENT 'thread name', - `type` char(32) NOT NULL COMMENT 'type of work', - `step` char(32) NOT NULL COMMENT 'state', - `updated_at` bigint unsigned NOT NULL COMMENT 'time it was taken over', - `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance', - `resource_type` char(32) COMMENT 'type of resource being worked on', - `resource_id` bigint unsigned COMMENT 'resource id being worked on', - PRIMARY KEY (`id`), - CONSTRAINT `fk_op_it_work__mgmt_server_id` FOREIGN KEY (`mgmt_server_id`) REFERENCES `mshost`(`msid`), - CONSTRAINT `fk_op_it_work__instance_id` FOREIGN KEY (`instance_id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE, - INDEX `i_op_it_work__step`(`step`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`network_offerings` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', - `name` varchar(64) NOT NULL unique COMMENT 'network offering', - `display_text` varchar(255) NOT NULL COMMENT 'text to display to users', - `nw_rate` smallint unsigned COMMENT 'network rate throttle mbits/s', - `mc_rate` smallint unsigned COMMENT 'mcast rate throttle mbits/s', - `concurrent_connections` int(10) unsigned COMMENT 'concurrent connections supported on this network', - `traffic_type` varchar(32) NOT NULL COMMENT 'traffic type carried on this network', - `tags` varchar(4096) COMMENT 'tags supported by this offering', - `system_only` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Is this network offering for system use only', - `specify_vlan` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Should the user specify vlan', - `service_offering_id` bigint unsigned UNIQUE COMMENT 'service offering id that this network offering is tied to', - `created` datetime NOT NULL COMMENT 'time the entry was created', - `removed` datetime DEFAULT NULL COMMENT 'time the entry was removed', - `default` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if network offering is default', - `availability` varchar(255) NOT NULL COMMENT 'availability of the network', - `dns_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides dns service', - `gateway_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides gateway service', - `firewall_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides firewall service', - `lb_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides lb service', - `userdata_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides user data service', - `vpn_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides vpn service', - `dhcp_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides dhcp service', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`networks` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `name` varchar(255) COMMENT 'name for this network', - `display_text` varchar(255) COMMENT 'display text for this network', - `traffic_type` varchar(32) NOT NULL COMMENT 'type of traffic going through this network', - `broadcast_domain_type` varchar(32) NOT NULL COMMENT 'type of broadcast domain used', - `broadcast_uri` varchar(255) COMMENT 'broadcast domain specifier', - `gateway` varchar(15) COMMENT 'gateway for this network configuration', - `cidr` varchar(18) COMMENT 'network cidr', - `mode` varchar(32) COMMENT 'How to retrieve ip address in this network', - `network_offering_id` bigint unsigned NOT NULL COMMENT 'network offering id that this configuration is created from', - `data_center_id` bigint unsigned NOT NULL COMMENT 'data center id that this configuration is used in', - `guru_name` varchar(255) NOT NULL COMMENT 'who is responsible for this type of network configuration', - `state` varchar(32) NOT NULL COMMENT 'what state is this configuration in', - `related` bigint unsigned NOT NULL COMMENT 'related to what other network configuration', - `domain_id` bigint unsigned NOT NULL COMMENT 'foreign key to domain id', - `account_id` bigint unsigned NOT NULL COMMENT 'owner of this network', - `dns1` varchar(255) COMMENT 'comma separated DNS list', - `dns2` varchar(255) COMMENT 'comma separated DNS list', - `guru_data` varchar(1024) COMMENT 'data stored by the network guru that setup this network', - `set_fields` bigint unsigned NOT NULL DEFAULT 0 COMMENT 'which fields are set already', - `guest_type` char(32) COMMENT 'type of guest network', - `shared` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '0 if network is shared, 1 if network dedicated', - `network_domain` varchar(255) COMMENT 'domain', - `reservation_id` char(40) COMMENT 'reservation id', - `is_default` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if network is default', - `created` datetime NOT NULL COMMENT 'date created', - `removed` datetime COMMENT 'date removed if not null', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`op_networks`( - `id` bigint unsigned NOT NULL UNIQUE KEY, - `mac_address_seq` bigint unsigned NOT NULL DEFAULT 1 COMMENT 'mac address', - `nics_count` int unsigned NOT NULL DEFAULT 0 COMMENT '# of nics', - `gc` tinyint unsigned NOT NULL DEFAULT 1 COMMENT 'gc this network or not', - `check_for_gc` tinyint unsigned NOT NULL DEFAULT 1 COMMENT 'check this network for gc or not', - PRIMARY KEY(`id`), - CONSTRAINT `fk_op_networks__id` FOREIGN KEY (`id`) REFERENCES `networks`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`account_network_ref` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `account_id` bigint unsigned NOT NULL COMMENT 'account id', - `network_id` bigint unsigned NOT NULL COMMENT 'network id', - `is_owner` smallint(1) NOT NULL COMMENT 'is the owner of the network', - PRIMARY KEY (`id`), - CONSTRAINT `fk_account_network_ref__account_id` FOREIGN KEY (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_account_network_ref__networks_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE `cloud`.`certificate` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `certificate` text COMMENT 'the actual custom certificate being stored in the db', - `updated` varchar(1) COMMENT 'status of the certificate', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO `cloud`.`certificate` (id,certificate,updated) VALUES ('1',null,'N'); - -CREATE TABLE `cloud`.`nics` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', - `instance_id` bigint unsigned COMMENT 'vm instance id', - `mac_address` varchar(17) COMMENT 'mac address', - `ip4_address` varchar(15) COMMENT 'ip4 address', - `netmask` varchar(15) COMMENT 'netmask for ip4 address', - `gateway` varchar(15) COMMENT 'gateway', - `ip_type` varchar(32) COMMENT 'type of ip', - `broadcast_uri` varchar(255) COMMENT 'broadcast uri', - `network_id` bigint unsigned NOT NULL COMMENT 'network configuration id', - `mode` varchar(32) COMMENT 'mode of getting ip address', - `state` varchar(32) NOT NULL COMMENT 'state of the creation', - `strategy` varchar(32) NOT NULL COMMENT 'reservation strategy', - `reserver_name` varchar(255) COMMENT 'Name of the component that reserved the ip address', - `reservation_id` varchar(64) COMMENT 'id for the reservation', - `device_id` int(10) COMMENT 'device id for the network when plugged into the virtual machine', - `update_time` timestamp NOT NULL COMMENT 'time the state was changed', - `isolation_uri` varchar(255) COMMENT 'id for isolation', - `ip6_address` char(40) COMMENT 'ip6 address', - `default_nic` tinyint NOT NULL COMMENT "None", - `created` datetime NOT NULL COMMENT 'date created', - `removed` datetime COMMENT 'date removed if not null', - PRIMARY KEY (`id`), - CONSTRAINT `fk_nics__instance_id` FOREIGN KEY `fk_nics__instance_id`(`instance_id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_nics__networks_id` FOREIGN KEY `fk_nics__networks_id`(`network_id`) REFERENCES `networks`(`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO `network_offerings` VALUES (1,'System-Public-Network','System Offering for System-Public-Network',NULL,NULL,NULL,'Public',NULL,1,0,NULL,now(),NULL,0,'Required',0,0,0,0,0,0,0),(2,'System-Management-Network','System Offering for System-Management-Network',NULL,NULL,NULL,'Management',NULL,1,0,NULL,now(),NULL,0,'Required',0,0,0,0,0,0,0),(3,'System-Control-Network','System Offering for System-Control-Network',NULL,NULL,NULL,'Control',NULL,1,0,NULL,now(),NULL,0,'Required',0,0,0,0,0,0,0),(4,'System-Storage-Network','System Offering for System-Storage-Network',NULL,NULL,NULL,'Storage',NULL,1,0,NULL,now(),NULL,0,'Required',0,0,0,0,0,0,0),(5,'System-Guest-Network','System-Guest-Network',NULL,NULL,NULL,'Guest',NULL,1,0,NULL,now(),NULL,1,'Required',1,0,0,0,1,0,1),(6,'DefaultVirtualizedNetworkOffering','Virtual Vlan',NULL,NULL,NULL,'Guest',NULL,0,0,NULL,now(),NULL,1,'Required',1,1,1,1,1,1,1),(7,'DefaultDirectNetworkOffering','Direct',NULL,NULL,NULL,'Public',NULL,0,0,NULL,now(),NULL,1,'Required',1,0,0,0,1,0,1); - -CREATE TABLE `cloud`.`cluster_details` ( - `id` bigint unsigned NOT NULL auto_increment, - `cluster_id` bigint unsigned NOT NULL COMMENT 'cluster id', - `name` varchar(255) NOT NULL, - `value` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_cluster_details__cluster_id` FOREIGN KEY (`cluster_id`) REFERENCES `cluster`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `id` bigint unsigned NOT NULL UNIQUE auto_increment; -ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `one_to_one_nat` int(1) unsigned NOT NULL default '0'; -ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `vm_id` bigint unsigned DEFAULT NULL; -ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `state` char(32) NOT NULL DEFAULT 'Free'; -ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `mac_address` bigint unsigned NOT NULL; -ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `source_network_id` bigint unsigned NOT NULL; -ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `network_id` bigint unsigned; - -UPDATE `cloud`.`user_ip_address` set state='Allocated' WHERE allocated IS NOT NULL; - -CREATE TABLE `cloud`.`firewall_rules` ( - `id` bigint unsigned NOT NULL auto_increment COMMENT 'id', - `ip_address_id` bigint unsigned NOT NULL COMMENT 'id of the corresponding ip address', - `start_port` int(10) NOT NULL COMMENT 'starting port of a port range', - `end_port` int(10) NOT NULL COMMENT 'end port of a port range', - `state` char(32) NOT NULL COMMENT 'current state of this rule', - `protocol` char(16) NOT NULL default 'TCP' COMMENT 'protocol to open these ports for', - `purpose` char(32) NOT NULL COMMENT 'why are these ports opened?', - `account_id` bigint unsigned NOT NULL COMMENT 'owner id', - `domain_id` bigint unsigned NOT NULL COMMENT 'domain id', - `network_id` bigint unsigned NOT NULL COMMENT 'network id', - `xid` char(40) NOT NULL COMMENT 'external id', - `is_static_nat` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if firewall rule is one to one nat rule', - `created` datetime COMMENT 'Date created', - PRIMARY KEY (`id`), - CONSTRAINT `fk_firewall_rules__ip_address_id` FOREIGN KEY(`ip_address_id`) REFERENCES `user_ip_address`(`id`), - CONSTRAINT `fk_firewall_rules__network_id` FOREIGN KEY(`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_firewall_rules__account_id` FOREIGN KEY(`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_firewall_rules__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`port_forwarding_rules` ( - `id` bigint unsigned NOT NULL COMMENT 'id', - `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance id', - `dest_ip_address` char(40) NOT NULL COMMENT 'id_address', - `dest_port_start` int(10) NOT NULL COMMENT 'starting port of the port range to map to', - `dest_port_end` int(10) NOT NULL COMMENT 'end port of the the port range to map to', - PRIMARY KEY (`id`), - CONSTRAINT `fk_port_forwarding_rules__id` FOREIGN KEY(`id`) REFERENCES `firewall_rules`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`load_balancing_rules` ( - `id` bigint unsigned NOT NULL, - `name` varchar(255) NOT NULL, - `description` varchar(4096) NULL COMMENT 'description', - `default_port_start` int(10) NOT NULL COMMENT 'default private port range start', - `default_port_end` int(10) NOT NULL COMMENT 'default destination port range end', - `algorithm` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_load_balancing_rules__id` FOREIGN KEY(`id`) REFERENCES `firewall_rules`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`load_balancer_vm_map` ADD COLUMN `revoke` tinyint(1) unsigned NOT NULL DEFAULT 0; - -CREATE TABLE `cloud`.`op_host` ( - `id` bigint unsigned NOT NULL UNIQUE COMMENT 'host id', - `sequence` bigint unsigned DEFAULT 1 NOT NULL COMMENT 'sequence for the host communication', - PRIMARY KEY (`id`), - CONSTRAINT `fk_op_host__id` FOREIGN KEY (`id`) REFERENCES `host`(`id`) ON DELETE CASCADE -) ENGINE = InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`guest_os_hypervisor` ( - `id` bigint unsigned NOT NULL auto_increment, - `hypervisor_type` varchar(32) NOT NULL, - `guest_os_name` varchar(255) NOT NULL, - `guest_os_id` bigint unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - -INSERT INTO op_host(id, sequence) select id, sequence from host; - --- Alter Tables to add Columns; - -ALTER TABLE `cloud`.`cluster` ADD COLUMN `hypervisor_type` varchar(32); -UPDATE `cloud`.`cluster` SET hypervisor_type=(SELECT DISTINCT host.hypervisor_type from host where host.cluster_id = cluster.id GROUP BY host.hypervisor_type); - -ALTER TABLE `cloud`.`volumes` ADD COLUMN `attached` datetime; -UPDATE `cloud`.`volumes` SET attached=now() WHERE removed IS NULL AND instance_id IS NOT NULL; - -ALTER TABLE `cloud`.`volumes` ADD COLUMN `chain_info` text; - -ALTER TABLE `cloud`.`volumes` MODIFY COLUMN `volume_type` VARCHAR(64) NOT NULL; - -ALTER TABLE `cloud`.`volumes` ADD COLUMN `state` VARCHAR(32); -UPDATE `cloud`.`volumes` SET state='Destroy' WHERE removed IS NOT NULL OR destroyed=1 OR status='Creating' OR status='Corrupted' OR status='Failed'; -UPDATE `cloud`.`volumes` SET state='Ready' WHERE removed IS NULL AND (destroyed=0 OR destroyed is NULL) AND status='Created'; - -ALTER TABLE `cloud`.`vlan` ADD COLUMN `network_id` bigint unsigned NOT NULL; - -ALTER TABLE `cloud`.`data_center` ADD COLUMN `domain` varchar(100); -ALTER TABLE `cloud`.`data_center` ADD COLUMN `domain_id` bigint unsigned; -ALTER TABLE `cloud`.`data_center` ADD COLUMN `networktype` varchar(255) NOT NULL DEFAULT 'Basic'; -ALTER TABLE `cloud`.`data_center` ADD COLUMN `dns_provider` char(64) DEFAULT 'VirtualRouter'; -ALTER TABLE `cloud`.`data_center` ADD COLUMN `gateway_provider` char(64) DEFAULT 'VirtualRouter'; -ALTER TABLE `cloud`.`data_center` ADD COLUMN `firewall_provider` char(64) DEFAULT 'VirtualRouter'; -ALTER TABLE `cloud`.`data_center` ADD COLUMN `dhcp_provider` char(64) DEFAULT 'VirtualRouter'; -ALTER TABLE `cloud`.`data_center` ADD COLUMN `lb_provider` char(64) DEFAULT 'VirtualRouter'; -ALTER TABLE `cloud`.`data_center` ADD COLUMN `vpn_provider` char(64) DEFAULT 'VirtualRouter'; -ALTER TABLE `cloud`.`data_center` ADD COLUMN `userdata_provider` char(64) DEFAULT 'VirtualRouter'; -ALTER TABLE `cloud`.`data_center` ADD COLUMN `enable` tinyint NOT NULL DEFAULT 1; - -ALTER TABLE `cloud`.`op_dc_ip_address_alloc` ADD COLUMN `reservation_id` char(40) NULL; -ALTER TABLE `cloud`.`op_dc_ip_address_alloc` ADD COLUMN `mac_address` bigint unsigned NOT NULL; -UPDATE `cloud`.`op_dc_ip_address_alloc` SET reservation_id=concat(cast(instance_id as CHAR), ip_address) WHERE taken is NOT NULL; - -ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` ADD COLUMN `reservation_id` char(40) NULL; -UPDATE `cloud`.`op_dc_link_local_ip_address_alloc` SET reservation_id=concat(cast(instance_id as CHAR),ip_address) WHERE taken is NOT NULL; - -ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `enabled` tinyint NOT NULL DEFAULT 1; - -ALTER TABLE `cloud`.`op_dc_vnet_alloc` ADD COLUMN `reservation_id` char(40) NULL; -UPDATE op_dc_vnet_alloc set reservation_id=concat(cast(data_center_id as CHAR), concat("-", vnet)) WHERE taken is NOT NULL; - -ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `service_offering_id` bigint unsigned NOT NULL; -ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `reservation_id` char(40); -ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `hypervisor_type` char(32); -ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `account_id` bigint unsigned NOT NULL; -ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `domain_id` bigint unsigned NOT NULL; - -UPDATE vm_instance inner join user_vm on user_vm.id=vm_instance.id set vm_instance.service_offering_id=user_vm.service_offering_id, vm_instance.account_id=user_vm.account_id, vm_instance.domain_id=user_vm.domain_id where vm_instance.id = user_vm.id and vm_instance.type='User'; -UPDATE vm_instance inner join domain_router on vm_instance.id=domain_router.id set vm_instance.account_id=domain_router.account_id, vm_instance.domain_id=domain_router.domain_id where vm_instance.type='DomainRouter'; -UPDATE vm_instance SET service_offering_id=(SELECT id FROM disk_offering WHERE unique_name='Cloud.Com-SoftwareRouter') WHERE type='DomainRouter'; -UPDATE vm_instance SET service_offering_id=(SELECT id FROM disk_offering WHERE unique_name='Cloud.Com-ConsoleProxy') WHERE type='ConsoleProxy'; -UPDATE vm_instance SET service_offering_id=(SELECT id FROM disk_offering WHERE unique_name='Cloud.Com-SecondaryStorage') WHERE type='SecondaryStorageVm'; - -ALTER TABLE `cloud`.`user_vm` ADD COLUMN `iso_id` bigint unsigned; -ALTER TABLE `cloud`.`user_vm` ADD COLUMN `display_name` varchar(255); - -UPDATE user_vm inner join vm_instance on user_vm.id=vm_instance.id set user_vm.iso_id=vm_instance.iso_id, user_vm.display_name=vm_instance.display_name where vm_instance.type='User'; - -ALTER TABLE `cloud`.`template_host_ref` ADD COLUMN `physical_size` bigint unsigned DEFAULT 0; -UPDATE template_host_ref INNER JOIN template_spool_ref ON template_host_ref.template_id=template_spool_ref.template_id SET template_host_ref.physical_size=template_spool_ref.template_size; - - -CREATE TABLE `cloud`.`user_vm_details` ( - `id` bigint unsigned NOT NULL auto_increment, - `vm_id` bigint unsigned NOT NULL COMMENT 'vm id', - `name` varchar(255) NOT NULL, - `value` varchar(1024) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_user_vm_details__vm_id` FOREIGN KEY `fk_user_vm_details__vm_id`(`vm_id`) REFERENCES `user_vm`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`domain_router` MODIFY COLUMN `guest_netmask` varchar(15); -ALTER TABLE `cloud`.`domain_router` MODIFY COLUMN `guest_ip_address` varchar(15); -ALTER TABLE `cloud`.`domain_router` ADD COLUMN `network_id` bigint unsigned NOT NULL; - -CREATE TABLE `cloud`.`upload` ( - `id` bigint unsigned NOT NULL auto_increment, - `host_id` bigint unsigned NOT NULL, - `type_id` bigint unsigned NOT NULL, - `type` varchar(255), - `mode` varchar(255), - `created` DATETIME NOT NULL, - `last_updated` DATETIME, - `job_id` varchar(255), - `upload_pct` int(10) unsigned, - `upload_state` varchar(255), - `error_str` varchar(255), - `url` varchar(255), - `install_path` varchar(255), - PRIMARY KEY (`id`), - CONSTRAINT `fk_upload__host_id` FOREIGN KEY `fk_upload__host_id` (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE, - INDEX `i_upload__host_id`(`host_id`), - INDEX `i_upload__type_id`(`type_id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`console_proxy` MODIFY COLUMN `public_mac_address` varchar(17); - -ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `public_mac_address` varchar(17); -ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `nfs_share` varchar(255); - -ALTER TABLE `cloud`.`resource_count` ADD COLUMN `domain_id` bigint unsigned; -ALTER TABLE `cloud`.`resource_count` MODIFY COLUMN `account_id` bigint unsigned; - -ALTER TABLE `cloud`.`op_host_capacity` ADD COLUMN `reserved_capacity` bigint unsigned NOT NULL; - -ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `system_use` tinyint(1) unsigned NOT NULL DEFAULT 0; -ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `customized` tinyint(1) unsigned NOT NULL DEFAULT 0; - -update `cloud`.`disk_offering` set system_use=1, removed=null WHERE unique_name like 'Cloud.Com-%'; -update `cloud`.`disk_offering` set name='System Offering For Console Proxy' where name='Fake Offering For DomP' and system_use=1; -update `cloud`.`service_offering` set ram_size=1024 where id=(SELECT id from disk_offering where name='System Offering For Console Proxy' and system_use=1); -update `cloud`.`disk_offering` set name='System Offering For Software Router' where name='Fake Offering For DomR' and system_use=1; -update `cloud`.`disk_offering` set name='System Offering For Secondary Storage VM' where name='Fake Offering For Secondary Storage VM' and system_use=1; - -ALTER TABLE `cloud`.`user_statistics` ADD COLUMN `public_ip_address` varchar(15) DEFAULT NULL; -ALTER TABLE `cloud`.`user_statistics` ADD COLUMN `device_id` bigint unsigned NOT NULL default 0; -ALTER TABLE `cloud`.`user_statistics` ADD COLUMN `device_type` varchar(32) NOT NULL default 'DomainRouter'; - -CREATE TABLE `cloud`.`remote_access_vpn` ( - `vpn_server_addr_id` bigint unsigned UNIQUE NOT NULL, - `account_id` bigint unsigned NOT NULL, - `network_id` bigint unsigned NOT NULL, - `domain_id` bigint unsigned NOT NULL, - `local_ip` varchar(15) NOT NULL, - `ip_range` varchar(32) NOT NULL, - `ipsec_psk` varchar(256) NOT NULL, - `state` char(32) NOT NULL, - PRIMARY KEY (`vpn_server_addr_id`), - CONSTRAINT `fk_remote_access_vpn__account_id` FOREIGN KEY `fk_remote_access_vpn__account_id`(`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_remote_access_vpn__domain_id` FOREIGN KEY `fk_remote_access_vpn__domain_id`(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_remote_access_vpn__network_id` FOREIGN KEY `fk_remote_access_vpn__network_id` (`network_id`) REFERENCES `networks` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_remote_access_vpn__vpn_server_addr_id` FOREIGN KEY `fk_remote_access_vpn__vpn_server_addr_id` (`vpn_server_addr_id`) REFERENCES `user_ip_address` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`vpn_users` ( - `id` bigint unsigned NOT NULL UNIQUE auto_increment, - `owner_id` bigint unsigned NOT NULL, - `domain_id` bigint unsigned NOT NULL, - `username` varchar(255) NOT NULL, - `password` varchar(255) NOT NULL, - `state` char(32) NOT NULL COMMENT 'What state is this vpn user in', - PRIMARY KEY (`id`), - CONSTRAINT `fk_vpn_users__owner_id` FOREIGN KEY (`owner_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_vpn_users__domain_id` FOREIGN KEY (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, - INDEX `i_vpn_users_username`(`username`), - UNIQUE `i_vpn_users__account_id__username`(`owner_id`, `username`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`storage_pool` ADD COLUMN `status` varchar(32); - ---drop network group related constraints/indexes; -ALTER TABLE `cloud`.`network_group` DROP foreign key `fk_network_group__domain_id`; -ALTER TABLE `cloud`.`network_group` DROP INDEX `fk_network_group__domain_id`; -ALTER TABLE `cloud`.`network_group` DROP foreign key `fk_network_group___account_id`; - -ALTER TABLE `cloud`.`network_group` drop index `i_network_group_name`; - -ALTER TABLE `cloud`.`network_ingress_rule` drop foreign key `fk_network_ingress_rule___network_group_id`; -ALTER TABLE `cloud`.`network_ingress_rule` drop foreign key `fk_network_ingress_rule___allowed_network_id`; -ALTER TABLE `cloud`.`network_ingress_rule` drop index `i_network_ingress_rule_network_id`; -ALTER TABLE `cloud`.`network_ingress_rule` drop index `i_network_ingress_rule_allowed_network`; - -ALTER TABLE `cloud`.`network_group_vm_map` drop foreign key `fk_network_group_vm_map___network_group_id`; -ALTER TABLE `cloud`.`network_group_vm_map` drop foreign key `fk_network_group_vm_map___instance_id`; - -ALTER TABLE `cloud`.`network_group` RENAME TO `security_group`; -ALTER TABLE `cloud`.`network_ingress_rule` RENAME TO `security_ingress_rule`; -ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `network_group_id` `security_group_id` bigint unsigned NOT NULL; -ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `allowed_network_group` `allowed_security_group` varchar(255); -ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `allowed_net_grp_acct` `allowed_sec_grp_acct` varchar(100); -ALTER TABLE `cloud`.`network_group_vm_map` RENAME TO `security_group_vm_map`; -ALTER TABLE `cloud`.`security_group_vm_map` CHANGE COLUMN `network_group_id` `security_group_id` bigint unsigned NOT NULL; - -ALTER TABLE `cloud`.`security_group` ADD CONSTRAINT `fk_security_group__domain_id` FOREIGN KEY `fk_security_group__domain_id` (`domain_id`) REFERENCES `domain` (`id`); -ALTER TABLE `cloud`.`security_group` ADD INDEX `i_security_group_name`(`name`); - -ALTER TABLE `cloud`.`security_ingress_rule` ADD CONSTRAINT `fk_security_ingress_rule___security_group_id` FOREIGN KEY `fk_security_ingress_rule__security_group_id` (`security_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`security_ingress_rule` ADD CONSTRAINT `fk_security_ingress_rule___allowed_network_id` FOREIGN KEY `fk_security_ingress_rule__allowed_network_id` (`allowed_network_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`security_ingress_rule` ADD INDEX `i_security_ingress_rule_network_id`(`security_group_id`); -ALTER TABLE `cloud`.`security_ingress_rule` ADD INDEX `i_security_ingress_rule_allowed_network`(`allowed_network_id`); - -ALTER TABLE `cloud`.`security_group_vm_map` DROP KEY `fk_network_group_vm_map___network_group_id`; -ALTER TABLE `cloud`.`security_group_vm_map` DROP KEY `fk_network_group_vm_map___instance_id`; -ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___security_group_id` FOREIGN KEY `fk_security_group_vm_map___security_group_id` (`security_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___instance_id` FOREIGN KEY `fk_security_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE; ---n/w to sec grps ends --; - -CREATE TABLE `cloud`.`instance_group` ( - `id` bigint unsigned NOT NULL UNIQUE auto_increment, - `account_id` bigint unsigned NOT NULL COMMENT 'owner. foreign key to account table', - `name` varchar(255) NOT NULL, - `removed` datetime COMMENT 'date the group was removed', - `created` datetime COMMENT 'date the group was created', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`instance_group_vm_map` ( - `id` bigint unsigned NOT NULL auto_increment, - `group_id` bigint unsigned NOT NULL, - `instance_id` bigint unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`ssh_keypairs` ( - `id` bigint unsigned NOT NULL auto_increment COMMENT 'id', - `account_id` bigint unsigned NOT NULL COMMENT 'owner, foreign key to account table', - `domain_id` bigint unsigned NOT NULL COMMENT 'domain, foreign key to domain table', - `keypair_name` varchar(256) NOT NULL COMMENT 'name of the key pair', - `fingerprint` varchar(128) NOT NULL COMMENT 'fingerprint for the ssh public key', - `public_key` varchar(5120) NOT NULL COMMENT 'public key of the ssh key pair', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`usage_event` ( - `id` bigint unsigned NOT NULL auto_increment, - `type` varchar(32) NOT NULL, - `account_id` bigint unsigned NOT NULL, - `created` datetime NOT NULL, - `zone_id` bigint unsigned NOT NULL, - `resource_id` bigint unsigned, - `resource_name` varchar(255), - `offering_id` bigint unsigned, - `template_id` bigint unsigned, - `size` bigint unsigned, - `processed` tinyint NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`ovs_host_vlan_alloc`( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, - `host_id` bigint unsigned COMMENT 'host id', - `account_id` bigint unsigned COMMENT 'account id', - `vlan` bigint unsigned COMMENT 'vlan id under account #account_id on host #host_id', - `ref` int unsigned NOT NULL DEFAULT 0 COMMENT 'reference count', - PRIMARY KEY(`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`ovs_tunnel_alloc`( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, - `from` bigint unsigned COMMENT 'from host id', - `to` bigint unsigned COMMENT 'to host id', - `in_port` int unsigned COMMENT 'in port on open vswitch', - PRIMARY KEY(`from`, `to`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`ovs_tunnel`( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, - `from` bigint unsigned COMMENT 'from host id', - `to` bigint unsigned COMMENT 'to host id', - `key` int unsigned default '0' COMMENT 'current gre key can be used', - PRIMARY KEY(`from`, `to`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`ovs_tunnel_account`( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, - `from` bigint unsigned COMMENT 'from host id', - `to` bigint unsigned COMMENT 'to host id', - `account` bigint unsigned COMMENT 'account', - `key` int unsigned COMMENT 'gre key', - `port_name` varchar(32) COMMENT 'in port on open vswitch', - `state` varchar(16) default 'FAILED' COMMENT 'result of tunnel creatation', - PRIMARY KEY(`from`, `to`, `account`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO `cloud`.`ovs_tunnel_account` (`from`, `to`, `account`, `key`, `port_name`, `state`) VALUES (0, 0, 0, 0, 'lock', 'SUCCESS'); - -CREATE TABLE `cloud`.`ovs_vlan_mapping_dirty`( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, - `account_id` bigint unsigned COMMENT 'account id', - `dirty` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 means vlan mapping of this account was changed', - PRIMARY KEY(`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`ovs_vm_flow_log` ( - `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', - `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance that needs flows to be synced.', - `created` datetime NOT NULL COMMENT 'time the entry was requested', - `logsequence` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies flow update', - `vm_name` varchar(255) NOT NULL COMMENT 'vm name', - - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`ovs_work` ( - `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', - `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance that needs rules to be synced.', - `mgmt_server_id` bigint unsigned COMMENT 'management server that has taken up the work of doing rule sync', - `created` datetime NOT NULL COMMENT 'time the entry was requested', - `taken` datetime COMMENT 'time it was taken by the management server', - `step` varchar(32) NOT NULL COMMENT 'Step in the work', - `seq_no` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies ruleset update', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`storage_pool_work` ( - `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', - `pool_id` bigint unsigned NOT NULL COMMENT 'storage pool associated with the vm', - `vm_id` bigint unsigned NOT NULL COMMENT 'vm identifier', - `stopped_for_maintenance` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'this flag denoted whether the vm was stopped during maintenance', - `started_after_maintenance` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'this flag denoted whether the vm was started after maintenance', - `mgmt_server_id` bigint unsigned NOT NULL COMMENT 'management server id', - PRIMARY KEY (`id`), - UNIQUE (pool_id,vm_id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -UPDATE vm_instance set hypervisor_type=(SELECT value FROM configuration WHERE name='hypervisor.type'); - --- Insert stuff?; -INSERT INTO `cloud`.`sequence` (name, value) VALUES ('volume_seq', (SELECT max(id) + 1 or 200 from volumes)); -INSERT INTO `cloud`.`sequence` (name, value) VALUES ('networks_seq', 200); - -DELETE FROM `cloud`.`sync_queue`; -DELETE FROM `cloud`.`sync_queue_item`; -DELETE FROM `cloud`.`async_job`; -UPDATE `cloud`.`vm_template` SET type='SYSTEM' WHERE name='systemvm-xenserver-2.2.4'; -UPDATE `cloud`.`vm_template` SET type='BUILTIN' WHERE unique_name='centos53-x86_64'; -UPDATE `cloud`.`vm_template` SET type='PERHOST' WHERE unique_name='xs-tools.iso'; -DELETE FROM template_host_ref WHERE install_path LIKE '%xs-tools%'; -DELETE FROM configuration where name='upgrade.url'; -DELETE FROM configuration where name='router.template.id'; -INSERT INTO configuration (category, instance, component, name, value, description) - VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.client.iprange', '10.1.2.1-10.1.2.8', 'The range of ips to be allocated to remote access vpn clients. The first ip in the range is used by the VPN server'); -INSERT INTO configuration (category, instance, component, name, value, description) - VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.psk.length', '48', 'The length of the ipsec preshared key (minimum 8, maximum 256)'); -INSERT INTO configuration (category, instance, component, name, value, description) - VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.user.limit', '8', 'The maximum number of VPN users that can be created per account'); -INSERT INTO configuration (category, instance, component, name, value, description) - VALUES ('Advanced', 'DEFAULT', 'management-server', 'management-server', NULL, 'The cidr of management server network'); -Update configuration set name='storage.max.volume.size' where name='max.volume.size.mb'; -INSERT INTO sequence (name, value) - VALUES ('snapshots_seq', '1'); -UPDATE cloud.sequence SET value=IF((SELECT COUNT(*) FROM cloud.snapshots) > 0, (SELECT max(id) FROM cloud.snapshots) + 1, 1) WHERE name='snapshots_seq'; -UPDATE configuration set name='direct.attach.security.groups.enabled' where name='direct.attach.network.groups.enabled'; -UPDATE configuration set name='guest.domain.suffix' where name='domain.suffix'; -UPDATE vm_template set type='SYSTEM' where id=1; -UPDATE vm_template set type='SYSTEM' WHERE unique_name LIKE 'routing%'; -UPDATE `cloud`.`vm_template` SET type='USER' WHERE type!='BUILTIN' AND type!='PERHOST' AND type!='SYSTEM'; - -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (8, 'Novel'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (9, 'Unix'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (10, 'Ubuntu'); - -update `cloud`.`guest_os` set display_name = 'Debian GNU/Linux 5.0 (32-bit)' where id=15; -update `cloud`.`guest_os` set display_name = 'Windows Server 2003 (32-bit)' where id=50; -update `cloud`.`guest_os` set display_name = 'Windows Server 2003 (64-bit)' where id=51; -update `cloud`.`guest_os` set display_name = 'Windows Server 2008 (32-bit)' where id=52; -update `cloud`.`guest_os` set display_name = 'Windows Server 2008 (64-bit)' where id=53; -update `cloud`.`guest_os` set display_name = 'Other Ubuntu (32-bit)' where id=59; -update `cloud`.`guest_os` set display_name = 'Other (32-bit)' where id=60; -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (61, 6, 'Windows 2000 Server'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (62, 6, 'Windows 98'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (63, 6, 'Windows 95'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (64, 6, 'Windows NT 4'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (65, 6, 'Windows 3.1'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (66, 4, 'Red Hat Enterprise Linux 3(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (67, 4, 'Red Hat Enterprise Linux 3(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (68, 7, 'Open Enterprise Server'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (69, 7, 'Asianux 3(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (70, 7, 'Asianux 3(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (72, 2, 'Debian GNU/Linux 5(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (73, 2, 'Debian GNU/Linux 4(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (74, 2, 'Debian GNU/Linux 4(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (75, 7, 'Other 2.6x Linux (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (76, 7, 'Other 2.6x Linux (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (77, 8, 'Novell Netware 6.x'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (78, 8, 'Novell Netware 5.1'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (79, 9, 'Sun Solaris 10(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (80, 9, 'Sun Solaris 10(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (81, 9, 'Sun Solaris 9(Experimental)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (82, 9, 'Sun Solaris 8(Experimental)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (83, 9, 'FreeBSD (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (84, 9, 'FreeBSD (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (85, 9, 'SCO OpenServer 5'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (86, 9, 'SCO UnixWare 7'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (87, 6, 'Windows Server 2003 DataCenter Edition(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (88, 6, 'Windows Server 2003 DataCenter Edition(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (89, 6, 'Windows Server 2003 Standard Edition(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (90, 6, 'Windows Server 2003 Standard Edition(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (91, 6, 'Windows Server 2003 Web Edition'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (92, 6, 'Microsoft Small Bussiness Server 2003'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (93, 6, 'Windows XP (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (94, 6, 'Windows XP (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (95, 6, 'Windows 2000 Advanced Server'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (96, 5, 'SUSE Linux Enterprise 8(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (97, 5, 'SUSE Linux Enterprise 8(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (98, 7, 'Other Linux (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (99, 7, 'Other Linux (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (100, 10, 'Other Ubuntu (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (101, 6, 'Windows Vista (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (102, 6, 'DOS'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (103, 7, 'Other (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (104, 7, 'OS/2'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (105, 6, 'Windows 2000 Professional'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (106, 4, 'Red Hat Enterprise Linux 4(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (107, 5, 'SUSE Linux Enterprise 9(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (108, 5, 'SUSE Linux Enterprise 9(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (109, 5, 'SUSE Linux Enterprise 10(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (110, 5, 'SUSE Linux Enterprise 10(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (111, 1, 'CentOS 5.5 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (112, 1, 'CentOS 5.5 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (113, 4, 'Red Hat Enterprise Linux 5.5 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (114, 4, 'Red Hat Enterprise Linux 5.5 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (115, 4, 'Fedora 13'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (116, 4, 'Fedora 12'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (117, 4, 'Fedora 11'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (118, 4, 'Fedora 10'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (119, 4, 'Fedora 9'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (120, 4, 'Fedora 8'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (121, 10, 'Ubuntu 10.04 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (122, 10, 'Ubuntu 9.10 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (123, 10, 'Ubuntu 9.04 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (124, 10, 'Ubuntu 8.10 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (125, 10, 'Ubuntu 8.04 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (126, 10, 'Ubuntu 10.04 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (127, 10, 'Ubuntu 9.10 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (128, 10, 'Ubuntu 9.04 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (129, 10, 'Ubuntu 8.10 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (130, 10, 'Ubuntu 8.04 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (131, 4, 'Red Hat Enterprise Linux 2'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (132, 2, 'Debian GNU/Linux 6(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (133, 2, 'Debian GNU/Linux 6(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (134, 3, 'Oracle Enterprise Linux 5.5 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (135, 3, 'Oracle Enterprise Linux 5.5 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (136, 4, 'Red Hat Enterprise Linux 6.0 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (137, 4, 'Red Hat Enterprise Linux 6.0 (64-bit)'); - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.5 (32-bit)', 1); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.6 (32-bit)', 2); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.7 (32-bit)', 3); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.8 (32-bit)', 4); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.0 (32-bit)', 5); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.0 (64-bit)', 6); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.1 (32-bit)', 7); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.1 (32-bit)', 8); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.2 (32-bit)', 9); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.2 (64-bit)', 10); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.3 (32-bit)', 11); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.3 (64-bit)', 12); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.4 (32-bit)', 13); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.4 (64-bit)', 14); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Debian Lenny 5.0 (32-bit)', 15); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.0 (32-bit)', 16); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.0 (64-bit)', 17); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.1 (32-bit)', 18); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.1 (64-bit)', 19); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.2 (32-bit)', 20); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.2 (64-bit)', 21); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.3 (32-bit)', 22); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.3 (64-bit)', 23); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.4 (32-bit)', 24); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.4 (64-bit)', 25); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.5 (32-bit)', 26); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.6 (32-bit)', 27); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.7 (32-bit)', 28); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.8 (32-bit)', 29); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.0 (32-bit)', 30); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.0 (64-bit)', 31); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.1 (32-bit)', 32); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.1 (64-bit)', 33); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.2 (32-bit)', 34); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.2 (64-bit)', 35); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.3 (32-bit)', 36); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.3 (64-bit)', 37); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.4 (32-bit)', 38); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.4 (64-bit)', 39); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 9 SP4 (32-bit)', 40); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP1 (32-bit)', 41); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP1 (64-bit)', 42); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP2 (32-bit)', 43); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP2 (64-bit)', 44); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP3 (64-bit)', 45); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 11 (32-bit)', 46); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 11 (64-bit)', 47); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows 7 (32-bit)', 48); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows 7 (64-bit)', 49); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2003 (32-bit)', 50); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2003 (64-bit)', 51); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2008 (32-bit)', 52); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2008 (64-bit)', 53); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2008 R2 (64-bit)', 54); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows 2000 SP4 (32-bit)', 55); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Vista (32-bit)', 56); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows XP SP2 (32-bit)', 57); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows XP SP3 (32-bit)', 58); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 59); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 100); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 60); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 103); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 121); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 126); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 122); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 127); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 123); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 128); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 124); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 129); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 125); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 130); - - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 7(32-bit)', 48); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 7(64-bit)', 49); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2008 R2(64-bit)', 54); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2008(32-bit)', 52); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2008(64-bit)', 53); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Enterprise Edition (32-bit)', 50); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Enterprise Edition (64-bit)', 51); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Datacenter Edition (32-bit)', 87); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Datacenter Edition (64-bit)', 88); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Standard Edition (32-bit)', 89); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Standard Edition (64-bit)', 90); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Web Edition', 91); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Small Bussiness Server 2003', 92); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Vista (32-bit)', 56); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Vista (64-bit)', 101); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 93); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 57); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 58); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (64-bit)', 94); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Advanced Server', 95); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Server', 61); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Professional', 105); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Server', 55); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 98', 62); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 95', 63); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows NT 4', 64); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 3.1', 65); - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 30); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 32); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 34); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 36); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 38); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 31); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 33); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 35); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 37); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 39); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 26); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 27); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 28); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 29); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(64-bit)', 106); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 3(32-bit)', 66); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 3(64-bit)', 67); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 2', 131); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 11(32-bit)', 46); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 11(64-bit)', 47); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(32-bit)', 41); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(32-bit)', 43); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 42); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 44); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 45); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(32-bit)', 109); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 110); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(32-bit)', 40); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(32-bit)', 96); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(64-bit)', 97); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(32-bit)', 107); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(64-bit)', 108); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Open Enterprise Server', 68); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Asianux 3(32-bit)', 69); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Asianux 3(64-bit)', 70); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 5(32-bit)', 15); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 5(64-bit)', 72); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 4(32-bit)', 73); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 4(64-bit)', 74); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 59); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 121); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 122); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 123); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 124); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 125); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 100); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 126); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 127); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 128); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 129); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 130); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other 2.6x Linux (32-bit)', 75); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other 2.6x Linux (64-bit)', 76); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other Linux (32-bit)', 98); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other Linux (64-bit)', 99); - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Novell Netware 6.x', 77); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Novell Netware 5.1', 78); - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 10(32-bit)', 79); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 10(64-bit)', 80); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 9(Experimental)', 81); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 8(Experimental)', 82); - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'FreeBSD (32-bit)', 83); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'FreeBSD (64-bit)', 84); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'OS/2', 104); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'SCO OpenServer 5', 85); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'SCO UnixWare 7', 86); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'DOS', 102); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other (32-bit)', 60); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other (64-bit)', 103); - - - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.5', 1); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.6', 2); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.7', 3); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.8', 4); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.0', 5); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.0', 6); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.1', 7); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.1', 8); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.2', 9); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.2', 10); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.3', 11); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.3', 12); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.4', 13); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.4', 14); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.5', 111); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.5', 112); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.5', 26); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.6', 27); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.7', 28); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.8', 29); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.0', 30); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.0', 31); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.1', 32); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.1', 33); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.2', 34); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.2', 35); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.3', 36); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.3', 37); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.4', 38); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.4', 39); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.5', 113); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.5', 114); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4', 106); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 3', 66); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 3', 67); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 2', 131); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 13', 115); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 12', 116); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 11', 117); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 10', 118); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 9', 119); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 8', 120); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 10.04', 121); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 10.04', 126); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.10', 122); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.10', 127); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.04', 123); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.04', 128); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.10', 124); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.10', 129); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.04', 125); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.04', 130); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 5', 15); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 5', 72); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 4', 73); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 4', 74); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux 2.6x', 75); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux 2.6x', 76); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Ubuntu', 59); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Ubuntu', 100); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux', 98); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux', 99); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 7', 48); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 7', 49); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 50); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 51); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 87); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 88); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 89); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 90); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 91); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 92); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2008', 52); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2008', 53); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 2000', 55); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 2000', 61); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 2000', 95); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 98', 62); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Vista', 56); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Vista', 101); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP SP2', 57); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP SP3', 58); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP ', 93); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP ', 94); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'DOS', 102); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other', 60); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other', 103); -UPDATE `cloud`.`guest_os` SET name = display_name; - -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (3, 'routing-3', 'SystemVM Template (KVM)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://download.cloud.com/releases/2.2.0/systemvm.qcow2.bz2', 'ec463e677054f280f152fcc264255d2f', 0, 'SystemVM Template (KVM)', 'QCOW2', 15, 0, 1, 'KVM'); -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (8, 'routing-8', 'SystemVM Template (vSphere)', 0, now(), 'SYSTEM', 0, 32, 1, 'http://download.cloud.com/releases/2.2.0/systemvm.ova', '3c9d4c704af44ebd1736e1bc78cec1fa', 0, 'SystemVM Template (vSphere)', 'OVA', 15, 0, 1, 'VMware'); - -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, display_text, enable_password, format, guest_os_id, featured, cross_zones, hypervisor_type, extractable) - VALUES (4, 'centos55-x86_64', 'CentOS 5.5(64-bit) no GUI (KVM)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://download.cloud.com/releases/2.2.0/eec2209b-9875-3c8d-92be-c001bd8a0faf.qcow2.bz2', 'ed0e788280ff2912ea40f7f91ca7a249', 'CentOS 5.5(64-bit) no GUI (KVM)', 0, 'QCOW2', 112, 1, 1, 'KVM', 1); - -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type, extractable) - VALUES (7, 'centos53-x64', 'CentOS 5.3(64-bit) no GUI (vSphere)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://download.cloud.com/releases/2.2.0/CentOS5.3-x86_64.ova', 'f6f881b7f2292948d8494db837fe0f47', 0, 'CentOS 5.3(64-bit) no GUI (vSphere)', 'OVA', 12, 1, 1, 'VMware', 1); -UPDATE vm_instance SET guest_os_id=15 where vm_template_id=1; -UPDATE vm_instance SET vm_template_id=(SELECT id FROM vm_template WHERE name='systemvm-xenserver-2.2.4' AND removed IS NULL) where vm_template_id=1; - - -ALTER TABLE `cloud`.`instance_group` ADD CONSTRAINT `fk_instance_group__account_id` FOREIGN KEY `fk_instance_group__account_id` (`account_id`) REFERENCES `account` (`id`); - -ALTER TABLE `cloud`.`instance_group_vm_map` ADD CONSTRAINT `fk_instance_group_vm_map___group_id` FOREIGN KEY `fk_instance_group_vm_map___group_id` (`group_id`) REFERENCES `instance_group` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`instance_group_vm_map` ADD CONSTRAINT `fk_instance_group_vm_map___instance_id` FOREIGN KEY `fk_instance_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `guid` varchar(255); - -ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `fk_ssh_keypairs__account_id` FOREIGN KEY `fk_ssh_keypair__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `fk_ssh_keypairs__domain_id` FOREIGN KEY `fk_ssh_keypair__domain_id` (`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE; -UPDATE vm_template SET hypervisor_type='XenServer' WHERE hypervisor_type IS NULL AND format='VHD'; -UPDATE vm_template SET hypervisor_type='KVM' WHERE hypervisor_type IS NULL AND format='QCOW2'; -UPDATE vm_template SET hypervisor_type='VmWare' WHERE hypervisor_type IS NULL AND format='OVA'; -UPDATE vm_template SET hypervisor_type='None' WHERE hypervisor_type IS NULL AND format='ISO'; - -ALTER TABLE `cloud`.`volumes` ADD COLUMN `source_id` bigint unsigned COMMENT 'id for the source'; -ALTER TABLE `cloud`.`volumes` ADD COLUMN `source_type` varchar(32) COMMENT 'source from which the volume is created -- snapshot, diskoffering, template, blank'; - -ALTER TABLE `cloud`.`user_statistics` ADD UNIQUE KEY `account_id` (`account_id`,`data_center_id`); -#UPDATE vm_instance SET instance_name=concat("r-", concat(cast(id as CHAR), concat("-", (SELECT value FROM configuration WHERE name='instance.name')))) WHERE type='DomainRouter'; -#UPDATE vm_instance SET instance_name=concat("s-", concat(cast(id as CHAR), concat("-", (SELECT value FROM configuration WHERE name='instance.name')))) WHERE type='SecondaryStorageVm'; -#UPDATE vm_instance SET instance_name=concat("v-", concat(cast(id as CHAR), concat("-", (SELECT value FROM configuration WHERE name='instance.name')))) WHERE type='ConsoleProxy'; -#UPDATE vm_instance SET instance_name=concat("i-", concat(cast(account_id as CHAR), concat("-", concat(cast(id as CHAR), concat("-", (SELECT value FROM configuration WHERE name='instance.name')))))) WHERE type='User'; - -ALTER TABLE `cloud`.`data_center` MODIFY COLUMN `guest_network_cidr` varchar(18); - -ALTER TABLE `cloud`.`op_ha_work` ADD CONSTRAINT `fk_op_ha_work__instance_id` FOREIGN KEY `fk_op_ha_work__instance_id` (`instance_id`) REFERENCES `vm_instance` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`op_ha_work` ADD CONSTRAINT `fk_op_ha_work__mgmt_server_id` FOREIGN KEY `fk_op_ha_work__mgmt_server_id`(`mgmt_server_id`) REFERENCES `mshost`(`msid`); - -ALTER TABLE `cloud`.`secondary_storage_vm` ADD CONSTRAINT `fk_secondary_storage_vm__id` FOREIGN KEY `fk_secondary_storage_vm__id`(`id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`snapshots` MODIFY COLUMN `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'Primary Key'; - -ALTER TABLE `cloud`.`storage_pool` DROP KEY `uuid`; - -ALTER TABLE `cloud`.`template_host_ref` DROP FOREIGN KEY `fk_template_host_ref__template_id`; -ALTER TABLE `cloud`.`template_host_ref` ADD CONSTRAINT `fk_template_host_ref__template_id` FOREIGN KEY `fk_template_host_ref__template_id` (`template_id`) REFERENCES `vm_template` (`id`); - -ALTER TABLE `cloud`.`user_ip_address` ADD CONSTRAINT `fk_user_ip_address__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE; - -INSERT INTO configuration (category, instance, component, name, value, description) - VALUES ('Advanced', 'DEFAULT', 'management-server', 'hypervisor.list', 'KVM,XenServer,VMware', 'The list of hypervisors that this deployment will use.'); - -DELETE FROM load_balancer_vm_map WHERE load_balancer_id NOT IN (SELECT id FROM load_balancer); -DELETE FROM vm_instance WHERE type='User' AND id NOT IN (SELECT id FROM user_vm); - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.1 to 2.2; +--; +ALTER TABLE `cloud`.`cluster` ADD COLUMN `guid` varchar(255) UNIQUE DEFAULT NULL; +ALTER TABLE `cloud`.`cluster` ADD COLUMN `cluster_type` varchar(64) DEFAULT 'CloudManaged'; +ALTER TABLE `cloud`.`vm_template` ADD COLUMN `hypervisor_type` varchar(32) COMMENT 'hypervisor that the template is belonged to'; +ALTER TABLE `cloud`.`vm_template` ADD COLUMN `extractable` int(1) unsigned NOT NULL default 0 COMMENT 'Is this template extractable'; +ALTER TABLE `cloud`.`template_spool_ref` ADD CONSTRAINT `fk_template_spool_ref__template_id` FOREIGN KEY (`template_id`) REFERENCES `vm_template`(`id`); + +ALTER TABLE `cloud`.`guest_os` modify `name` varchar(255) ; + +-- NOTE for tables below; +-- these 2 tables were used in 2.1, but are not in 2.2; +-- we will need a migration script for these tables when the migration is written; +-- furthermore we have renamed the following in 2.2; +-- network_group table --> security_group table; +-- network_group_vm_map table --> security_group_vm_map table; +DROP TABLE `cloud`.`security_group`; +DROP TABLE `cloud`.`security_group_vm_map`; +-- needs a migration step; +#ALTER TABLE `cloud`.`account` DROP COLUMN `network_domain`; + +-- New migration from 2.1 to 2.2; + +-- Easy stuff first. All new tables.; + +CREATE TABLE IF NOT EXISTS `cloud`.`version` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', + `version` char(40) NOT NULL UNIQUE COMMENT 'version', + `updated` datetime NOT NULL COMMENT 'Date this version table was updated', + `step` char(32) NOT NULL COMMENT 'Step in the upgrade to this version', + PRIMARY KEY (`id`), + INDEX `i_version__version`(`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`mshost` DROP KEY `msid`; +ALTER TABLE `cloud`.`mshost` MODIFY COLUMN `msid` bigint unsigned NOT NULL UNiQUE; + +CREATE TABLE `cloud`.`op_it_work` ( + `id` char(40) COMMENT 'reservation id', + `mgmt_server_id` bigint unsigned COMMENT 'management server id', + `created_at` bigint unsigned NOT NULL COMMENT 'when was this work detail created', + `thread` varchar(255) NOT NULL COMMENT 'thread name', + `type` char(32) NOT NULL COMMENT 'type of work', + `step` char(32) NOT NULL COMMENT 'state', + `updated_at` bigint unsigned NOT NULL COMMENT 'time it was taken over', + `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance', + `resource_type` char(32) COMMENT 'type of resource being worked on', + `resource_id` bigint unsigned COMMENT 'resource id being worked on', + PRIMARY KEY (`id`), + CONSTRAINT `fk_op_it_work__mgmt_server_id` FOREIGN KEY (`mgmt_server_id`) REFERENCES `mshost`(`msid`), + CONSTRAINT `fk_op_it_work__instance_id` FOREIGN KEY (`instance_id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE, + INDEX `i_op_it_work__step`(`step`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`network_offerings` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', + `name` varchar(64) NOT NULL unique COMMENT 'network offering', + `display_text` varchar(255) NOT NULL COMMENT 'text to display to users', + `nw_rate` smallint unsigned COMMENT 'network rate throttle mbits/s', + `mc_rate` smallint unsigned COMMENT 'mcast rate throttle mbits/s', + `concurrent_connections` int(10) unsigned COMMENT 'concurrent connections supported on this network', + `traffic_type` varchar(32) NOT NULL COMMENT 'traffic type carried on this network', + `tags` varchar(4096) COMMENT 'tags supported by this offering', + `system_only` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Is this network offering for system use only', + `specify_vlan` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Should the user specify vlan', + `service_offering_id` bigint unsigned UNIQUE COMMENT 'service offering id that this network offering is tied to', + `created` datetime NOT NULL COMMENT 'time the entry was created', + `removed` datetime DEFAULT NULL COMMENT 'time the entry was removed', + `default` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if network offering is default', + `availability` varchar(255) NOT NULL COMMENT 'availability of the network', + `dns_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides dns service', + `gateway_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides gateway service', + `firewall_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides firewall service', + `lb_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides lb service', + `userdata_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides user data service', + `vpn_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides vpn service', + `dhcp_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides dhcp service', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`networks` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `name` varchar(255) COMMENT 'name for this network', + `display_text` varchar(255) COMMENT 'display text for this network', + `traffic_type` varchar(32) NOT NULL COMMENT 'type of traffic going through this network', + `broadcast_domain_type` varchar(32) NOT NULL COMMENT 'type of broadcast domain used', + `broadcast_uri` varchar(255) COMMENT 'broadcast domain specifier', + `gateway` varchar(15) COMMENT 'gateway for this network configuration', + `cidr` varchar(18) COMMENT 'network cidr', + `mode` varchar(32) COMMENT 'How to retrieve ip address in this network', + `network_offering_id` bigint unsigned NOT NULL COMMENT 'network offering id that this configuration is created from', + `data_center_id` bigint unsigned NOT NULL COMMENT 'data center id that this configuration is used in', + `guru_name` varchar(255) NOT NULL COMMENT 'who is responsible for this type of network configuration', + `state` varchar(32) NOT NULL COMMENT 'what state is this configuration in', + `related` bigint unsigned NOT NULL COMMENT 'related to what other network configuration', + `domain_id` bigint unsigned NOT NULL COMMENT 'foreign key to domain id', + `account_id` bigint unsigned NOT NULL COMMENT 'owner of this network', + `dns1` varchar(255) COMMENT 'comma separated DNS list', + `dns2` varchar(255) COMMENT 'comma separated DNS list', + `guru_data` varchar(1024) COMMENT 'data stored by the network guru that setup this network', + `set_fields` bigint unsigned NOT NULL DEFAULT 0 COMMENT 'which fields are set already', + `guest_type` char(32) COMMENT 'type of guest network', + `shared` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '0 if network is shared, 1 if network dedicated', + `network_domain` varchar(255) COMMENT 'domain', + `reservation_id` char(40) COMMENT 'reservation id', + `is_default` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if network is default', + `created` datetime NOT NULL COMMENT 'date created', + `removed` datetime COMMENT 'date removed if not null', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`op_networks`( + `id` bigint unsigned NOT NULL UNIQUE KEY, + `mac_address_seq` bigint unsigned NOT NULL DEFAULT 1 COMMENT 'mac address', + `nics_count` int unsigned NOT NULL DEFAULT 0 COMMENT '# of nics', + `gc` tinyint unsigned NOT NULL DEFAULT 1 COMMENT 'gc this network or not', + `check_for_gc` tinyint unsigned NOT NULL DEFAULT 1 COMMENT 'check this network for gc or not', + PRIMARY KEY(`id`), + CONSTRAINT `fk_op_networks__id` FOREIGN KEY (`id`) REFERENCES `networks`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`account_network_ref` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `account_id` bigint unsigned NOT NULL COMMENT 'account id', + `network_id` bigint unsigned NOT NULL COMMENT 'network id', + `is_owner` smallint(1) NOT NULL COMMENT 'is the owner of the network', + PRIMARY KEY (`id`), + CONSTRAINT `fk_account_network_ref__account_id` FOREIGN KEY (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_account_network_ref__networks_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `cloud`.`certificate` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `certificate` text COMMENT 'the actual custom certificate being stored in the db', + `updated` varchar(1) COMMENT 'status of the certificate', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `cloud`.`certificate` (id,certificate,updated) VALUES ('1',null,'N'); + +CREATE TABLE `cloud`.`nics` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', + `instance_id` bigint unsigned COMMENT 'vm instance id', + `mac_address` varchar(17) COMMENT 'mac address', + `ip4_address` varchar(15) COMMENT 'ip4 address', + `netmask` varchar(15) COMMENT 'netmask for ip4 address', + `gateway` varchar(15) COMMENT 'gateway', + `ip_type` varchar(32) COMMENT 'type of ip', + `broadcast_uri` varchar(255) COMMENT 'broadcast uri', + `network_id` bigint unsigned NOT NULL COMMENT 'network configuration id', + `mode` varchar(32) COMMENT 'mode of getting ip address', + `state` varchar(32) NOT NULL COMMENT 'state of the creation', + `strategy` varchar(32) NOT NULL COMMENT 'reservation strategy', + `reserver_name` varchar(255) COMMENT 'Name of the component that reserved the ip address', + `reservation_id` varchar(64) COMMENT 'id for the reservation', + `device_id` int(10) COMMENT 'device id for the network when plugged into the virtual machine', + `update_time` timestamp NOT NULL COMMENT 'time the state was changed', + `isolation_uri` varchar(255) COMMENT 'id for isolation', + `ip6_address` char(40) COMMENT 'ip6 address', + `default_nic` tinyint NOT NULL COMMENT "None", + `created` datetime NOT NULL COMMENT 'date created', + `removed` datetime COMMENT 'date removed if not null', + PRIMARY KEY (`id`), + CONSTRAINT `fk_nics__instance_id` FOREIGN KEY `fk_nics__instance_id`(`instance_id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_nics__networks_id` FOREIGN KEY `fk_nics__networks_id`(`network_id`) REFERENCES `networks`(`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `network_offerings` VALUES (1,'System-Public-Network','System Offering for System-Public-Network',NULL,NULL,NULL,'Public',NULL,1,0,NULL,now(),NULL,0,'Required',0,0,0,0,0,0,0),(2,'System-Management-Network','System Offering for System-Management-Network',NULL,NULL,NULL,'Management',NULL,1,0,NULL,now(),NULL,0,'Required',0,0,0,0,0,0,0),(3,'System-Control-Network','System Offering for System-Control-Network',NULL,NULL,NULL,'Control',NULL,1,0,NULL,now(),NULL,0,'Required',0,0,0,0,0,0,0),(4,'System-Storage-Network','System Offering for System-Storage-Network',NULL,NULL,NULL,'Storage',NULL,1,0,NULL,now(),NULL,0,'Required',0,0,0,0,0,0,0),(5,'System-Guest-Network','System-Guest-Network',NULL,NULL,NULL,'Guest',NULL,1,0,NULL,now(),NULL,1,'Required',1,0,0,0,1,0,1),(6,'DefaultVirtualizedNetworkOffering','Virtual Vlan',NULL,NULL,NULL,'Guest',NULL,0,0,NULL,now(),NULL,1,'Required',1,1,1,1,1,1,1),(7,'DefaultDirectNetworkOffering','Direct',NULL,NULL,NULL,'Public',NULL,0,0,NULL,now(),NULL,1,'Required',1,0,0,0,1,0,1); + +CREATE TABLE `cloud`.`cluster_details` ( + `id` bigint unsigned NOT NULL auto_increment, + `cluster_id` bigint unsigned NOT NULL COMMENT 'cluster id', + `name` varchar(255) NOT NULL, + `value` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_cluster_details__cluster_id` FOREIGN KEY (`cluster_id`) REFERENCES `cluster`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `id` bigint unsigned NOT NULL UNIQUE auto_increment; +ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `one_to_one_nat` int(1) unsigned NOT NULL default '0'; +ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `vm_id` bigint unsigned DEFAULT NULL; +ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `state` char(32) NOT NULL DEFAULT 'Free'; +ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `mac_address` bigint unsigned NOT NULL; +ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `source_network_id` bigint unsigned NOT NULL; +ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `network_id` bigint unsigned; + +UPDATE `cloud`.`user_ip_address` set state='Allocated' WHERE allocated IS NOT NULL; + +CREATE TABLE `cloud`.`firewall_rules` ( + `id` bigint unsigned NOT NULL auto_increment COMMENT 'id', + `ip_address_id` bigint unsigned NOT NULL COMMENT 'id of the corresponding ip address', + `start_port` int(10) NOT NULL COMMENT 'starting port of a port range', + `end_port` int(10) NOT NULL COMMENT 'end port of a port range', + `state` char(32) NOT NULL COMMENT 'current state of this rule', + `protocol` char(16) NOT NULL default 'TCP' COMMENT 'protocol to open these ports for', + `purpose` char(32) NOT NULL COMMENT 'why are these ports opened?', + `account_id` bigint unsigned NOT NULL COMMENT 'owner id', + `domain_id` bigint unsigned NOT NULL COMMENT 'domain id', + `network_id` bigint unsigned NOT NULL COMMENT 'network id', + `xid` char(40) NOT NULL COMMENT 'external id', + `is_static_nat` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if firewall rule is one to one nat rule', + `created` datetime COMMENT 'Date created', + PRIMARY KEY (`id`), + CONSTRAINT `fk_firewall_rules__ip_address_id` FOREIGN KEY(`ip_address_id`) REFERENCES `user_ip_address`(`id`), + CONSTRAINT `fk_firewall_rules__network_id` FOREIGN KEY(`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_firewall_rules__account_id` FOREIGN KEY(`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_firewall_rules__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`port_forwarding_rules` ( + `id` bigint unsigned NOT NULL COMMENT 'id', + `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance id', + `dest_ip_address` char(40) NOT NULL COMMENT 'id_address', + `dest_port_start` int(10) NOT NULL COMMENT 'starting port of the port range to map to', + `dest_port_end` int(10) NOT NULL COMMENT 'end port of the the port range to map to', + PRIMARY KEY (`id`), + CONSTRAINT `fk_port_forwarding_rules__id` FOREIGN KEY(`id`) REFERENCES `firewall_rules`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`load_balancing_rules` ( + `id` bigint unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `description` varchar(4096) NULL COMMENT 'description', + `default_port_start` int(10) NOT NULL COMMENT 'default private port range start', + `default_port_end` int(10) NOT NULL COMMENT 'default destination port range end', + `algorithm` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_load_balancing_rules__id` FOREIGN KEY(`id`) REFERENCES `firewall_rules`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`load_balancer_vm_map` ADD COLUMN `revoke` tinyint(1) unsigned NOT NULL DEFAULT 0; + +CREATE TABLE `cloud`.`op_host` ( + `id` bigint unsigned NOT NULL UNIQUE COMMENT 'host id', + `sequence` bigint unsigned DEFAULT 1 NOT NULL COMMENT 'sequence for the host communication', + PRIMARY KEY (`id`), + CONSTRAINT `fk_op_host__id` FOREIGN KEY (`id`) REFERENCES `host`(`id`) ON DELETE CASCADE +) ENGINE = InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`guest_os_hypervisor` ( + `id` bigint unsigned NOT NULL auto_increment, + `hypervisor_type` varchar(32) NOT NULL, + `guest_os_name` varchar(255) NOT NULL, + `guest_os_id` bigint unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + +INSERT INTO op_host(id, sequence) select id, sequence from host; + +-- Alter Tables to add Columns; + +ALTER TABLE `cloud`.`cluster` ADD COLUMN `hypervisor_type` varchar(32); +UPDATE `cloud`.`cluster` SET hypervisor_type=(SELECT DISTINCT host.hypervisor_type from host where host.cluster_id = cluster.id GROUP BY host.hypervisor_type); + +ALTER TABLE `cloud`.`volumes` ADD COLUMN `attached` datetime; +UPDATE `cloud`.`volumes` SET attached=now() WHERE removed IS NULL AND instance_id IS NOT NULL; + +ALTER TABLE `cloud`.`volumes` ADD COLUMN `chain_info` text; + +ALTER TABLE `cloud`.`volumes` MODIFY COLUMN `volume_type` VARCHAR(64) NOT NULL; + +ALTER TABLE `cloud`.`volumes` ADD COLUMN `state` VARCHAR(32); +UPDATE `cloud`.`volumes` SET state='Destroy' WHERE removed IS NOT NULL OR destroyed=1 OR status='Creating' OR status='Corrupted' OR status='Failed'; +UPDATE `cloud`.`volumes` SET state='Ready' WHERE removed IS NULL AND (destroyed=0 OR destroyed is NULL) AND status='Created'; + +ALTER TABLE `cloud`.`vlan` ADD COLUMN `network_id` bigint unsigned NOT NULL; + +ALTER TABLE `cloud`.`data_center` ADD COLUMN `domain` varchar(100); +ALTER TABLE `cloud`.`data_center` ADD COLUMN `domain_id` bigint unsigned; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `networktype` varchar(255) NOT NULL DEFAULT 'Basic'; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `dns_provider` char(64) DEFAULT 'VirtualRouter'; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `gateway_provider` char(64) DEFAULT 'VirtualRouter'; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `firewall_provider` char(64) DEFAULT 'VirtualRouter'; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `dhcp_provider` char(64) DEFAULT 'VirtualRouter'; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `lb_provider` char(64) DEFAULT 'VirtualRouter'; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `vpn_provider` char(64) DEFAULT 'VirtualRouter'; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `userdata_provider` char(64) DEFAULT 'VirtualRouter'; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `enable` tinyint NOT NULL DEFAULT 1; + +ALTER TABLE `cloud`.`op_dc_ip_address_alloc` ADD COLUMN `reservation_id` char(40) NULL; +ALTER TABLE `cloud`.`op_dc_ip_address_alloc` ADD COLUMN `mac_address` bigint unsigned NOT NULL; +UPDATE `cloud`.`op_dc_ip_address_alloc` SET reservation_id=concat(cast(instance_id as CHAR), ip_address) WHERE taken is NOT NULL; + +ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` ADD COLUMN `reservation_id` char(40) NULL; +UPDATE `cloud`.`op_dc_link_local_ip_address_alloc` SET reservation_id=concat(cast(instance_id as CHAR),ip_address) WHERE taken is NOT NULL; + +ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `enabled` tinyint NOT NULL DEFAULT 1; + +ALTER TABLE `cloud`.`op_dc_vnet_alloc` ADD COLUMN `reservation_id` char(40) NULL; +UPDATE op_dc_vnet_alloc set reservation_id=concat(cast(data_center_id as CHAR), concat("-", vnet)) WHERE taken is NOT NULL; + +ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `service_offering_id` bigint unsigned NOT NULL; +ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `reservation_id` char(40); +ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `hypervisor_type` char(32); +ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `account_id` bigint unsigned NOT NULL; +ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `domain_id` bigint unsigned NOT NULL; + +UPDATE vm_instance inner join user_vm on user_vm.id=vm_instance.id set vm_instance.service_offering_id=user_vm.service_offering_id, vm_instance.account_id=user_vm.account_id, vm_instance.domain_id=user_vm.domain_id where vm_instance.id = user_vm.id and vm_instance.type='User'; +UPDATE vm_instance inner join domain_router on vm_instance.id=domain_router.id set vm_instance.account_id=domain_router.account_id, vm_instance.domain_id=domain_router.domain_id where vm_instance.type='DomainRouter'; +UPDATE vm_instance SET service_offering_id=(SELECT id FROM disk_offering WHERE unique_name='Cloud.Com-SoftwareRouter') WHERE type='DomainRouter'; +UPDATE vm_instance SET service_offering_id=(SELECT id FROM disk_offering WHERE unique_name='Cloud.Com-ConsoleProxy') WHERE type='ConsoleProxy'; +UPDATE vm_instance SET service_offering_id=(SELECT id FROM disk_offering WHERE unique_name='Cloud.Com-SecondaryStorage') WHERE type='SecondaryStorageVm'; + +ALTER TABLE `cloud`.`user_vm` ADD COLUMN `iso_id` bigint unsigned; +ALTER TABLE `cloud`.`user_vm` ADD COLUMN `display_name` varchar(255); + +UPDATE user_vm inner join vm_instance on user_vm.id=vm_instance.id set user_vm.iso_id=vm_instance.iso_id, user_vm.display_name=vm_instance.display_name where vm_instance.type='User'; + +ALTER TABLE `cloud`.`template_host_ref` ADD COLUMN `physical_size` bigint unsigned DEFAULT 0; +UPDATE template_host_ref INNER JOIN template_spool_ref ON template_host_ref.template_id=template_spool_ref.template_id SET template_host_ref.physical_size=template_spool_ref.template_size; + + +CREATE TABLE `cloud`.`user_vm_details` ( + `id` bigint unsigned NOT NULL auto_increment, + `vm_id` bigint unsigned NOT NULL COMMENT 'vm id', + `name` varchar(255) NOT NULL, + `value` varchar(1024) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_user_vm_details__vm_id` FOREIGN KEY `fk_user_vm_details__vm_id`(`vm_id`) REFERENCES `user_vm`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`domain_router` MODIFY COLUMN `guest_netmask` varchar(15); +ALTER TABLE `cloud`.`domain_router` MODIFY COLUMN `guest_ip_address` varchar(15); +ALTER TABLE `cloud`.`domain_router` ADD COLUMN `network_id` bigint unsigned NOT NULL; + +CREATE TABLE `cloud`.`upload` ( + `id` bigint unsigned NOT NULL auto_increment, + `host_id` bigint unsigned NOT NULL, + `type_id` bigint unsigned NOT NULL, + `type` varchar(255), + `mode` varchar(255), + `created` DATETIME NOT NULL, + `last_updated` DATETIME, + `job_id` varchar(255), + `upload_pct` int(10) unsigned, + `upload_state` varchar(255), + `error_str` varchar(255), + `url` varchar(255), + `install_path` varchar(255), + PRIMARY KEY (`id`), + CONSTRAINT `fk_upload__host_id` FOREIGN KEY `fk_upload__host_id` (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE, + INDEX `i_upload__host_id`(`host_id`), + INDEX `i_upload__type_id`(`type_id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`console_proxy` MODIFY COLUMN `public_mac_address` varchar(17); + +ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `public_mac_address` varchar(17); +ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `nfs_share` varchar(255); + +ALTER TABLE `cloud`.`resource_count` ADD COLUMN `domain_id` bigint unsigned; +ALTER TABLE `cloud`.`resource_count` MODIFY COLUMN `account_id` bigint unsigned; + +ALTER TABLE `cloud`.`op_host_capacity` ADD COLUMN `reserved_capacity` bigint unsigned NOT NULL; + +ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `system_use` tinyint(1) unsigned NOT NULL DEFAULT 0; +ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `customized` tinyint(1) unsigned NOT NULL DEFAULT 0; + +update `cloud`.`disk_offering` set system_use=1, removed=null WHERE unique_name like 'Cloud.Com-%'; +update `cloud`.`disk_offering` set name='System Offering For Console Proxy' where name='Fake Offering For DomP' and system_use=1; +update `cloud`.`service_offering` set ram_size=1024 where id=(SELECT id from disk_offering where name='System Offering For Console Proxy' and system_use=1); +update `cloud`.`disk_offering` set name='System Offering For Software Router' where name='Fake Offering For DomR' and system_use=1; +update `cloud`.`disk_offering` set name='System Offering For Secondary Storage VM' where name='Fake Offering For Secondary Storage VM' and system_use=1; + +ALTER TABLE `cloud`.`user_statistics` ADD COLUMN `public_ip_address` varchar(15) DEFAULT NULL; +ALTER TABLE `cloud`.`user_statistics` ADD COLUMN `device_id` bigint unsigned NOT NULL default 0; +ALTER TABLE `cloud`.`user_statistics` ADD COLUMN `device_type` varchar(32) NOT NULL default 'DomainRouter'; + +CREATE TABLE `cloud`.`remote_access_vpn` ( + `vpn_server_addr_id` bigint unsigned UNIQUE NOT NULL, + `account_id` bigint unsigned NOT NULL, + `network_id` bigint unsigned NOT NULL, + `domain_id` bigint unsigned NOT NULL, + `local_ip` varchar(15) NOT NULL, + `ip_range` varchar(32) NOT NULL, + `ipsec_psk` varchar(256) NOT NULL, + `state` char(32) NOT NULL, + PRIMARY KEY (`vpn_server_addr_id`), + CONSTRAINT `fk_remote_access_vpn__account_id` FOREIGN KEY `fk_remote_access_vpn__account_id`(`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_remote_access_vpn__domain_id` FOREIGN KEY `fk_remote_access_vpn__domain_id`(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_remote_access_vpn__network_id` FOREIGN KEY `fk_remote_access_vpn__network_id` (`network_id`) REFERENCES `networks` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_remote_access_vpn__vpn_server_addr_id` FOREIGN KEY `fk_remote_access_vpn__vpn_server_addr_id` (`vpn_server_addr_id`) REFERENCES `user_ip_address` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`vpn_users` ( + `id` bigint unsigned NOT NULL UNIQUE auto_increment, + `owner_id` bigint unsigned NOT NULL, + `domain_id` bigint unsigned NOT NULL, + `username` varchar(255) NOT NULL, + `password` varchar(255) NOT NULL, + `state` char(32) NOT NULL COMMENT 'What state is this vpn user in', + PRIMARY KEY (`id`), + CONSTRAINT `fk_vpn_users__owner_id` FOREIGN KEY (`owner_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_vpn_users__domain_id` FOREIGN KEY (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, + INDEX `i_vpn_users_username`(`username`), + UNIQUE `i_vpn_users__account_id__username`(`owner_id`, `username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`storage_pool` ADD COLUMN `status` varchar(32); + +--drop network group related constraints/indexes; +ALTER TABLE `cloud`.`network_group` DROP foreign key `fk_network_group__domain_id`; +ALTER TABLE `cloud`.`network_group` DROP INDEX `fk_network_group__domain_id`; +ALTER TABLE `cloud`.`network_group` DROP foreign key `fk_network_group___account_id`; + +ALTER TABLE `cloud`.`network_group` drop index `i_network_group_name`; + +ALTER TABLE `cloud`.`network_ingress_rule` drop foreign key `fk_network_ingress_rule___network_group_id`; +ALTER TABLE `cloud`.`network_ingress_rule` drop foreign key `fk_network_ingress_rule___allowed_network_id`; +ALTER TABLE `cloud`.`network_ingress_rule` drop index `i_network_ingress_rule_network_id`; +ALTER TABLE `cloud`.`network_ingress_rule` drop index `i_network_ingress_rule_allowed_network`; + +ALTER TABLE `cloud`.`network_group_vm_map` drop foreign key `fk_network_group_vm_map___network_group_id`; +ALTER TABLE `cloud`.`network_group_vm_map` drop foreign key `fk_network_group_vm_map___instance_id`; + +ALTER TABLE `cloud`.`network_group` RENAME TO `security_group`; +ALTER TABLE `cloud`.`network_ingress_rule` RENAME TO `security_ingress_rule`; +ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `network_group_id` `security_group_id` bigint unsigned NOT NULL; +ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `allowed_network_group` `allowed_security_group` varchar(255); +ALTER TABLE `cloud`.`security_ingress_rule` CHANGE COLUMN `allowed_net_grp_acct` `allowed_sec_grp_acct` varchar(100); +ALTER TABLE `cloud`.`network_group_vm_map` RENAME TO `security_group_vm_map`; +ALTER TABLE `cloud`.`security_group_vm_map` CHANGE COLUMN `network_group_id` `security_group_id` bigint unsigned NOT NULL; + +ALTER TABLE `cloud`.`security_group` ADD CONSTRAINT `fk_security_group__domain_id` FOREIGN KEY `fk_security_group__domain_id` (`domain_id`) REFERENCES `domain` (`id`); +ALTER TABLE `cloud`.`security_group` ADD INDEX `i_security_group_name`(`name`); + +ALTER TABLE `cloud`.`security_ingress_rule` ADD CONSTRAINT `fk_security_ingress_rule___security_group_id` FOREIGN KEY `fk_security_ingress_rule__security_group_id` (`security_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`security_ingress_rule` ADD CONSTRAINT `fk_security_ingress_rule___allowed_network_id` FOREIGN KEY `fk_security_ingress_rule__allowed_network_id` (`allowed_network_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`security_ingress_rule` ADD INDEX `i_security_ingress_rule_network_id`(`security_group_id`); +ALTER TABLE `cloud`.`security_ingress_rule` ADD INDEX `i_security_ingress_rule_allowed_network`(`allowed_network_id`); + +ALTER TABLE `cloud`.`security_group_vm_map` DROP KEY `fk_network_group_vm_map___network_group_id`; +ALTER TABLE `cloud`.`security_group_vm_map` DROP KEY `fk_network_group_vm_map___instance_id`; +ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___security_group_id` FOREIGN KEY `fk_security_group_vm_map___security_group_id` (`security_group_id`) REFERENCES `security_group` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`security_group_vm_map` ADD CONSTRAINT `fk_security_group_vm_map___instance_id` FOREIGN KEY `fk_security_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE; +--n/w to sec grps ends --; + +CREATE TABLE `cloud`.`instance_group` ( + `id` bigint unsigned NOT NULL UNIQUE auto_increment, + `account_id` bigint unsigned NOT NULL COMMENT 'owner. foreign key to account table', + `name` varchar(255) NOT NULL, + `removed` datetime COMMENT 'date the group was removed', + `created` datetime COMMENT 'date the group was created', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`instance_group_vm_map` ( + `id` bigint unsigned NOT NULL auto_increment, + `group_id` bigint unsigned NOT NULL, + `instance_id` bigint unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ssh_keypairs` ( + `id` bigint unsigned NOT NULL auto_increment COMMENT 'id', + `account_id` bigint unsigned NOT NULL COMMENT 'owner, foreign key to account table', + `domain_id` bigint unsigned NOT NULL COMMENT 'domain, foreign key to domain table', + `keypair_name` varchar(256) NOT NULL COMMENT 'name of the key pair', + `fingerprint` varchar(128) NOT NULL COMMENT 'fingerprint for the ssh public key', + `public_key` varchar(5120) NOT NULL COMMENT 'public key of the ssh key pair', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`usage_event` ( + `id` bigint unsigned NOT NULL auto_increment, + `type` varchar(32) NOT NULL, + `account_id` bigint unsigned NOT NULL, + `created` datetime NOT NULL, + `zone_id` bigint unsigned NOT NULL, + `resource_id` bigint unsigned, + `resource_name` varchar(255), + `offering_id` bigint unsigned, + `template_id` bigint unsigned, + `size` bigint unsigned, + `processed` tinyint NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ovs_host_vlan_alloc`( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, + `host_id` bigint unsigned COMMENT 'host id', + `account_id` bigint unsigned COMMENT 'account id', + `vlan` bigint unsigned COMMENT 'vlan id under account #account_id on host #host_id', + `ref` int unsigned NOT NULL DEFAULT 0 COMMENT 'reference count', + PRIMARY KEY(`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ovs_tunnel_alloc`( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, + `from` bigint unsigned COMMENT 'from host id', + `to` bigint unsigned COMMENT 'to host id', + `in_port` int unsigned COMMENT 'in port on open vswitch', + PRIMARY KEY(`from`, `to`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ovs_tunnel`( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, + `from` bigint unsigned COMMENT 'from host id', + `to` bigint unsigned COMMENT 'to host id', + `key` int unsigned default '0' COMMENT 'current gre key can be used', + PRIMARY KEY(`from`, `to`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ovs_tunnel_account`( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, + `from` bigint unsigned COMMENT 'from host id', + `to` bigint unsigned COMMENT 'to host id', + `account` bigint unsigned COMMENT 'account', + `key` int unsigned COMMENT 'gre key', + `port_name` varchar(32) COMMENT 'in port on open vswitch', + `state` varchar(16) default 'FAILED' COMMENT 'result of tunnel creatation', + PRIMARY KEY(`from`, `to`, `account`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `cloud`.`ovs_tunnel_account` (`from`, `to`, `account`, `key`, `port_name`, `state`) VALUES (0, 0, 0, 0, 'lock', 'SUCCESS'); + +CREATE TABLE `cloud`.`ovs_vlan_mapping_dirty`( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, + `account_id` bigint unsigned COMMENT 'account id', + `dirty` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 means vlan mapping of this account was changed', + PRIMARY KEY(`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ovs_vm_flow_log` ( + `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', + `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance that needs flows to be synced.', + `created` datetime NOT NULL COMMENT 'time the entry was requested', + `logsequence` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies flow update', + `vm_name` varchar(255) NOT NULL COMMENT 'vm name', + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ovs_work` ( + `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', + `instance_id` bigint unsigned NOT NULL COMMENT 'vm instance that needs rules to be synced.', + `mgmt_server_id` bigint unsigned COMMENT 'management server that has taken up the work of doing rule sync', + `created` datetime NOT NULL COMMENT 'time the entry was requested', + `taken` datetime COMMENT 'time it was taken by the management server', + `step` varchar(32) NOT NULL COMMENT 'Step in the work', + `seq_no` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies ruleset update', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`storage_pool_work` ( + `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', + `pool_id` bigint unsigned NOT NULL COMMENT 'storage pool associated with the vm', + `vm_id` bigint unsigned NOT NULL COMMENT 'vm identifier', + `stopped_for_maintenance` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'this flag denoted whether the vm was stopped during maintenance', + `started_after_maintenance` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'this flag denoted whether the vm was started after maintenance', + `mgmt_server_id` bigint unsigned NOT NULL COMMENT 'management server id', + PRIMARY KEY (`id`), + UNIQUE (pool_id,vm_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +UPDATE vm_instance set hypervisor_type=(SELECT value FROM configuration WHERE name='hypervisor.type'); + +-- Insert stuff?; +INSERT INTO `cloud`.`sequence` (name, value) VALUES ('volume_seq', (SELECT max(id) + 1 or 200 from volumes)); +INSERT INTO `cloud`.`sequence` (name, value) VALUES ('networks_seq', 200); + +DELETE FROM `cloud`.`sync_queue`; +DELETE FROM `cloud`.`sync_queue_item`; +DELETE FROM `cloud`.`async_job`; +UPDATE `cloud`.`vm_template` SET type='SYSTEM' WHERE name='systemvm-xenserver-2.2.4'; +UPDATE `cloud`.`vm_template` SET type='BUILTIN' WHERE unique_name='centos53-x86_64'; +UPDATE `cloud`.`vm_template` SET type='PERHOST' WHERE unique_name='xs-tools.iso'; +DELETE FROM template_host_ref WHERE install_path LIKE '%xs-tools%'; +DELETE FROM configuration where name='upgrade.url'; +DELETE FROM configuration where name='router.template.id'; +INSERT INTO configuration (category, instance, component, name, value, description) + VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.client.iprange', '10.1.2.1-10.1.2.8', 'The range of ips to be allocated to remote access vpn clients. The first ip in the range is used by the VPN server'); +INSERT INTO configuration (category, instance, component, name, value, description) + VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.psk.length', '48', 'The length of the ipsec preshared key (minimum 8, maximum 256)'); +INSERT INTO configuration (category, instance, component, name, value, description) + VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.user.limit', '8', 'The maximum number of VPN users that can be created per account'); +INSERT INTO configuration (category, instance, component, name, value, description) + VALUES ('Advanced', 'DEFAULT', 'management-server', 'management-server', NULL, 'The cidr of management server network'); +Update configuration set name='storage.max.volume.size' where name='max.volume.size.mb'; +INSERT INTO sequence (name, value) + VALUES ('snapshots_seq', '1'); +UPDATE cloud.sequence SET value=IF((SELECT COUNT(*) FROM cloud.snapshots) > 0, (SELECT max(id) FROM cloud.snapshots) + 1, 1) WHERE name='snapshots_seq'; +UPDATE configuration set name='direct.attach.security.groups.enabled' where name='direct.attach.network.groups.enabled'; +UPDATE configuration set name='guest.domain.suffix' where name='domain.suffix'; +UPDATE vm_template set type='SYSTEM' where id=1; +UPDATE vm_template set type='SYSTEM' WHERE unique_name LIKE 'routing%'; +UPDATE `cloud`.`vm_template` SET type='USER' WHERE type!='BUILTIN' AND type!='PERHOST' AND type!='SYSTEM'; + +INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (8, 'Novel'); +INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (9, 'Unix'); +INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (10, 'Ubuntu'); + +update `cloud`.`guest_os` set display_name = 'Debian GNU/Linux 5.0 (32-bit)' where id=15; +update `cloud`.`guest_os` set display_name = 'Windows Server 2003 (32-bit)' where id=50; +update `cloud`.`guest_os` set display_name = 'Windows Server 2003 (64-bit)' where id=51; +update `cloud`.`guest_os` set display_name = 'Windows Server 2008 (32-bit)' where id=52; +update `cloud`.`guest_os` set display_name = 'Windows Server 2008 (64-bit)' where id=53; +update `cloud`.`guest_os` set display_name = 'Other Ubuntu (32-bit)' where id=59; +update `cloud`.`guest_os` set display_name = 'Other (32-bit)' where id=60; +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (61, 6, 'Windows 2000 Server'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (62, 6, 'Windows 98'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (63, 6, 'Windows 95'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (64, 6, 'Windows NT 4'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (65, 6, 'Windows 3.1'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (66, 4, 'Red Hat Enterprise Linux 3(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (67, 4, 'Red Hat Enterprise Linux 3(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (68, 7, 'Open Enterprise Server'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (69, 7, 'Asianux 3(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (70, 7, 'Asianux 3(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (72, 2, 'Debian GNU/Linux 5(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (73, 2, 'Debian GNU/Linux 4(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (74, 2, 'Debian GNU/Linux 4(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (75, 7, 'Other 2.6x Linux (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (76, 7, 'Other 2.6x Linux (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (77, 8, 'Novell Netware 6.x'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (78, 8, 'Novell Netware 5.1'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (79, 9, 'Sun Solaris 10(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (80, 9, 'Sun Solaris 10(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (81, 9, 'Sun Solaris 9(Experimental)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (82, 9, 'Sun Solaris 8(Experimental)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (83, 9, 'FreeBSD (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (84, 9, 'FreeBSD (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (85, 9, 'SCO OpenServer 5'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (86, 9, 'SCO UnixWare 7'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (87, 6, 'Windows Server 2003 DataCenter Edition(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (88, 6, 'Windows Server 2003 DataCenter Edition(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (89, 6, 'Windows Server 2003 Standard Edition(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (90, 6, 'Windows Server 2003 Standard Edition(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (91, 6, 'Windows Server 2003 Web Edition'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (92, 6, 'Microsoft Small Bussiness Server 2003'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (93, 6, 'Windows XP (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (94, 6, 'Windows XP (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (95, 6, 'Windows 2000 Advanced Server'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (96, 5, 'SUSE Linux Enterprise 8(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (97, 5, 'SUSE Linux Enterprise 8(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (98, 7, 'Other Linux (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (99, 7, 'Other Linux (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (100, 10, 'Other Ubuntu (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (101, 6, 'Windows Vista (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (102, 6, 'DOS'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (103, 7, 'Other (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (104, 7, 'OS/2'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (105, 6, 'Windows 2000 Professional'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (106, 4, 'Red Hat Enterprise Linux 4(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (107, 5, 'SUSE Linux Enterprise 9(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (108, 5, 'SUSE Linux Enterprise 9(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (109, 5, 'SUSE Linux Enterprise 10(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (110, 5, 'SUSE Linux Enterprise 10(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (111, 1, 'CentOS 5.5 (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (112, 1, 'CentOS 5.5 (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (113, 4, 'Red Hat Enterprise Linux 5.5 (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (114, 4, 'Red Hat Enterprise Linux 5.5 (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (115, 4, 'Fedora 13'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (116, 4, 'Fedora 12'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (117, 4, 'Fedora 11'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (118, 4, 'Fedora 10'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (119, 4, 'Fedora 9'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (120, 4, 'Fedora 8'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (121, 10, 'Ubuntu 10.04 (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (122, 10, 'Ubuntu 9.10 (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (123, 10, 'Ubuntu 9.04 (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (124, 10, 'Ubuntu 8.10 (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (125, 10, 'Ubuntu 8.04 (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (126, 10, 'Ubuntu 10.04 (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (127, 10, 'Ubuntu 9.10 (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (128, 10, 'Ubuntu 9.04 (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (129, 10, 'Ubuntu 8.10 (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (130, 10, 'Ubuntu 8.04 (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (131, 4, 'Red Hat Enterprise Linux 2'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (132, 2, 'Debian GNU/Linux 6(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (133, 2, 'Debian GNU/Linux 6(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (134, 3, 'Oracle Enterprise Linux 5.5 (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (135, 3, 'Oracle Enterprise Linux 5.5 (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (136, 4, 'Red Hat Enterprise Linux 6.0 (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (137, 4, 'Red Hat Enterprise Linux 6.0 (64-bit)'); + +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.5 (32-bit)', 1); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.6 (32-bit)', 2); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.7 (32-bit)', 3); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.8 (32-bit)', 4); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.0 (32-bit)', 5); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.0 (64-bit)', 6); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.1 (32-bit)', 7); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.1 (32-bit)', 8); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.2 (32-bit)', 9); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.2 (64-bit)', 10); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.3 (32-bit)', 11); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.3 (64-bit)', 12); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.4 (32-bit)', 13); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.4 (64-bit)', 14); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Debian Lenny 5.0 (32-bit)', 15); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.0 (32-bit)', 16); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.0 (64-bit)', 17); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.1 (32-bit)', 18); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.1 (64-bit)', 19); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.2 (32-bit)', 20); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.2 (64-bit)', 21); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.3 (32-bit)', 22); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.3 (64-bit)', 23); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.4 (32-bit)', 24); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.4 (64-bit)', 25); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.5 (32-bit)', 26); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.6 (32-bit)', 27); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.7 (32-bit)', 28); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.8 (32-bit)', 29); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.0 (32-bit)', 30); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.0 (64-bit)', 31); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.1 (32-bit)', 32); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.1 (64-bit)', 33); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.2 (32-bit)', 34); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.2 (64-bit)', 35); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.3 (32-bit)', 36); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.3 (64-bit)', 37); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.4 (32-bit)', 38); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.4 (64-bit)', 39); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 9 SP4 (32-bit)', 40); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP1 (32-bit)', 41); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP1 (64-bit)', 42); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP2 (32-bit)', 43); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP2 (64-bit)', 44); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP3 (64-bit)', 45); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 11 (32-bit)', 46); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 11 (64-bit)', 47); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows 7 (32-bit)', 48); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows 7 (64-bit)', 49); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2003 (32-bit)', 50); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2003 (64-bit)', 51); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2008 (32-bit)', 52); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2008 (64-bit)', 53); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2008 R2 (64-bit)', 54); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows 2000 SP4 (32-bit)', 55); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Vista (32-bit)', 56); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows XP SP2 (32-bit)', 57); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows XP SP3 (32-bit)', 58); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 59); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 100); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 60); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 103); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 121); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 126); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 122); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 127); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 123); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 128); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 124); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 129); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 125); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 130); + + +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 7(32-bit)', 48); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 7(64-bit)', 49); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2008 R2(64-bit)', 54); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2008(32-bit)', 52); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2008(64-bit)', 53); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Enterprise Edition (32-bit)', 50); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Enterprise Edition (64-bit)', 51); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Datacenter Edition (32-bit)', 87); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Datacenter Edition (64-bit)', 88); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Standard Edition (32-bit)', 89); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Standard Edition (64-bit)', 90); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Web Edition', 91); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Small Bussiness Server 2003', 92); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Vista (32-bit)', 56); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Vista (64-bit)', 101); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 93); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 57); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 58); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (64-bit)', 94); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Advanced Server', 95); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Server', 61); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Professional', 105); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Server', 55); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 98', 62); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 95', 63); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows NT 4', 64); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 3.1', 65); + +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 30); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 32); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 34); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 36); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 38); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 31); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 33); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 35); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 37); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 39); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 26); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 27); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 28); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 29); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(64-bit)', 106); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 3(32-bit)', 66); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 3(64-bit)', 67); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 2', 131); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 11(32-bit)', 46); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 11(64-bit)', 47); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(32-bit)', 41); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(32-bit)', 43); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 42); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 44); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 45); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(32-bit)', 109); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 110); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(32-bit)', 40); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(32-bit)', 96); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(64-bit)', 97); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(32-bit)', 107); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(64-bit)', 108); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Open Enterprise Server', 68); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Asianux 3(32-bit)', 69); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Asianux 3(64-bit)', 70); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 5(32-bit)', 15); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 5(64-bit)', 72); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 4(32-bit)', 73); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 4(64-bit)', 74); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 59); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 121); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 122); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 123); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 124); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 125); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 100); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 126); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 127); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 128); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 129); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 130); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other 2.6x Linux (32-bit)', 75); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other 2.6x Linux (64-bit)', 76); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other Linux (32-bit)', 98); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other Linux (64-bit)', 99); + +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Novell Netware 6.x', 77); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Novell Netware 5.1', 78); + +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 10(32-bit)', 79); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 10(64-bit)', 80); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 9(Experimental)', 81); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 8(Experimental)', 82); + +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'FreeBSD (32-bit)', 83); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'FreeBSD (64-bit)', 84); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'OS/2', 104); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'SCO OpenServer 5', 85); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'SCO UnixWare 7', 86); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'DOS', 102); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other (32-bit)', 60); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other (64-bit)', 103); + + + +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.5', 1); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.6', 2); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.7', 3); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.8', 4); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.0', 5); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.0', 6); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.1', 7); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.1', 8); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.2', 9); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.2', 10); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.3', 11); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.3', 12); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.4', 13); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.4', 14); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.5', 111); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.5', 112); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.5', 26); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.6', 27); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.7', 28); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.8', 29); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.0', 30); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.0', 31); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.1', 32); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.1', 33); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.2', 34); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.2', 35); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.3', 36); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.3', 37); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.4', 38); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.4', 39); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.5', 113); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.5', 114); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4', 106); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 3', 66); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 3', 67); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 2', 131); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 13', 115); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 12', 116); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 11', 117); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 10', 118); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 9', 119); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 8', 120); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 10.04', 121); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 10.04', 126); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.10', 122); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.10', 127); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.04', 123); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.04', 128); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.10', 124); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.10', 129); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.04', 125); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.04', 130); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 5', 15); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 5', 72); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 4', 73); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 4', 74); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux 2.6x', 75); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux 2.6x', 76); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Ubuntu', 59); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Ubuntu', 100); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux', 98); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux', 99); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 7', 48); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 7', 49); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 50); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 51); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 87); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 88); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 89); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 90); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 91); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 92); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2008', 52); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2008', 53); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 2000', 55); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 2000', 61); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 2000', 95); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 98', 62); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Vista', 56); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Vista', 101); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP SP2', 57); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP SP3', 58); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP ', 93); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP ', 94); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'DOS', 102); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other', 60); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other', 103); +UPDATE `cloud`.`guest_os` SET name = display_name; + +INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) + VALUES (3, 'routing-3', 'SystemVM Template (KVM)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://download.cloud.com/releases/2.2.0/systemvm.qcow2.bz2', 'ec463e677054f280f152fcc264255d2f', 0, 'SystemVM Template (KVM)', 'QCOW2', 15, 0, 1, 'KVM'); +INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) + VALUES (8, 'routing-8', 'SystemVM Template (vSphere)', 0, now(), 'SYSTEM', 0, 32, 1, 'http://download.cloud.com/releases/2.2.0/systemvm.ova', '3c9d4c704af44ebd1736e1bc78cec1fa', 0, 'SystemVM Template (vSphere)', 'OVA', 15, 0, 1, 'VMware'); + +INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, display_text, enable_password, format, guest_os_id, featured, cross_zones, hypervisor_type, extractable) + VALUES (4, 'centos55-x86_64', 'CentOS 5.5(64-bit) no GUI (KVM)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://download.cloud.com/releases/2.2.0/eec2209b-9875-3c8d-92be-c001bd8a0faf.qcow2.bz2', 'ed0e788280ff2912ea40f7f91ca7a249', 'CentOS 5.5(64-bit) no GUI (KVM)', 0, 'QCOW2', 112, 1, 1, 'KVM', 1); + +INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type, extractable) + VALUES (7, 'centos53-x64', 'CentOS 5.3(64-bit) no GUI (vSphere)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://download.cloud.com/releases/2.2.0/CentOS5.3-x86_64.ova', 'f6f881b7f2292948d8494db837fe0f47', 0, 'CentOS 5.3(64-bit) no GUI (vSphere)', 'OVA', 12, 1, 1, 'VMware', 1); +UPDATE vm_instance SET guest_os_id=15 where vm_template_id=1; +UPDATE vm_instance SET vm_template_id=(SELECT id FROM vm_template WHERE name='systemvm-xenserver-2.2.4' AND removed IS NULL) where vm_template_id=1; + + +ALTER TABLE `cloud`.`instance_group` ADD CONSTRAINT `fk_instance_group__account_id` FOREIGN KEY `fk_instance_group__account_id` (`account_id`) REFERENCES `account` (`id`); + +ALTER TABLE `cloud`.`instance_group_vm_map` ADD CONSTRAINT `fk_instance_group_vm_map___group_id` FOREIGN KEY `fk_instance_group_vm_map___group_id` (`group_id`) REFERENCES `instance_group` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`instance_group_vm_map` ADD CONSTRAINT `fk_instance_group_vm_map___instance_id` FOREIGN KEY `fk_instance_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `guid` varchar(255); + +ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `fk_ssh_keypairs__account_id` FOREIGN KEY `fk_ssh_keypair__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `fk_ssh_keypairs__domain_id` FOREIGN KEY `fk_ssh_keypair__domain_id` (`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE; +UPDATE vm_template SET hypervisor_type='XenServer' WHERE hypervisor_type IS NULL AND format='VHD'; +UPDATE vm_template SET hypervisor_type='KVM' WHERE hypervisor_type IS NULL AND format='QCOW2'; +UPDATE vm_template SET hypervisor_type='VmWare' WHERE hypervisor_type IS NULL AND format='OVA'; +UPDATE vm_template SET hypervisor_type='None' WHERE hypervisor_type IS NULL AND format='ISO'; + +ALTER TABLE `cloud`.`volumes` ADD COLUMN `source_id` bigint unsigned COMMENT 'id for the source'; +ALTER TABLE `cloud`.`volumes` ADD COLUMN `source_type` varchar(32) COMMENT 'source from which the volume is created -- snapshot, diskoffering, template, blank'; + +ALTER TABLE `cloud`.`user_statistics` ADD UNIQUE KEY `account_id` (`account_id`,`data_center_id`); +#UPDATE vm_instance SET instance_name=concat("r-", concat(cast(id as CHAR), concat("-", (SELECT value FROM configuration WHERE name='instance.name')))) WHERE type='DomainRouter'; +#UPDATE vm_instance SET instance_name=concat("s-", concat(cast(id as CHAR), concat("-", (SELECT value FROM configuration WHERE name='instance.name')))) WHERE type='SecondaryStorageVm'; +#UPDATE vm_instance SET instance_name=concat("v-", concat(cast(id as CHAR), concat("-", (SELECT value FROM configuration WHERE name='instance.name')))) WHERE type='ConsoleProxy'; +#UPDATE vm_instance SET instance_name=concat("i-", concat(cast(account_id as CHAR), concat("-", concat(cast(id as CHAR), concat("-", (SELECT value FROM configuration WHERE name='instance.name')))))) WHERE type='User'; + +ALTER TABLE `cloud`.`data_center` MODIFY COLUMN `guest_network_cidr` varchar(18); + +ALTER TABLE `cloud`.`op_ha_work` ADD CONSTRAINT `fk_op_ha_work__instance_id` FOREIGN KEY `fk_op_ha_work__instance_id` (`instance_id`) REFERENCES `vm_instance` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`op_ha_work` ADD CONSTRAINT `fk_op_ha_work__mgmt_server_id` FOREIGN KEY `fk_op_ha_work__mgmt_server_id`(`mgmt_server_id`) REFERENCES `mshost`(`msid`); + +ALTER TABLE `cloud`.`secondary_storage_vm` ADD CONSTRAINT `fk_secondary_storage_vm__id` FOREIGN KEY `fk_secondary_storage_vm__id`(`id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`snapshots` MODIFY COLUMN `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'Primary Key'; + +ALTER TABLE `cloud`.`storage_pool` DROP KEY `uuid`; + +ALTER TABLE `cloud`.`template_host_ref` DROP FOREIGN KEY `fk_template_host_ref__template_id`; +ALTER TABLE `cloud`.`template_host_ref` ADD CONSTRAINT `fk_template_host_ref__template_id` FOREIGN KEY `fk_template_host_ref__template_id` (`template_id`) REFERENCES `vm_template` (`id`); + +ALTER TABLE `cloud`.`user_ip_address` ADD CONSTRAINT `fk_user_ip_address__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE; + +INSERT INTO configuration (category, instance, component, name, value, description) + VALUES ('Advanced', 'DEFAULT', 'management-server', 'hypervisor.list', 'KVM,XenServer,VMware', 'The list of hypervisors that this deployment will use.'); + +DELETE FROM load_balancer_vm_map WHERE load_balancer_id NOT IN (SELECT id FROM load_balancer); +DELETE FROM vm_instance WHERE type='User' AND id NOT IN (SELECT id FROM user_vm); + diff --git a/setup/db/db/schema-2210to2211.sql b/setup/db/db/schema-2210to2211.sql index 37f96cecb27..45ebdf7778d 100644 --- a/setup/db/db/schema-2210to2211.sql +++ b/setup/db/db/schema-2210to2211.sql @@ -1,12 +1,17 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + diff --git a/setup/db/db/schema-2211to2212-premium.sql b/setup/db/db/schema-2211to2212-premium.sql index 6978e4eed66..0cb187e2b9d 100644 --- a/setup/db/db/schema-2211to2212-premium.sql +++ b/setup/db/db/schema-2211to2212-premium.sql @@ -1,57 +1,62 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Premium schema upgrade from 2.2.11 to 2.2.12; ---; - -ALTER TABLE `cloud_usage`.`cloud_usage` ADD INDEX `i_cloud_usage__account_id`(`account_id`); -ALTER TABLE `cloud_usage`.`cloud_usage` ADD INDEX `i_cloud_usage__domain_id`(`domain_id`); -ALTER TABLE `cloud_usage`.`cloud_usage` ADD INDEX `i_cloud_usage__start_date`(`start_date`); -ALTER TABLE `cloud_usage`.`cloud_usage` ADD INDEX `i_cloud_usage__end_date`(`end_date`); - -ALTER TABLE `cloud_usage`.`usage_vm_instance` ADD INDEX `i_usage_vm_instance__account_id`(`account_id`); -ALTER TABLE `cloud_usage`.`usage_vm_instance` ADD INDEX `i_usage_vm_instance__start_date`(`start_date`); -ALTER TABLE `cloud_usage`.`usage_vm_instance` ADD INDEX `i_usage_vm_instance__end_date`(`end_date`); - -ALTER TABLE `cloud_usage`.`usage_ip_address` ADD INDEX `i_usage_ip_address__account_id`(`account_id`); -ALTER TABLE `cloud_usage`.`usage_ip_address` ADD INDEX `i_usage_ip_address__assigned`(`assigned`); -ALTER TABLE `cloud_usage`.`usage_ip_address` ADD INDEX `i_usage_ip_address__released`(`released`); - -ALTER TABLE `cloud_usage`.`usage_job` ADD INDEX `i_usage_job__end_millis`(`end_millis`); - -ALTER TABLE `cloud_usage`.`account` ADD INDEX `i_account__removed`(`removed`); - -ALTER TABLE `cloud_usage`.`usage_volume` ADD INDEX `i_usage_volume__account_id`(`account_id`); -ALTER TABLE `cloud_usage`.`usage_volume` ADD INDEX `i_usage_volume__created`(`created`); -ALTER TABLE `cloud_usage`.`usage_volume` ADD INDEX `i_usage_volume__deleted`(`deleted`); - -ALTER TABLE `cloud_usage`.`usage_storage` ADD INDEX `i_usage_storage__account_id`(`account_id`); -ALTER TABLE `cloud_usage`.`usage_storage` ADD INDEX `i_usage_storage__created`(`created`); -ALTER TABLE `cloud_usage`.`usage_storage` ADD INDEX `i_usage_storage__deleted`(`deleted`); - -ALTER TABLE `cloud_usage`.`usage_load_balancer_policy` ADD INDEX `i_usage_load_balancer_policy__account_id`(`account_id`); -ALTER TABLE `cloud_usage`.`usage_load_balancer_policy` ADD INDEX `i_usage_load_balancer_policy__created`(`created`); -ALTER TABLE `cloud_usage`.`usage_load_balancer_policy` ADD INDEX `i_usage_load_balancer_policy__deleted`(`deleted`); - -ALTER TABLE `cloud_usage`.`usage_port_forwarding` ADD INDEX `i_usage_port_forwarding__account_id`(`account_id`); -ALTER TABLE `cloud_usage`.`usage_port_forwarding` ADD INDEX `i_usage_port_forwarding__created`(`created`); -ALTER TABLE `cloud_usage`.`usage_port_forwarding` ADD INDEX `i_usage_port_forwarding__deleted`(`deleted`); - -ALTER TABLE `cloud_usage`.`usage_network_offering` ADD INDEX `i_usage_network_offering__account_id`(`account_id`); -ALTER TABLE `cloud_usage`.`usage_network_offering` ADD INDEX `i_usage_network_offering__created`(`created`); -ALTER TABLE `cloud_usage`.`usage_network_offering` ADD INDEX `i_usage_network_offering__deleted`(`deleted`); - -ALTER IGNORE TABLE `cloud_usage`.`usage_vm_instance` ADD UNIQUE (`vm_instance_id`, `usage_type`, `start_date`); -ALTER IGNORE TABLE `cloud_usage`.`usage_ip_address` ADD UNIQUE (`id`, `assigned`); -ALTER IGNORE TABLE `cloud_usage`.`usage_volume` ADD UNIQUE (`id`, `created`); -ALTER IGNORE TABLE `cloud_usage`.`usage_storage` ADD UNIQUE (`id`, `storage_type`, `zone_id`, `created`); \ No newline at end of file +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Premium schema upgrade from 2.2.11 to 2.2.12; +--; + +ALTER TABLE `cloud_usage`.`cloud_usage` ADD INDEX `i_cloud_usage__account_id`(`account_id`); +ALTER TABLE `cloud_usage`.`cloud_usage` ADD INDEX `i_cloud_usage__domain_id`(`domain_id`); +ALTER TABLE `cloud_usage`.`cloud_usage` ADD INDEX `i_cloud_usage__start_date`(`start_date`); +ALTER TABLE `cloud_usage`.`cloud_usage` ADD INDEX `i_cloud_usage__end_date`(`end_date`); + +ALTER TABLE `cloud_usage`.`usage_vm_instance` ADD INDEX `i_usage_vm_instance__account_id`(`account_id`); +ALTER TABLE `cloud_usage`.`usage_vm_instance` ADD INDEX `i_usage_vm_instance__start_date`(`start_date`); +ALTER TABLE `cloud_usage`.`usage_vm_instance` ADD INDEX `i_usage_vm_instance__end_date`(`end_date`); + +ALTER TABLE `cloud_usage`.`usage_ip_address` ADD INDEX `i_usage_ip_address__account_id`(`account_id`); +ALTER TABLE `cloud_usage`.`usage_ip_address` ADD INDEX `i_usage_ip_address__assigned`(`assigned`); +ALTER TABLE `cloud_usage`.`usage_ip_address` ADD INDEX `i_usage_ip_address__released`(`released`); + +ALTER TABLE `cloud_usage`.`usage_job` ADD INDEX `i_usage_job__end_millis`(`end_millis`); + +ALTER TABLE `cloud_usage`.`account` ADD INDEX `i_account__removed`(`removed`); + +ALTER TABLE `cloud_usage`.`usage_volume` ADD INDEX `i_usage_volume__account_id`(`account_id`); +ALTER TABLE `cloud_usage`.`usage_volume` ADD INDEX `i_usage_volume__created`(`created`); +ALTER TABLE `cloud_usage`.`usage_volume` ADD INDEX `i_usage_volume__deleted`(`deleted`); + +ALTER TABLE `cloud_usage`.`usage_storage` ADD INDEX `i_usage_storage__account_id`(`account_id`); +ALTER TABLE `cloud_usage`.`usage_storage` ADD INDEX `i_usage_storage__created`(`created`); +ALTER TABLE `cloud_usage`.`usage_storage` ADD INDEX `i_usage_storage__deleted`(`deleted`); + +ALTER TABLE `cloud_usage`.`usage_load_balancer_policy` ADD INDEX `i_usage_load_balancer_policy__account_id`(`account_id`); +ALTER TABLE `cloud_usage`.`usage_load_balancer_policy` ADD INDEX `i_usage_load_balancer_policy__created`(`created`); +ALTER TABLE `cloud_usage`.`usage_load_balancer_policy` ADD INDEX `i_usage_load_balancer_policy__deleted`(`deleted`); + +ALTER TABLE `cloud_usage`.`usage_port_forwarding` ADD INDEX `i_usage_port_forwarding__account_id`(`account_id`); +ALTER TABLE `cloud_usage`.`usage_port_forwarding` ADD INDEX `i_usage_port_forwarding__created`(`created`); +ALTER TABLE `cloud_usage`.`usage_port_forwarding` ADD INDEX `i_usage_port_forwarding__deleted`(`deleted`); + +ALTER TABLE `cloud_usage`.`usage_network_offering` ADD INDEX `i_usage_network_offering__account_id`(`account_id`); +ALTER TABLE `cloud_usage`.`usage_network_offering` ADD INDEX `i_usage_network_offering__created`(`created`); +ALTER TABLE `cloud_usage`.`usage_network_offering` ADD INDEX `i_usage_network_offering__deleted`(`deleted`); + +ALTER IGNORE TABLE `cloud_usage`.`usage_vm_instance` ADD UNIQUE (`vm_instance_id`, `usage_type`, `start_date`); +ALTER IGNORE TABLE `cloud_usage`.`usage_ip_address` ADD UNIQUE (`id`, `assigned`); +ALTER IGNORE TABLE `cloud_usage`.`usage_volume` ADD UNIQUE (`id`, `created`); +ALTER IGNORE TABLE `cloud_usage`.`usage_storage` ADD UNIQUE (`id`, `storage_type`, `zone_id`, `created`); diff --git a/setup/db/db/schema-2211to2212.sql b/setup/db/db/schema-2211to2212.sql index f70d5b02b41..4b0c4957b4c 100644 --- a/setup/db/db/schema-2211to2212.sql +++ b/setup/db/db/schema-2211to2212.sql @@ -1,58 +1,63 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.2.11 to 2.2.12; ---; - -ALTER TABLE `cloud`.`vm_template` ADD COLUMN `template_tag` varchar(255) COMMENT 'template tag'; - -UPDATE vm_instance SET state='Error' WHERE state='Creating' AND removed IS null; - -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'json.content.type', 'text/javascript', 'Http response content type for .js files (default is text/javascript)'); -INSERT IGNORE INTO configuration VALUES ('Premium', 'DEFAULT', 'management-server', 'usage.aggregation.timezone', 'GMT', 'The timezone to use for usage stats aggregation'); - -ALTER IGNORE TABLE `cloud`.`user_vm_details` DROP FOREIGN KEY `fk_user_vm_details__vm_id`; -ALTER TABLE `cloud`.`user_vm_details` ADD CONSTRAINT `fk_user_vm_details__vm_id` FOREIGN KEY `fk_user_vm_details__vm_id`(`vm_id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE; - - -ALTER TABLE `cloud`.`domain_router` ADD COLUMN `is_priority_bumpup` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'if the priority has been bumped up'; -ALTER TABLE `cloud`.`domain_router` ADD COLUMN `stop_pending` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'if this router would be stopped after we can connect to it'; - -DELETE FROM `cloud`.`configuration` where name='vmware.guest.nic.device.type'; - -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.lb.enabled', 'true', 'If agent load balancing enabled in cluster setup'); - -update `cloud`.`vm_template` set hypervisor_type='XenServer' where unique_name='xs-tools.iso'; - -ALTER TABLE `cloud`.`host` MODIFY COLUMN `storage_ip_address` char(40); - -ALTER TABLE `cloud`.`resource_count` ADD UNIQUE `i_resource_count__type_accountId`(`type`, `account_id`); -ALTER TABLE `cloud`.`resource_count` ADD UNIQUE `i_resource_count__type_domaintId`(`type`, `domain_id`); - -UPDATE configuration set description='Load Balancer(haproxy) stats visibilty, the value can be one of the following six parameters : global,guest-network,link-local,disabled,all,default' WHERE name='network.loadbalancer.haproxy.stats.visibility' ; - -UPDATE nics SET strategy="Managed" WHERE (ip4_address, network_id) IN (SELECT public_ip_address, source_network_id FROM user_ip_address WHERE source_nat=1) AND vm_type="DomainRouter"; - -UPDATE nics SET strategy="Created" WHERE strategy="Managed" AND vm_type!="DomainRouter"; - -CREATE TABLE IF NOT EXISTS `cloud`.`inline_load_balancer_nic_map` ( - `id` bigint unsigned NOT NULL auto_increment, - `load_balancer_id` bigint unsigned NOT NULL, - `public_ip_address` char(40) NOT NULL, - `nic_id` bigint unsigned NULL COMMENT 'nic id', - PRIMARY KEY (`id`), - UNIQUE KEY (`nic_id`), - CONSTRAINT `fk_inline_load_balancer_nic_map__load_balancer_id` FOREIGN KEY(`load_balancer_id`) REFERENCES `load_balancing_rules`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_inline_load_balancer_nic_map__nic_id` FOREIGN KEY(`nic_id`) REFERENCES `nics`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.2.11 to 2.2.12; +--; + +ALTER TABLE `cloud`.`vm_template` ADD COLUMN `template_tag` varchar(255) COMMENT 'template tag'; + +UPDATE vm_instance SET state='Error' WHERE state='Creating' AND removed IS null; + +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'json.content.type', 'text/javascript', 'Http response content type for .js files (default is text/javascript)'); +INSERT IGNORE INTO configuration VALUES ('Premium', 'DEFAULT', 'management-server', 'usage.aggregation.timezone', 'GMT', 'The timezone to use for usage stats aggregation'); + +ALTER IGNORE TABLE `cloud`.`user_vm_details` DROP FOREIGN KEY `fk_user_vm_details__vm_id`; +ALTER TABLE `cloud`.`user_vm_details` ADD CONSTRAINT `fk_user_vm_details__vm_id` FOREIGN KEY `fk_user_vm_details__vm_id`(`vm_id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE; + + +ALTER TABLE `cloud`.`domain_router` ADD COLUMN `is_priority_bumpup` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'if the priority has been bumped up'; +ALTER TABLE `cloud`.`domain_router` ADD COLUMN `stop_pending` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'if this router would be stopped after we can connect to it'; + +DELETE FROM `cloud`.`configuration` where name='vmware.guest.nic.device.type'; + +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.lb.enabled', 'true', 'If agent load balancing enabled in cluster setup'); + +update `cloud`.`vm_template` set hypervisor_type='XenServer' where unique_name='xs-tools.iso'; + +ALTER TABLE `cloud`.`host` MODIFY COLUMN `storage_ip_address` char(40); + +ALTER TABLE `cloud`.`resource_count` ADD UNIQUE `i_resource_count__type_accountId`(`type`, `account_id`); +ALTER TABLE `cloud`.`resource_count` ADD UNIQUE `i_resource_count__type_domaintId`(`type`, `domain_id`); + +UPDATE configuration set description='Load Balancer(haproxy) stats visibilty, the value can be one of the following six parameters : global,guest-network,link-local,disabled,all,default' WHERE name='network.loadbalancer.haproxy.stats.visibility' ; + +UPDATE nics SET strategy="Managed" WHERE (ip4_address, network_id) IN (SELECT public_ip_address, source_network_id FROM user_ip_address WHERE source_nat=1) AND vm_type="DomainRouter"; + +UPDATE nics SET strategy="Created" WHERE strategy="Managed" AND vm_type!="DomainRouter"; + +CREATE TABLE IF NOT EXISTS `cloud`.`inline_load_balancer_nic_map` ( + `id` bigint unsigned NOT NULL auto_increment, + `load_balancer_id` bigint unsigned NOT NULL, + `public_ip_address` char(40) NOT NULL, + `nic_id` bigint unsigned NULL COMMENT 'nic id', + PRIMARY KEY (`id`), + UNIQUE KEY (`nic_id`), + CONSTRAINT `fk_inline_load_balancer_nic_map__load_balancer_id` FOREIGN KEY(`load_balancer_id`) REFERENCES `load_balancing_rules`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_inline_load_balancer_nic_map__nic_id` FOREIGN KEY(`nic_id`) REFERENCES `nics`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/setup/db/db/schema-2212to2213.sql b/setup/db/db/schema-2212to2213.sql index 6905d8432c6..cb32e90e52c 100644 --- a/setup/db/db/schema-2212to2213.sql +++ b/setup/db/db/schema-2212to2213.sql @@ -1,78 +1,83 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.2.12 to 2.2.13; ---; - -UPDATE networks SET guru_name='ExternalGuestNetworkGuru' WHERE guru_name='GuestNetworkGuru'; -UPDATE nics SET reserver_name='ExternalGuestNetworkGuru' WHERE reserver_name='GuestNetworkGuru'; -UPDATE configuration SET value='KVM,XenServer,VMware,BareMetal,Ovm' WHERE name='hypervisor.list'; - - -INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (200, 1, 'Other CentOS (32-bit)'); -INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (201, 1, 'Other CentOS (64-bit)'); -INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (202, 5, 'Other SUSE Linux(32-bit)'); -INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (203, 5, 'Other SUSE Linux(64-bit)'); -INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (141, 9, 'Sun Solaris 11 (64-bit)'); -INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (142, 9, 'Sun Solaris 11 (32-bit)'); - -INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'CentOS (32-bit)', 200); -INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'CentOS (64-bit)', 201); -INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu 10.10 (32-bit)', 59); -INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu 10.10 (64-bit)', 100); -INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 6(32-bit)', 204); -INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 6(64-bit)', 205); -INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other Suse Linux Enterprise(32-bit)', 202); -INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other Suse Linux Enterprise(64-bit)', 203); - -UPDATE guest_os_hypervisor SET guest_os_name='Other Ubuntu Linux (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=59; -UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 10.04 (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=121; -UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 9.10 (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=122; -UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 9.04 (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=123; -UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 8.10 (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=124; -UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 8.04 (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=125; -UPDATE guest_os_hypervisor SET guest_os_name='Other Ubuntu (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=100; -UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 10.04 (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=126; -UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 9.10 (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=127; -UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 9.04 (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=128; -UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 8.10 (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=129; -UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 8.04 (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=130; - -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.0(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=30; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.1(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=32; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.2(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=34; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.3(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=36; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.4(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=38; - -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.0(64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=31; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.1(64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=33; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.2(64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=35; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.3(64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=37; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.4(64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=39; - -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 4.5(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=26; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 4.6(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=27; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 4.7(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=28; -UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 4.8(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=29; - -update host_details set name='cpuspeed' where host_id in (select id from host where hypervisor_type='BareMetal') and name='cpuCapacity'; -update host_details set name='cpunumber' where host_id in (select id from host where hypervisor_type='BareMetal') and name='cpuNum'; -update host_details set name='hostmac' where host_id in (select id from host where hypervisor_type='BareMetal') and name='mac'; -update host_details set name='memory' where host_id in (select id from host where hypervisor_type='BareMetal') and name='memCapacity'; -update host_details set name='privateip' where host_id in (select id from host where hypervisor_type='BareMetal') and name='agentIp'; - -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.root.disk.controller', 'ide', 'Specify the default disk controller for root volumes, valid values are scsi, ide'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vm.destory.forcestop', 'false', 'On destory, force-stop takes this value'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.lock.timeout', '600', 'Lock wait timeout (seconds) while implementing network'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.disable.rpfilter','true','disable rp_filter on Domain Router VM public interfaces.'); - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.2.12 to 2.2.13; +--; + +UPDATE networks SET guru_name='ExternalGuestNetworkGuru' WHERE guru_name='GuestNetworkGuru'; +UPDATE nics SET reserver_name='ExternalGuestNetworkGuru' WHERE reserver_name='GuestNetworkGuru'; +UPDATE configuration SET value='KVM,XenServer,VMware,BareMetal,Ovm' WHERE name='hypervisor.list'; + + +INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (200, 1, 'Other CentOS (32-bit)'); +INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (201, 1, 'Other CentOS (64-bit)'); +INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (202, 5, 'Other SUSE Linux(32-bit)'); +INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (203, 5, 'Other SUSE Linux(64-bit)'); +INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (141, 9, 'Sun Solaris 11 (64-bit)'); +INSERT IGNORE INTO guest_os(id, category_id, display_name) VALUES (142, 9, 'Sun Solaris 11 (32-bit)'); + +INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'CentOS (32-bit)', 200); +INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'CentOS (64-bit)', 201); +INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu 10.10 (32-bit)', 59); +INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu 10.10 (64-bit)', 100); +INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 6(32-bit)', 204); +INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 6(64-bit)', 205); +INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other Suse Linux Enterprise(32-bit)', 202); +INSERT IGNORE INTO guest_os_hypervisor(hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other Suse Linux Enterprise(64-bit)', 203); + +UPDATE guest_os_hypervisor SET guest_os_name='Other Ubuntu Linux (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=59; +UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 10.04 (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=121; +UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 9.10 (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=122; +UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 9.04 (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=123; +UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 8.10 (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=124; +UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 8.04 (32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=125; +UPDATE guest_os_hypervisor SET guest_os_name='Other Ubuntu (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=100; +UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 10.04 (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=126; +UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 9.10 (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=127; +UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 9.04 (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=128; +UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 8.10 (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=129; +UPDATE guest_os_hypervisor SET guest_os_name='Ubuntu 8.04 (64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=130; + +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.0(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=30; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.1(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=32; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.2(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=34; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.3(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=36; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.4(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=38; + +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.0(64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=31; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.1(64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=33; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.2(64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=35; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.3(64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=37; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 5.4(64-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=39; + +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 4.5(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=26; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 4.6(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=27; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 4.7(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=28; +UPDATE guest_os_hypervisor SET guest_os_name='Red Hat Enterprise Linux 4.8(32-bit)' WHERE hypervisor_type='VmWare' AND guest_os_id=29; + +update host_details set name='cpuspeed' where host_id in (select id from host where hypervisor_type='BareMetal') and name='cpuCapacity'; +update host_details set name='cpunumber' where host_id in (select id from host where hypervisor_type='BareMetal') and name='cpuNum'; +update host_details set name='hostmac' where host_id in (select id from host where hypervisor_type='BareMetal') and name='mac'; +update host_details set name='memory' where host_id in (select id from host where hypervisor_type='BareMetal') and name='memCapacity'; +update host_details set name='privateip' where host_id in (select id from host where hypervisor_type='BareMetal') and name='agentIp'; + +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.root.disk.controller', 'ide', 'Specify the default disk controller for root volumes, valid values are scsi, ide'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vm.destory.forcestop', 'false', 'On destory, force-stop takes this value'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.lock.timeout', '600', 'Lock wait timeout (seconds) while implementing network'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.disable.rpfilter','true','disable rp_filter on Domain Router VM public interfaces.'); + diff --git a/setup/db/db/schema-2213to2214.sql b/setup/db/db/schema-2213to2214.sql index cadf43f28f2..de391d3e322 100644 --- a/setup/db/db/schema-2213to2214.sql +++ b/setup/db/db/schema-2213to2214.sql @@ -1,85 +1,90 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.2.13 to 2.2.14; ---; - -ALTER TABLE `cloud`.`vm_template` MODIFY `extractable` int(1) unsigned NOT NULL default 0 COMMENT 'Is this template extractable'; -INSERT IGNORE INTO `cloud`.`configuration` (category, instance, component, name, value, description) VALUES ('Advanced', 'DEFAULT', 'management-server', 'external.network.stats.interval', '300', 'Interval (in seconds) to report external network statistics.'); - -CREATE TABLE `cloud`.`mshost_peer` ( - `id` bigint unsigned NOT NULL auto_increment, - `owner_mshost` bigint unsigned NOT NULL, - `peer_mshost` bigint unsigned NOT NULL, - `peer_runid` bigint NOT NULL, - `peer_state` varchar(10) NOT NULL DEFAULT 'Down', - `last_update` DATETIME NULL COMMENT 'Last record update time', - - PRIMARY KEY (`id`), - CONSTRAINT `fk_mshost_peer__owner_mshost` FOREIGN KEY (`owner_mshost`) REFERENCES `mshost`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_mshost_peer__peer_mshost` FOREIGN KEY (`peer_mshost`) REFERENCES `mshost`(`id`), - UNIQUE `i_mshost_peer__owner_peer_runid`(`owner_mshost`, `peer_mshost`, `peer_runid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT IGNORE INTO configuration (category, instance, component, name, value, description) VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.systemvm.nic.device.type', 'E1000', 'Specify the default network device type for system VMs, valid values are E1000, PCNet32, Vmxnet2, Vmxnet3'); -INSERT IGNORE INTO configuration (category, instance, component, name, value, description) VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.recycle.hung.wokervm', 'false', 'Specify whether or not to recycle hung worker VMs'); - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'migratewait', '3600', 'Time (in seconds) to wait for VM migrate finish'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'sync.interval', '60', 'Cluster Delta sync interval in seconds'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'skip.steps', '60', 'Cluster full sync skip steps count'); - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'StorageManager', 'backup.snapshot.wait', '10800', 'In second, timeout for BackupSnapshotCommand'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'StorageManager', 'copy.volume.wait', '10800', 'In second, timeout for copy volume command'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'UserVmManager', 'create.private.template.from.snapshot.wait', '10800', 'In second, timeout for CreatePrivateTemplateFromSnapshotCommand'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'UserVmManager', 'create.private.template.from.volume.wait', '10800', 'In second, timeout for CreatePrivateTemplateFromVolumeCommand'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'StorageManager', 'create.volume.from.snapshot.wait', '10800', 'In second, timeout for create template from snapshot'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'TemplateManager', 'primary.storage.download.wait', '10800', 'In second, timeout for download template to primary storage'); - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'usage.execution.timezone', null, 'The timezone to use for usage job execution time'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'usage.stats.job.aggregation.range', '1440', 'The range of time for aggregating the user statistics specified in minutes (e.g. 1440 for daily, 60 for hourly.'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'usage.stats.job.exec.time', '00:15', 'The time at which the usage statistics aggregation job will run as an HH24:MM time, e.g. 00:30 to run at 12:30am.'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'enable.usage.server', 'true', 'Flag for enabling usage'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'direct.network.stats.interval', '86400', 'Interval (in seconds) to collect stats from Traffic Monitor'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'usage.aggregation.timezone', 'GMT', 'The timezone to use for usage stats aggregation'); - - -INSERT IGNORE INTO `cloud`.`guest_os` (category_id, name, display_name) VALUES (6, NULL, "Windows PV"); - -CREATE TABLE `cloud`.`vm_template_details` ( - `id` bigint unsigned NOT NULL auto_increment, - `template_id` bigint unsigned NOT NULL COMMENT 'template id', - `name` varchar(255) NOT NULL, - `value` varchar(1024) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_vm_template_details__template_id` FOREIGN KEY `fk_vm_template_details__template_id`(`template_id`) REFERENCES `vm_template`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -ALTER TABLE `cloud`.`domain_router` MODIFY `is_redundant_router` int(1) unsigned NOT NULL COMMENT 'if in redundant router mode'; -ALTER TABLE `cloud`.`domain_router` MODIFY `is_priority_bumpup` int(1) unsigned NOT NULL COMMENT 'if the priority has been bumped up'; -ALTER TABLE `cloud`.`domain_router` MODIFY `redundant_state` varchar(64) NOT NULL COMMENT 'the state of redundant virtual router'; -ALTER TABLE `cloud`.`domain_router` MODIFY `stop_pending` int(1) unsigned NOT NULL COMMENT 'if this router would be stopped after we can connect to it'; - - -ALTER TABLE `cloud`.`service_offering` MODIFY `limit_cpu_use` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Limit the CPU usage to service offering'; - -ALTER TABLE `cloud`.`vm_instance` MODIFY `limit_cpu_use` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Limit the cpu usage to service offering'; - -UPDATE `cloud`.`configuration` SET `value`='false' WHERE `name`='agent.lb.enabled'; - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. -ALTER TABLE `cloud_usage`.`user_statistics` MODIFY `device_type` varchar(32) NOT NULL; +--; +-- Schema upgrade from 2.2.13 to 2.2.14; +--; -ALTER TABLE `cloud`.`keystore` ADD seq int; +ALTER TABLE `cloud`.`vm_template` MODIFY `extractable` int(1) unsigned NOT NULL default 0 COMMENT 'Is this template extractable'; +INSERT IGNORE INTO `cloud`.`configuration` (category, instance, component, name, value, description) VALUES ('Advanced', 'DEFAULT', 'management-server', 'external.network.stats.interval', '300', 'Interval (in seconds) to report external network statistics.'); + +CREATE TABLE `cloud`.`mshost_peer` ( + `id` bigint unsigned NOT NULL auto_increment, + `owner_mshost` bigint unsigned NOT NULL, + `peer_mshost` bigint unsigned NOT NULL, + `peer_runid` bigint NOT NULL, + `peer_state` varchar(10) NOT NULL DEFAULT 'Down', + `last_update` DATETIME NULL COMMENT 'Last record update time', + + PRIMARY KEY (`id`), + CONSTRAINT `fk_mshost_peer__owner_mshost` FOREIGN KEY (`owner_mshost`) REFERENCES `mshost`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_mshost_peer__peer_mshost` FOREIGN KEY (`peer_mshost`) REFERENCES `mshost`(`id`), + UNIQUE `i_mshost_peer__owner_peer_runid`(`owner_mshost`, `peer_mshost`, `peer_runid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT IGNORE INTO configuration (category, instance, component, name, value, description) VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.systemvm.nic.device.type', 'E1000', 'Specify the default network device type for system VMs, valid values are E1000, PCNet32, Vmxnet2, Vmxnet3'); +INSERT IGNORE INTO configuration (category, instance, component, name, value, description) VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.recycle.hung.wokervm', 'false', 'Specify whether or not to recycle hung worker VMs'); + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'migratewait', '3600', 'Time (in seconds) to wait for VM migrate finish'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'sync.interval', '60', 'Cluster Delta sync interval in seconds'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'skip.steps', '60', 'Cluster full sync skip steps count'); + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'StorageManager', 'backup.snapshot.wait', '10800', 'In second, timeout for BackupSnapshotCommand'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'StorageManager', 'copy.volume.wait', '10800', 'In second, timeout for copy volume command'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'UserVmManager', 'create.private.template.from.snapshot.wait', '10800', 'In second, timeout for CreatePrivateTemplateFromSnapshotCommand'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'UserVmManager', 'create.private.template.from.volume.wait', '10800', 'In second, timeout for CreatePrivateTemplateFromVolumeCommand'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'StorageManager', 'create.volume.from.snapshot.wait', '10800', 'In second, timeout for create template from snapshot'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'TemplateManager', 'primary.storage.download.wait', '10800', 'In second, timeout for download template to primary storage'); + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'usage.execution.timezone', null, 'The timezone to use for usage job execution time'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'usage.stats.job.aggregation.range', '1440', 'The range of time for aggregating the user statistics specified in minutes (e.g. 1440 for daily, 60 for hourly.'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'usage.stats.job.exec.time', '00:15', 'The time at which the usage statistics aggregation job will run as an HH24:MM time, e.g. 00:30 to run at 12:30am.'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'enable.usage.server', 'true', 'Flag for enabling usage'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'direct.network.stats.interval', '86400', 'Interval (in seconds) to collect stats from Traffic Monitor'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Premium', 'DEFAULT', 'management-server', 'usage.aggregation.timezone', 'GMT', 'The timezone to use for usage stats aggregation'); + + +INSERT IGNORE INTO `cloud`.`guest_os` (category_id, name, display_name) VALUES (6, NULL, "Windows PV"); + +CREATE TABLE `cloud`.`vm_template_details` ( + `id` bigint unsigned NOT NULL auto_increment, + `template_id` bigint unsigned NOT NULL COMMENT 'template id', + `name` varchar(255) NOT NULL, + `value` varchar(1024) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_vm_template_details__template_id` FOREIGN KEY `fk_vm_template_details__template_id`(`template_id`) REFERENCES `vm_template`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +ALTER TABLE `cloud`.`domain_router` MODIFY `is_redundant_router` int(1) unsigned NOT NULL COMMENT 'if in redundant router mode'; +ALTER TABLE `cloud`.`domain_router` MODIFY `is_priority_bumpup` int(1) unsigned NOT NULL COMMENT 'if the priority has been bumped up'; +ALTER TABLE `cloud`.`domain_router` MODIFY `redundant_state` varchar(64) NOT NULL COMMENT 'the state of redundant virtual router'; +ALTER TABLE `cloud`.`domain_router` MODIFY `stop_pending` int(1) unsigned NOT NULL COMMENT 'if this router would be stopped after we can connect to it'; + + +ALTER TABLE `cloud`.`service_offering` MODIFY `limit_cpu_use` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Limit the CPU usage to service offering'; + +ALTER TABLE `cloud`.`vm_instance` MODIFY `limit_cpu_use` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Limit the cpu usage to service offering'; + +UPDATE `cloud`.`configuration` SET `value`='false' WHERE `name`='agent.lb.enabled'; + + +ALTER TABLE `cloud_usage`.`user_statistics` MODIFY `device_type` varchar(32) NOT NULL; + +ALTER TABLE `cloud`.`keystore` ADD seq int; ALTER TABLE `cloud`.`keystore` MODIFY `cloud`.`keystore`.`key` text; diff --git a/setup/db/db/schema-2214to30-cleanup.sql b/setup/db/db/schema-2214to30-cleanup.sql index 4f9bb2629d5..6b05e9abd39 100644 --- a/setup/db/db/schema-2214to30-cleanup.sql +++ b/setup/db/db/schema-2214to30-cleanup.sql @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. ALTER TABLE `cloud_usage`.`usage_network` DROP COLUMN `net_bytes_received`; ALTER TABLE `cloud_usage`.`usage_network` DROP COLUMN `net_bytes_sent`; diff --git a/setup/db/db/schema-2214to30.sql b/setup/db/db/schema-2214to30.sql index 3187c94fa4a..0b3e45431a7 100755 --- a/setup/db/db/schema-2214to30.sql +++ b/setup/db/db/schema-2214to30.sql @@ -1,16 +1,21 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 -#Schema upgrade from 2.2.14 to 3.0; +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +-- Schema upgrade from 2.2.14 to 3.0; ALTER TABLE `cloud`.`host` ADD COLUMN `hypervisor_version` varchar(32) COMMENT 'hypervisor version' AFTER hypervisor_type; diff --git a/setup/db/db/schema-221to222-cleanup.sql b/setup/db/db/schema-221to222-cleanup.sql index da6a3465b59..5908dbb78fa 100644 --- a/setup/db/db/schema-221to222-cleanup.sql +++ b/setup/db/db/schema-221to222-cleanup.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + alter table firewall_rules drop column is_static_nat; delete from configuration where name='router.cleanup'; diff --git a/setup/db/db/schema-221to222-premium.sql b/setup/db/db/schema-221to222-premium.sql index f43bbfe0294..5477fd8a348 100755 --- a/setup/db/db/schema-221to222-premium.sql +++ b/setup/db/db/schema-221to222-premium.sql @@ -1,21 +1,26 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.2.1 to 2.2.2; ---; -ALTER TABLE `cloud_usage`.`cloud_usage` ADD COLUMN `network_id` bigint unsigned; - -ALTER TABLE `cloud_usage`.`usage_network` ADD COLUMN `network_id` bigint unsigned; - -ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `network_id` bigint unsigned; -ALTER TABLE `cloud_usage`.`user_statistics` ADD UNIQUE KEY (`account_id`, `data_center_id`, `public_ip_address`, `device_id`, `device_type`); +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.2.1 to 2.2.2; +--; +ALTER TABLE `cloud_usage`.`cloud_usage` ADD COLUMN `network_id` bigint unsigned; + +ALTER TABLE `cloud_usage`.`usage_network` ADD COLUMN `network_id` bigint unsigned; + +ALTER TABLE `cloud_usage`.`user_statistics` ADD COLUMN `network_id` bigint unsigned; +ALTER TABLE `cloud_usage`.`user_statistics` ADD UNIQUE KEY (`account_id`, `data_center_id`, `public_ip_address`, `device_id`, `device_type`); diff --git a/setup/db/db/schema-221to222.sql b/setup/db/db/schema-221to222.sql index 51771980ca7..c4fb804886e 100644 --- a/setup/db/db/schema-221to222.sql +++ b/setup/db/db/schema-221to222.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + update firewall_rules set purpose='StaticNat' where is_static_nat=1; alter table user_ip_address add CONSTRAINT `fk_user_ip_address__vm_id` FOREIGN KEY (`vm_id`) REFERENCES `vm_instance`(`id`); update network_offerings set system_only=1 where name='System-Guest-Network'; diff --git a/setup/db/db/schema-222to224-cleanup.sql b/setup/db/db/schema-222to224-cleanup.sql index 3c404f89334..1bcd5d4c5f0 100644 --- a/setup/db/db/schema-222to224-cleanup.sql +++ b/setup/db/db/schema-222to224-cleanup.sql @@ -1,15 +1,21 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + DROP TABLE IF EXISTS `cloud`.`host_master`; DROP TABLE IF EXISTS `cloud`.`hypervsior_properties`; diff --git a/setup/db/db/schema-222to224-premium.sql b/setup/db/db/schema-222to224-premium.sql index ac6bc6b874d..931ca42ec56 100755 --- a/setup/db/db/schema-222to224-premium.sql +++ b/setup/db/db/schema-222to224-premium.sql @@ -1,19 +1,24 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.2.2 to 2.2.4; ---; -ALTER TABLE `cloud_usage`.`usage_vm_instance` ADD COLUMN `hypervisor_type` varchar(255); - -ALTER TABLE `cloud_usage`.`usage_event` ADD COLUMN `resource_type` varchar(32); - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.2.2 to 2.2.4; +--; +ALTER TABLE `cloud_usage`.`usage_vm_instance` ADD COLUMN `hypervisor_type` varchar(255); + +ALTER TABLE `cloud_usage`.`usage_event` ADD COLUMN `resource_type` varchar(32); + diff --git a/setup/db/db/schema-222to224.sql b/setup/db/db/schema-222to224.sql index 50f1bcf8fe6..439fd6d2684 100644 --- a/setup/db/db/schema-222to224.sql +++ b/setup/db/db/schema-222to224.sql @@ -1,191 +1,196 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.2.2 to 2.2.4; ---; - -CREATE TABLE IF NOT EXISTS `cloud`.`version` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', - `version` char(40) NOT NULL UNIQUE COMMENT 'version', - `updated` datetime NOT NULL COMMENT 'Date this version table was updated', - `step` char(32) NOT NULL COMMENT 'Step in the upgrade to this version', - PRIMARY KEY (`id`), - INDEX `i_version__version`(`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`op_host_capacity` ADD COLUMN `cluster_id` bigint unsigned AFTER `pod_id`; -ALTER TABLE `cloud`.`op_host_capacity` ADD CONSTRAINT `fk_op_host_capacity__cluster_id` FOREIGN KEY `fk_op_host_capacity__cluster_id` (`cluster_id`) REFERENCES `cloud`.`cluster`(`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`op_host_capacity` ADD INDEX `i_op_host_capacity__cluster_id`(`cluster_id`); -ALTER TABLE `cloud`.`usage_event` ADD COLUMN `resource_type` varchar(32); - -CREATE TABLE `cloud`.`domain_network_ref` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `domain_id` bigint unsigned NOT NULL COMMENT 'domain id', - `network_id` bigint unsigned NOT NULL COMMENT 'network id', - PRIMARY KEY (`id`), - CONSTRAINT `fk_domain_network_ref__domain_id` FOREIGN KEY (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_domain_network_ref__networks_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`nics` MODIFY `ip4_address` char(40); -ALTER TABLE `cloud`.`op_lock` MODIFY `ip` char(40) NOT NULL; -ALTER TABLE `cloud`.`volumes` MODIFY `host_ip` char(40); -ALTER TABLE `cloud`.`op_dc_ip_address_alloc` MODIFY `ip_address` char(40) NOT NULL; -ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` MODIFY `ip_address` char(40) NOT NULL; -ALTER TABLE `cloud`.`host` MODIFY `private_ip_address` char(40) NOT NULL; -ALTER TABLE `cloud`.`host` MODIFY `storage_ip_address` char(40) NOT NULL; -ALTER TABLE `cloud`.`host` MODIFY `storage_ip_address_2` char(40); -ALTER TABLE `cloud`.`host` MODIFY `public_ip_address` char(40); -ALTER TABLE `cloud`.`mshost` MODIFY `service_ip` char(40) NOT NULL; -ALTER TABLE `cloud`.`user_statistics` MODIFY `public_ip_address` char(40); -ALTER TABLE `cloud`.`vm_instance` MODIFY `private_ip_address` char(40); -ALTER TABLE `cloud`.`user_vm` MODIFY `guest_ip_address` char(40); -ALTER TABLE `cloud`.`domain_router` MODIFY `public_ip_address` char(40); -ALTER TABLE `cloud`.`domain_router` MODIFY `guest_ip_address` char(40); -ALTER TABLE `cloud`.`console_proxy` MODIFY `public_ip_address` char(40) UNIQUE; -ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY `public_ip_address` char(40) UNIQUE; -ALTER TABLE `cloud`.`remote_access_vpn` MODIFY `local_ip` char(40) NOT NULL; -ALTER TABLE `cloud`.`user_ip_address` MODIFY `public_ip_address` char(40) NOT NULL; - -#Commented out these lines because they have to be done inside java.; -#ALTER TABLE `cloud`.`networks` DROP FOREIGN KEY `fk_networks__related`; -#ALTER TABLE `cloud`.`networks` ADD CONSTRAINT `fk_networks__related` FOREIGN KEY(`related`) REFERENCES `networks`(`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`cluster` ADD COLUMN `removed` datetime COMMENT 'date removed if not null'; -ALTER TABLE `cloud`.`cluster` MODIFY `name` varchar(255) COMMENT 'name for the cluster'; - -ALTER TABLE `cloud`.`network_offerings` MODIFY `guest_type` char(32); - - -UPDATE `cloud`.`network_offerings` SET `nw_rate`=0, `mc_rate`=0 WHERE system_only=1 and guest_type IS NULL; -UPDATE `cloud`.`network_offerings` SET `default`=1 WHERE system_only=1; - -ALTER TABLE `cloud`.`data_center` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled'; -ALTER TABLE `cloud`.`data_center` ADD INDEX `i_data_center__allocation_state`(`allocation_state`); -ALTER TABLE `cloud`.`cluster` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled'; -ALTER TABLE `cloud`.`cluster` ADD INDEX `i_cluster__allocation_state`(`allocation_state`); -ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled'; -ALTER TABLE `cloud`.`host_pod_ref` ADD INDEX `i_host_pod_ref__allocation_state`(`allocation_state`); -ALTER TABLE `cloud`.`host` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled'; -ALTER TABLE `cloud`.`host` ADD INDEX `i_host__allocation_state`(`allocation_state`); - -ALTER TABLE `cloud`.`domain` ADD INDEX `i_domain__path`(`path`); - -CREATE TABLE `cloud`.`data_center_details` ( - `id` bigint unsigned NOT NULL auto_increment, - `dc_id` bigint unsigned NOT NULL COMMENT 'dc id', - `name` varchar(255) NOT NULL, - `value` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_dc_details__dc_id` FOREIGN KEY (`dc_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`op_host_capacity` MODIFY `used_capacity` bigint signed NOT NULL; -ALTER TABLE `cloud`.`op_host_capacity` MODIFY `reserved_capacity` bigint signed NOT NULL; -ALTER TABLE `cloud`.`op_host_capacity` MODIFY `total_capacity` bigint signed NOT NULL; - -INSERT IGNORE INTO `cloud`.`configuration` VALUES -('Advanced','DEFAULT','management-server','control.cidr','169.254.0.0/16','Changes the cidr for the control network traffic. Defaults to using link local. Must be unique within pods'), -('Advanced','DEFAULT','management-server','control.gateway','169.254.0.1','gateway for the control network traffic'), -('Advanced','DEFAULT','AgentManager','cmd.wait','7200','Time (in seconds) to wait for some heavy time-consuming commands'), -('Console Proxy','DEFAULT','AgentManager','consoleproxy.cpu.mhz','500','CPU speed (in MHz) used to create new console proxy VMs'), -('Console Proxy','DEFAULT','AgentManager','consoleproxy.disable.rpfilter','true','disable rp_filter on console proxy VM public interface'), -('Console Proxy','DEFAULT','AgentManager','consoleproxy.launch.max','10','maximum number of console proxy instances per zone can be launched'), -('Console Proxy','DEFAULT','AgentManager','consoleproxy.restart','true','Console proxy restart flag, defaulted to true'), -('Console Proxy','DEFAULT','AgentManager','consoleproxy.url.domain','realhostip.com','Console proxy url domain'), -('Advanced','DEFAULT','management-server','extract.url.cleanup.interval','120','The interval (in seconds) to wait before cleaning up the extract URL\'s '), -('Network','DEFAULT','AgentManager','guest.ip.network','10.1.1.1','The network address of the guest virtual network. Virtual machines will be assigned an IP in this subnet.'), -('Network','DEFAULT','AgentManager','guest.netmask','255.255.255.0','The netmask of the guest virtual network.'), -('Network','DEFAULT','management-server','guest.vlan.bits','12','The number of bits to reserve for the VLAN identifier in the guest subnet.'), -('Advanced','DEFAULT','management-server','host.capacity.checker.interval','3600','Time (in seconds) to wait before recalculating host\'s capacity'), -('Advanced','DEFAULT','management-server','host.capacity.checker.wait','3600','Time (in seconds) to wait before starting host capacity background checker'), -('Advanced','DEFAULT','management-server','host.capacityType.to.order.clusters','CPU','The host capacity type (CPU or RAM) is used by deployment planner to order clusters during VM resource allocation'), -('Advanced','DEFAULT','management-server','job.cancel.threshold.minutes','60','Time (in minutes) for async-jobs to be forcely cancelled if it has been in process for long'), -('Advanced','DEFAULT','management-server','kvm.private.network.device',NULL,'Specify the private bridge on host for private network'), -('Advanced','DEFAULT','management-server','kvm.public.network.device',NULL,'Specify the public bridge on host for public network'), -('Advanced','DEFAULT','management-server','network.gc.interval','600','Seconds to wait before checking for networks to shutdown'), -('Advanced','DEFAULT','management-server','network.gc.wait','600','Time (in seconds) to wait before shutting down a network that\'s not in used'), -('Network','DEFAULT','management-server','open.vswitch.tunnel.network','false','enable/disable open vswitch tunnel network(no vlan)'), -('Network','DEFAULT','management-server','open.vswitch.vlan.network','false','enable/disable vlan remapping of open vswitch network'), -('Advanced','DEFAULT','none','router.cpu.mhz','500','Default CPU speed (MHz) for router VM.'), -('Advanced','DEFAULT','none','router.template.id','1','Default ID for template.'), -('Advanced','DEFAULT','AgentManager','secstorage.vm.cpu.mhz','500','CPU speed (in MHz) used to create new secondary storage vms'), -('Snapshots','DEFAULT','none','snapshot.delta.max','16','max delta snapshots between two full snapshots.'), -('Advanced','DEFAULT','management-server','system.vm.auto.reserve.capacity','true','Indicates whether or not to automatically reserver system VM standby capacity.'), -('Advanced','DEFAULT','management-server','use.user.concentrated.pod.allocation','true','If true, deployment planner applies the user concentration heuristic during VM resource allocation'), -('Advanced','DEFAULT','management-server','vm.op.cancel.interval','3600','Time (in seconds) to wait before cancelling a operation'), -('Advanced','DEFAULT','management-server','vm.op.cleanup.interval','86400','Interval to run the thread that cleans up the vm operations (in seconds)'), -('Advanced','DEFAULT','management-server','vm.op.cleanup.wait','3600','Time (in seconds) to wait before cleanuping up any vm work items'), -('Advanced','DEFAULT','management-server','vm.op.lock.state.retry','5','Times to retry locking the state of a VM for operations'), -('Advanced','DEFAULT','management-server','vm.op.wait.interval','120','Time (in seconds) to wait before checking if a previous operation has succeeded'), -('Advanced','DEFAULT','management-server','vm.stats.interval','60000','The interval (in milliseconds) when vm stats are retrieved from agents.'), -('Advanced','DEFAULT','management-server','vm.tranisition.wait.interval','3600','Time (in seconds) to wait before taking over a VM in transition state'), -('Advanced','DEFAULT','management-server','vmware.guest.vswitch',NULL,'Specify the vSwitch on host for guest network'), -('Advanced','DEFAULT','management-server','vmware.private.vswitch',NULL,'Specify the vSwitch on host for private network'), -('Advanced','DEFAULT','management-server','vmware.public.vswitch',NULL,'Specify the vSwitch on host for public network'), -('Advanced','DEFAULT','management-server','vmware.service.console','Service Console','Specify the service console network name (ESX host only)'), -('Advanced','DEFAULT','AgentManager','xapiwait','600','Time (in seconds) to wait for XAPI to return'), -('Account Defaults','DEFAULT','management-server','max.account.user.vms','20','The default maximum number of user VMs that can be deployed for an account'), -('Account Defaults','DEFAULT','management-server','max.account.public.ips','20','The default maximum number of public IPs that can be consumed by an account'), -('Account Defaults','DEFAULT','management-server','max.account.templates','20','The default maximum number of templates that can be deployed for an account'), -('Account Defaults','DEFAULT','management-server','max.account.snapshots','20','The default maximum number of snapshots that can be created for an account'), -('Account Defaults','DEFAULT','management-server','max.account.volumes','20','The default maximum number of volumes that can be created for an account'); - -ALTER TABLE `cloud`.`op_dc_ip_address_alloc` CHANGE COLUMN `instance_id` `nic_id` bigint unsigned DEFAULT NULL; -ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` CHANGE COLUMN `instance_id` `nic_id` bigint unsigned DEFAULT NULL; - - -DELETE FROM `cloud`.`sequence` WHERE name='snapshots_seq'; -UPDATE `cloud`.`service_offering` s, `cloud`.`disk_offering` d SET s.ha_enabled=1 where s.id=d.id and d.system_use=1; - -UPDATE `cloud`.`data_center` SET is_security_group_enabled=1 WHERE networktype='Basic'; -UPDATE `cloud`.`networks` SET is_security_group_enabled=1 WHERE guru_name='DirectPodBasedNetworkGuru'; - -UPDATE `cloud`.`nics` SET ip_type='Ip4'; -UPDATE `cloud`.`nics` SET broadcast_uri='vlan://untagged', isolation_uri='ec2://untagged', strategy='Create' where reserver_name='DirectPodBasedNetworkGuru'; - - -DELETE FROM `cloud`.`configuration` where name='schema.level'; -DELETE FROM `cloud`.`configuration` where name='direct.attach.security.groups.enabled'; - -ALTER TABLE `cloud`.`domain` MODIFY COLUMN `path` varchar(255) NOT NULL; - -ALTER TABLE `cloud`.`network_offerings` ADD INDEX `i_network_offerings__removed`(`removed`); - -ALTER TABLE `cloud`.`nics` ADD INDEX `i_nics__removed`(`removed`); - -ALTER TABLE `cloud`.`snapshot_schedule` DROP KEY `volume_id`; -ALTER TABLE `cloud`.`snapshot_schedule` ADD UNIQUE KEY `volume_id` (`volume_id`,`policy_id`); - -ALTER TABLE `cloud`.`storage_pool` MODIFY COLUMN `uuid` varchar(255) UNIQUE; - -ALTER TABLE `cloud`.`user_statistics` DROP KEY `account_id`; -ALTER TABLE `cloud`.`user_statistics` ADD UNIQUE KEY `account_id` (`account_id`,`data_center_id`, `public_ip_address`, `device_id`,`device_type`); - -ALTER TABLE `cloud`.`usage_event` ADD INDEX `i_usage_event__created`(`created`); - -UPDATE `cloud`.`vm_instance` SET ha_enabled=0 WHERE type='ConsoleProxy'; - -UPDATE service_offering SET ha_enabled=0 WHERE id=(SELECT id FROM disk_offering WHERE name LIKE '%console proxy%' AND system_use=1); - -ALTER TABLE `cloud`.`storage_pool_details` DROP KEY `i_storage_pool_details__name__value`; -ALTER TABLE `cloud`.`storage_pool_details` ADD INDEX `i_storage_pool_details__name__value`(`name`(128), `value`(128)); - -DROP TABLE `cloud`.`load_balancer`; - - -UPDATE `cloud`.`nics` SET strategy='Create' where reserver_name='DirectNetworkGuru'; - -UPDATE storage_pool SET cluster_id=(SELECT cluster_id FROM host INNER JOIN storage_pool_host_ref WHERE host.id=storage_pool_host_ref.host_id AND storage_pool_host_ref.pool_id=storage_pool.id) WHERE pool_type='LVM'; -UPDATE `cloud`.`host` SET resource='com.cloud.hypervisor.xen.resource.XenServer56FP1Resource' WHERE resource='com.cloud.hypervisor.xen.resource.XenServer56FP1PremiumResource'; - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.2.2 to 2.2.4; +--; + +CREATE TABLE IF NOT EXISTS `cloud`.`version` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', + `version` char(40) NOT NULL UNIQUE COMMENT 'version', + `updated` datetime NOT NULL COMMENT 'Date this version table was updated', + `step` char(32) NOT NULL COMMENT 'Step in the upgrade to this version', + PRIMARY KEY (`id`), + INDEX `i_version__version`(`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`op_host_capacity` ADD COLUMN `cluster_id` bigint unsigned AFTER `pod_id`; +ALTER TABLE `cloud`.`op_host_capacity` ADD CONSTRAINT `fk_op_host_capacity__cluster_id` FOREIGN KEY `fk_op_host_capacity__cluster_id` (`cluster_id`) REFERENCES `cloud`.`cluster`(`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`op_host_capacity` ADD INDEX `i_op_host_capacity__cluster_id`(`cluster_id`); +ALTER TABLE `cloud`.`usage_event` ADD COLUMN `resource_type` varchar(32); + +CREATE TABLE `cloud`.`domain_network_ref` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `domain_id` bigint unsigned NOT NULL COMMENT 'domain id', + `network_id` bigint unsigned NOT NULL COMMENT 'network id', + PRIMARY KEY (`id`), + CONSTRAINT `fk_domain_network_ref__domain_id` FOREIGN KEY (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_domain_network_ref__networks_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`nics` MODIFY `ip4_address` char(40); +ALTER TABLE `cloud`.`op_lock` MODIFY `ip` char(40) NOT NULL; +ALTER TABLE `cloud`.`volumes` MODIFY `host_ip` char(40); +ALTER TABLE `cloud`.`op_dc_ip_address_alloc` MODIFY `ip_address` char(40) NOT NULL; +ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` MODIFY `ip_address` char(40) NOT NULL; +ALTER TABLE `cloud`.`host` MODIFY `private_ip_address` char(40) NOT NULL; +ALTER TABLE `cloud`.`host` MODIFY `storage_ip_address` char(40) NOT NULL; +ALTER TABLE `cloud`.`host` MODIFY `storage_ip_address_2` char(40); +ALTER TABLE `cloud`.`host` MODIFY `public_ip_address` char(40); +ALTER TABLE `cloud`.`mshost` MODIFY `service_ip` char(40) NOT NULL; +ALTER TABLE `cloud`.`user_statistics` MODIFY `public_ip_address` char(40); +ALTER TABLE `cloud`.`vm_instance` MODIFY `private_ip_address` char(40); +ALTER TABLE `cloud`.`user_vm` MODIFY `guest_ip_address` char(40); +ALTER TABLE `cloud`.`domain_router` MODIFY `public_ip_address` char(40); +ALTER TABLE `cloud`.`domain_router` MODIFY `guest_ip_address` char(40); +ALTER TABLE `cloud`.`console_proxy` MODIFY `public_ip_address` char(40) UNIQUE; +ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY `public_ip_address` char(40) UNIQUE; +ALTER TABLE `cloud`.`remote_access_vpn` MODIFY `local_ip` char(40) NOT NULL; +ALTER TABLE `cloud`.`user_ip_address` MODIFY `public_ip_address` char(40) NOT NULL; + +#Commented out these lines because they have to be done inside java.; +#ALTER TABLE `cloud`.`networks` DROP FOREIGN KEY `fk_networks__related`; +#ALTER TABLE `cloud`.`networks` ADD CONSTRAINT `fk_networks__related` FOREIGN KEY(`related`) REFERENCES `networks`(`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`cluster` ADD COLUMN `removed` datetime COMMENT 'date removed if not null'; +ALTER TABLE `cloud`.`cluster` MODIFY `name` varchar(255) COMMENT 'name for the cluster'; + +ALTER TABLE `cloud`.`network_offerings` MODIFY `guest_type` char(32); + + +UPDATE `cloud`.`network_offerings` SET `nw_rate`=0, `mc_rate`=0 WHERE system_only=1 and guest_type IS NULL; +UPDATE `cloud`.`network_offerings` SET `default`=1 WHERE system_only=1; + +ALTER TABLE `cloud`.`data_center` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled'; +ALTER TABLE `cloud`.`data_center` ADD INDEX `i_data_center__allocation_state`(`allocation_state`); +ALTER TABLE `cloud`.`cluster` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled'; +ALTER TABLE `cloud`.`cluster` ADD INDEX `i_cluster__allocation_state`(`allocation_state`); +ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled'; +ALTER TABLE `cloud`.`host_pod_ref` ADD INDEX `i_host_pod_ref__allocation_state`(`allocation_state`); +ALTER TABLE `cloud`.`host` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled'; +ALTER TABLE `cloud`.`host` ADD INDEX `i_host__allocation_state`(`allocation_state`); + +ALTER TABLE `cloud`.`domain` ADD INDEX `i_domain__path`(`path`); + +CREATE TABLE `cloud`.`data_center_details` ( + `id` bigint unsigned NOT NULL auto_increment, + `dc_id` bigint unsigned NOT NULL COMMENT 'dc id', + `name` varchar(255) NOT NULL, + `value` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_dc_details__dc_id` FOREIGN KEY (`dc_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`op_host_capacity` MODIFY `used_capacity` bigint signed NOT NULL; +ALTER TABLE `cloud`.`op_host_capacity` MODIFY `reserved_capacity` bigint signed NOT NULL; +ALTER TABLE `cloud`.`op_host_capacity` MODIFY `total_capacity` bigint signed NOT NULL; + +INSERT IGNORE INTO `cloud`.`configuration` VALUES +('Advanced','DEFAULT','management-server','control.cidr','169.254.0.0/16','Changes the cidr for the control network traffic. Defaults to using link local. Must be unique within pods'), +('Advanced','DEFAULT','management-server','control.gateway','169.254.0.1','gateway for the control network traffic'), +('Advanced','DEFAULT','AgentManager','cmd.wait','7200','Time (in seconds) to wait for some heavy time-consuming commands'), +('Console Proxy','DEFAULT','AgentManager','consoleproxy.cpu.mhz','500','CPU speed (in MHz) used to create new console proxy VMs'), +('Console Proxy','DEFAULT','AgentManager','consoleproxy.disable.rpfilter','true','disable rp_filter on console proxy VM public interface'), +('Console Proxy','DEFAULT','AgentManager','consoleproxy.launch.max','10','maximum number of console proxy instances per zone can be launched'), +('Console Proxy','DEFAULT','AgentManager','consoleproxy.restart','true','Console proxy restart flag, defaulted to true'), +('Console Proxy','DEFAULT','AgentManager','consoleproxy.url.domain','realhostip.com','Console proxy url domain'), +('Advanced','DEFAULT','management-server','extract.url.cleanup.interval','120','The interval (in seconds) to wait before cleaning up the extract URL\'s '), +('Network','DEFAULT','AgentManager','guest.ip.network','10.1.1.1','The network address of the guest virtual network. Virtual machines will be assigned an IP in this subnet.'), +('Network','DEFAULT','AgentManager','guest.netmask','255.255.255.0','The netmask of the guest virtual network.'), +('Network','DEFAULT','management-server','guest.vlan.bits','12','The number of bits to reserve for the VLAN identifier in the guest subnet.'), +('Advanced','DEFAULT','management-server','host.capacity.checker.interval','3600','Time (in seconds) to wait before recalculating host\'s capacity'), +('Advanced','DEFAULT','management-server','host.capacity.checker.wait','3600','Time (in seconds) to wait before starting host capacity background checker'), +('Advanced','DEFAULT','management-server','host.capacityType.to.order.clusters','CPU','The host capacity type (CPU or RAM) is used by deployment planner to order clusters during VM resource allocation'), +('Advanced','DEFAULT','management-server','job.cancel.threshold.minutes','60','Time (in minutes) for async-jobs to be forcely cancelled if it has been in process for long'), +('Advanced','DEFAULT','management-server','kvm.private.network.device',NULL,'Specify the private bridge on host for private network'), +('Advanced','DEFAULT','management-server','kvm.public.network.device',NULL,'Specify the public bridge on host for public network'), +('Advanced','DEFAULT','management-server','network.gc.interval','600','Seconds to wait before checking for networks to shutdown'), +('Advanced','DEFAULT','management-server','network.gc.wait','600','Time (in seconds) to wait before shutting down a network that\'s not in used'), +('Network','DEFAULT','management-server','open.vswitch.tunnel.network','false','enable/disable open vswitch tunnel network(no vlan)'), +('Network','DEFAULT','management-server','open.vswitch.vlan.network','false','enable/disable vlan remapping of open vswitch network'), +('Advanced','DEFAULT','none','router.cpu.mhz','500','Default CPU speed (MHz) for router VM.'), +('Advanced','DEFAULT','none','router.template.id','1','Default ID for template.'), +('Advanced','DEFAULT','AgentManager','secstorage.vm.cpu.mhz','500','CPU speed (in MHz) used to create new secondary storage vms'), +('Snapshots','DEFAULT','none','snapshot.delta.max','16','max delta snapshots between two full snapshots.'), +('Advanced','DEFAULT','management-server','system.vm.auto.reserve.capacity','true','Indicates whether or not to automatically reserver system VM standby capacity.'), +('Advanced','DEFAULT','management-server','use.user.concentrated.pod.allocation','true','If true, deployment planner applies the user concentration heuristic during VM resource allocation'), +('Advanced','DEFAULT','management-server','vm.op.cancel.interval','3600','Time (in seconds) to wait before cancelling a operation'), +('Advanced','DEFAULT','management-server','vm.op.cleanup.interval','86400','Interval to run the thread that cleans up the vm operations (in seconds)'), +('Advanced','DEFAULT','management-server','vm.op.cleanup.wait','3600','Time (in seconds) to wait before cleanuping up any vm work items'), +('Advanced','DEFAULT','management-server','vm.op.lock.state.retry','5','Times to retry locking the state of a VM for operations'), +('Advanced','DEFAULT','management-server','vm.op.wait.interval','120','Time (in seconds) to wait before checking if a previous operation has succeeded'), +('Advanced','DEFAULT','management-server','vm.stats.interval','60000','The interval (in milliseconds) when vm stats are retrieved from agents.'), +('Advanced','DEFAULT','management-server','vm.tranisition.wait.interval','3600','Time (in seconds) to wait before taking over a VM in transition state'), +('Advanced','DEFAULT','management-server','vmware.guest.vswitch',NULL,'Specify the vSwitch on host for guest network'), +('Advanced','DEFAULT','management-server','vmware.private.vswitch',NULL,'Specify the vSwitch on host for private network'), +('Advanced','DEFAULT','management-server','vmware.public.vswitch',NULL,'Specify the vSwitch on host for public network'), +('Advanced','DEFAULT','management-server','vmware.service.console','Service Console','Specify the service console network name (ESX host only)'), +('Advanced','DEFAULT','AgentManager','xapiwait','600','Time (in seconds) to wait for XAPI to return'), +('Account Defaults','DEFAULT','management-server','max.account.user.vms','20','The default maximum number of user VMs that can be deployed for an account'), +('Account Defaults','DEFAULT','management-server','max.account.public.ips','20','The default maximum number of public IPs that can be consumed by an account'), +('Account Defaults','DEFAULT','management-server','max.account.templates','20','The default maximum number of templates that can be deployed for an account'), +('Account Defaults','DEFAULT','management-server','max.account.snapshots','20','The default maximum number of snapshots that can be created for an account'), +('Account Defaults','DEFAULT','management-server','max.account.volumes','20','The default maximum number of volumes that can be created for an account'); + +ALTER TABLE `cloud`.`op_dc_ip_address_alloc` CHANGE COLUMN `instance_id` `nic_id` bigint unsigned DEFAULT NULL; +ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` CHANGE COLUMN `instance_id` `nic_id` bigint unsigned DEFAULT NULL; + + +DELETE FROM `cloud`.`sequence` WHERE name='snapshots_seq'; +UPDATE `cloud`.`service_offering` s, `cloud`.`disk_offering` d SET s.ha_enabled=1 where s.id=d.id and d.system_use=1; + +UPDATE `cloud`.`data_center` SET is_security_group_enabled=1 WHERE networktype='Basic'; +UPDATE `cloud`.`networks` SET is_security_group_enabled=1 WHERE guru_name='DirectPodBasedNetworkGuru'; + +UPDATE `cloud`.`nics` SET ip_type='Ip4'; +UPDATE `cloud`.`nics` SET broadcast_uri='vlan://untagged', isolation_uri='ec2://untagged', strategy='Create' where reserver_name='DirectPodBasedNetworkGuru'; + + +DELETE FROM `cloud`.`configuration` where name='schema.level'; +DELETE FROM `cloud`.`configuration` where name='direct.attach.security.groups.enabled'; + +ALTER TABLE `cloud`.`domain` MODIFY COLUMN `path` varchar(255) NOT NULL; + +ALTER TABLE `cloud`.`network_offerings` ADD INDEX `i_network_offerings__removed`(`removed`); + +ALTER TABLE `cloud`.`nics` ADD INDEX `i_nics__removed`(`removed`); + +ALTER TABLE `cloud`.`snapshot_schedule` DROP KEY `volume_id`; +ALTER TABLE `cloud`.`snapshot_schedule` ADD UNIQUE KEY `volume_id` (`volume_id`,`policy_id`); + +ALTER TABLE `cloud`.`storage_pool` MODIFY COLUMN `uuid` varchar(255) UNIQUE; + +ALTER TABLE `cloud`.`user_statistics` DROP KEY `account_id`; +ALTER TABLE `cloud`.`user_statistics` ADD UNIQUE KEY `account_id` (`account_id`,`data_center_id`, `public_ip_address`, `device_id`,`device_type`); + +ALTER TABLE `cloud`.`usage_event` ADD INDEX `i_usage_event__created`(`created`); + +UPDATE `cloud`.`vm_instance` SET ha_enabled=0 WHERE type='ConsoleProxy'; + +UPDATE service_offering SET ha_enabled=0 WHERE id=(SELECT id FROM disk_offering WHERE name LIKE '%console proxy%' AND system_use=1); + +ALTER TABLE `cloud`.`storage_pool_details` DROP KEY `i_storage_pool_details__name__value`; +ALTER TABLE `cloud`.`storage_pool_details` ADD INDEX `i_storage_pool_details__name__value`(`name`(128), `value`(128)); + +DROP TABLE `cloud`.`load_balancer`; + + +UPDATE `cloud`.`nics` SET strategy='Create' where reserver_name='DirectNetworkGuru'; + +UPDATE storage_pool SET cluster_id=(SELECT cluster_id FROM host INNER JOIN storage_pool_host_ref WHERE host.id=storage_pool_host_ref.host_id AND storage_pool_host_ref.pool_id=storage_pool.id) WHERE pool_type='LVM'; +UPDATE `cloud`.`host` SET resource='com.cloud.hypervisor.xen.resource.XenServer56FP1Resource' WHERE resource='com.cloud.hypervisor.xen.resource.XenServer56FP1PremiumResource'; + diff --git a/setup/db/db/schema-224to225-cleanup.sql b/setup/db/db/schema-224to225-cleanup.sql index fbf91b48c13..b018d7f280e 100644 --- a/setup/db/db/schema-224to225-cleanup.sql +++ b/setup/db/db/schema-224to225-cleanup.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + DROP TABLE IF EXISTS `cloud`.`ext_lun_details`; DROP TABLE IF EXISTS `cloud`.`ext_lun_alloc`; DROP TABLE IF EXISTS `cloud`.`vm_disk`; diff --git a/setup/db/db/schema-224to225.sql b/setup/db/db/schema-224to225.sql index abb1cb10740..a4eff69b6aa 100644 --- a/setup/db/db/schema-224to225.sql +++ b/setup/db/db/schema-224to225.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + --; -- Schema upgrade from 2.2.4 to 2.2.5; --; diff --git a/setup/db/db/schema-225to226.sql b/setup/db/db/schema-225to226.sql index ba471d4a08d..a991ecebc2c 100644 --- a/setup/db/db/schema-225to226.sql +++ b/setup/db/db/schema-225to226.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + --; -- Schema upgrade from 2.2.5 to 2.2.6; --; diff --git a/setup/db/db/schema-227to228-premium.sql b/setup/db/db/schema-227to228-premium.sql index 0808c57a00c..8c3af0cc2ba 100755 --- a/setup/db/db/schema-227to228-premium.sql +++ b/setup/db/db/schema-227to228-premium.sql @@ -1,71 +1,76 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.2.7 to 2.2.8; ---; -CREATE TABLE IF NOT EXISTS `cloud`.`netapp_pool` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', - `name` varchar(255) NOT NULL UNIQUE COMMENT 'name for the pool', - `algorithm` varchar(255) NOT NULL COMMENT 'algorithm', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `cloud`.`netapp_volume` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', - `ip_address` varchar(255) NOT NULL COMMENT 'ip address/fqdn of the volume', - `pool_id` bigint unsigned NOT NULL COMMENT 'id for the pool', - `pool_name` varchar(255) NOT NULL COMMENT 'name for the pool', - `aggregate_name` varchar(255) NOT NULL COMMENT 'name for the aggregate', - `volume_name` varchar(255) NOT NULL COMMENT 'name for the volume', - `volume_size` varchar(255) NOT NULL COMMENT 'volume size', - `snapshot_policy` varchar(255) NOT NULL COMMENT 'snapshot policy', - `snapshot_reservation` int NOT NULL COMMENT 'snapshot reservation', - `username` varchar(255) NOT NULL COMMENT 'username', - `password` varchar(200) COMMENT 'password', - `round_robin_marker` int COMMENT 'This marks the volume to be picked up for lun creation, RR fashion', - PRIMARY KEY (`ip_address`,`aggregate_name`,`volume_name`), - CONSTRAINT `fk_netapp_volume__pool_id` FOREIGN KEY `fk_netapp_volume__pool_id` (`pool_id`) REFERENCES `netapp_pool` (`id`) ON DELETE CASCADE, - INDEX `i_netapp_volume__pool_id`(`pool_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `cloud`.`netapp_lun` ( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', - `lun_name` varchar(255) NOT NULL COMMENT 'lun name', - `target_iqn` varchar(255) NOT NULL COMMENT 'target iqn', - `path` varchar(255) NOT NULL COMMENT 'lun path', - `size` bigint NOT NULL COMMENT 'lun size', - `volume_id` bigint unsigned NOT NULL COMMENT 'parent volume id', - PRIMARY KEY (`id`), - CONSTRAINT `fk_netapp_lun__volume_id` FOREIGN KEY `fk_netapp_lun__volume_id` (`volume_id`) REFERENCES `netapp_volume` (`id`) ON DELETE CASCADE, - INDEX `i_netapp_lun__volume_id`(`volume_id`), - INDEX `i_netapp_lun__lun_name`(`lun_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - ---; --- Cleanup usage records for bug # 10727; ---; - - -create table `cloud_usage`.`temp_usage` ( `vol_id` bigint unsigned, `created` DATETIME); - -insert into `cloud_usage`.`temp_usage` (vol_id, created) select id, max(created) from `cloud_usage`.`usage_volume` where deleted is null group by id having count(id) > 1; - -delete `cloud_usage`.`usage_volume` from `cloud_usage`.`usage_volume` inner join `cloud_usage`.`temp_usage` where `cloud_usage`.`usage_volume`.created = `cloud_usage`.`temp_usage`.created and `cloud_usage`.`usage_volume`.id = `cloud_usage`.`temp_usage`.vol_id and `cloud_usage`.`usage_volume`.deleted is null; - -drop table `cloud_usage`.`temp_usage`; - -update `cloud_usage`.`cloud_usage` set raw_usage = (raw_usage % 24) where usage_type =6 and raw_usage > 24 and (raw_usage % 24) <> 0; -update `cloud_usage`.`cloud_usage` set raw_usage = 24 where usage_type =6 and raw_usage > 24 and (raw_usage % 24) = 0; - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.2.7 to 2.2.8; +--; +CREATE TABLE IF NOT EXISTS `cloud`.`netapp_pool` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', + `name` varchar(255) NOT NULL UNIQUE COMMENT 'name for the pool', + `algorithm` varchar(255) NOT NULL COMMENT 'algorithm', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE IF NOT EXISTS `cloud`.`netapp_volume` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', + `ip_address` varchar(255) NOT NULL COMMENT 'ip address/fqdn of the volume', + `pool_id` bigint unsigned NOT NULL COMMENT 'id for the pool', + `pool_name` varchar(255) NOT NULL COMMENT 'name for the pool', + `aggregate_name` varchar(255) NOT NULL COMMENT 'name for the aggregate', + `volume_name` varchar(255) NOT NULL COMMENT 'name for the volume', + `volume_size` varchar(255) NOT NULL COMMENT 'volume size', + `snapshot_policy` varchar(255) NOT NULL COMMENT 'snapshot policy', + `snapshot_reservation` int NOT NULL COMMENT 'snapshot reservation', + `username` varchar(255) NOT NULL COMMENT 'username', + `password` varchar(200) COMMENT 'password', + `round_robin_marker` int COMMENT 'This marks the volume to be picked up for lun creation, RR fashion', + PRIMARY KEY (`ip_address`,`aggregate_name`,`volume_name`), + CONSTRAINT `fk_netapp_volume__pool_id` FOREIGN KEY `fk_netapp_volume__pool_id` (`pool_id`) REFERENCES `netapp_pool` (`id`) ON DELETE CASCADE, + INDEX `i_netapp_volume__pool_id`(`pool_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE IF NOT EXISTS `cloud`.`netapp_lun` ( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id', + `lun_name` varchar(255) NOT NULL COMMENT 'lun name', + `target_iqn` varchar(255) NOT NULL COMMENT 'target iqn', + `path` varchar(255) NOT NULL COMMENT 'lun path', + `size` bigint NOT NULL COMMENT 'lun size', + `volume_id` bigint unsigned NOT NULL COMMENT 'parent volume id', + PRIMARY KEY (`id`), + CONSTRAINT `fk_netapp_lun__volume_id` FOREIGN KEY `fk_netapp_lun__volume_id` (`volume_id`) REFERENCES `netapp_volume` (`id`) ON DELETE CASCADE, + INDEX `i_netapp_lun__volume_id`(`volume_id`), + INDEX `i_netapp_lun__lun_name`(`lun_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +--; +-- Cleanup usage records for bug # 10727; +--; + + +create table `cloud_usage`.`temp_usage` ( `vol_id` bigint unsigned, `created` DATETIME); + +insert into `cloud_usage`.`temp_usage` (vol_id, created) select id, max(created) from `cloud_usage`.`usage_volume` where deleted is null group by id having count(id) > 1; + +delete `cloud_usage`.`usage_volume` from `cloud_usage`.`usage_volume` inner join `cloud_usage`.`temp_usage` where `cloud_usage`.`usage_volume`.created = `cloud_usage`.`temp_usage`.created and `cloud_usage`.`usage_volume`.id = `cloud_usage`.`temp_usage`.vol_id and `cloud_usage`.`usage_volume`.deleted is null; + +drop table `cloud_usage`.`temp_usage`; + +update `cloud_usage`.`cloud_usage` set raw_usage = (raw_usage % 24) where usage_type =6 and raw_usage > 24 and (raw_usage % 24) <> 0; +update `cloud_usage`.`cloud_usage` set raw_usage = 24 where usage_type =6 and raw_usage > 24 and (raw_usage % 24) = 0; + diff --git a/setup/db/db/schema-227to228.sql b/setup/db/db/schema-227to228.sql index 8e4c13b2749..ea344d7b65e 100644 --- a/setup/db/db/schema-227to228.sql +++ b/setup/db/db/schema-227to228.sql @@ -1,163 +1,168 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.2.7 to 2.2.8; ---; - -ALTER TABLE `cloud`.`mshost` ADD COLUMN `runid` bigint NOT NULL DEFAULT 0 COMMENT 'run id, combined with msid to form a cluster session'; -ALTER TABLE `cloud`.`mshost` ADD COLUMN `state` varchar(10) NOT NULL default 'Down'; -ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `limit_cpu_use` tinyint(1) NOT NULL DEFAULT 0 ; -ALTER TABLE `cloud`.`service_offering` ADD COLUMN `limit_cpu_use` tinyint(1) NOT NULL DEFAULT 0 ; -ALTER TABLE `cloud`.`service_offering` ADD COLUMN `default_use` tinyint(1) NOT NULL DEFAULT 0 ; -ALTER TABLE `cloud`.`service_offering` ADD COLUMN `vm_type` varchar(32) COMMENT 'type of offering specified for system offerings'; -ALTER TABLE `cloud`.`storage_pool` MODIFY `host_address` varchar(255) NOT NULL; - -DROP TABLE IF EXISTS `cloud`.`certificate`; -CREATE TABLE IF NOT EXISTS `cloud`.`keystore` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `name` varchar(64) NOT NULL COMMENT 'unique name for the certifiation', - `certificate` text NOT NULL COMMENT 'the actual certificate being stored in the db', - `key` text NOT NULL COMMENT 'private key associated wih the certificate', - `domain_suffix` varchar(256) NOT NULL COMMENT 'DNS domain suffix associated with the certificate', - PRIMARY KEY (`id`), - UNIQUE(name) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `cloud`.`cmd_exec_log` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `host_id` bigint unsigned NOT NULL COMMENT 'host id of the system VM agent that command is sent to', - `instance_id` bigint unsigned NOT NULL COMMENT 'instance id of the system VM that command is executed on', - `command_name` varchar(255) NOT NULL COMMENT 'command name', - `weight` integer NOT NULL DEFAULT 1 COMMENT 'command weight in consideration of the load factor added to host that is executing the command', - `created` datetime NOT NULL COMMENT 'date created', - PRIMARY KEY (`id`), - INDEX `i_cmd_exec_log__host_id`(`host_id`), - INDEX `i_cmd_exec_log__instance_id`(`instance_id`), - CONSTRAINT `fk_cmd_exec_log_ref__inst_id` FOREIGN KEY (`instance_id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `cloud`.`network_tags` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `network_id` bigint unsigned NOT NULL COMMENT 'id of the network', - `tag` varchar(255) NOT NULL COMMENT 'tag', - PRIMARY KEY (`id`), - CONSTRAINT `fk_network_tags__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`), - UNIQUE KEY(`network_id`, `tag`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `cloud`.`firewall_rules_cidrs` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `firewall_rule_id` bigint(20) unsigned NOT NULL COMMENT 'firewall rule id', - `source_cidr` varchar(18) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `fk_firewall_cidrs_firewall_rules` (`firewall_rule_id`), - CONSTRAINT `fk_firewall_cidrs_firewall_rules` FOREIGN KEY (`firewall_rule_id`) REFERENCES `firewall_rules` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `role` varchar(64) NOT NULL DEFAULT 'templateProcessor'; - -INSERT INTO `cloud`.`configuration` (category, instance, component, name, value, description) VALUES ('Network', 'DEFAULT', 'management-server', 'vm.network.throttling.rate', 200, 'Default data transfer rate in megabits per second allowed in user vm\'s default network.'); - -DELETE FROM `cloud`.`configuration` where name='guest.ip.network'; -DELETE FROM `cloud`.`configuration` where name='guest.netmask'; - -ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `removed` datetime COMMENT 'date removed if not null'; -ALTER TABLE `cloud`.`host_pod_ref` MODIFY `name` varchar(255); - -ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `external_dhcp` tinyint NOT NULL DEFAULT 0 COMMENT 'Is this Pod using external DHCP'; - - -ALTER TABLE `cloud`.`security_group` DROP COLUMN `account_name`; - -ALTER TABLE `cloud`.`security_ingress_rule` DROP COLUMN `allowed_security_group`; -ALTER TABLE `cloud`.`security_ingress_rule` DROP COLUMN `allowed_sec_grp_acct`; - -ALTER TABLE `cloud`.`data_center` ADD COLUMN `zone_token` varchar(255); -ALTER TABLE `cloud`.`data_center` ADD INDEX `i_data_center__zone_token`(`zone_token`); - -ALTER TABLE `cloud`.`vm_template` ADD COLUMN `source_template_id` bigint unsigned COMMENT 'Id of the original template, if this template is created from snapshot'; - -ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` ADD INDEX `i_op_dc_link_local_ip_address_alloc__pod_id`(`pod_id`); -ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` ADD INDEX `i_op_dc_link_local_ip_address_alloc__data_center_id`(`data_center_id`); -ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` ADD INDEX `i_op_dc_link_local_ip_address_alloc__nic_id_reservation_id`(`nic_id`,`reservation_id`); - -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (139, 7, 'Other PV (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (140, 7, 'Other PV (64-bit)'); - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other PV (32-bit)', 139); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other PV (64-bit)', 140); - -ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `shared_source_nat_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if the network offering provides the shared source nat service'; - -CREATE TABLE IF NOT EXISTS `cloud`.`op_host_transfer` ( - `id` bigint unsigned UNIQUE NOT NULL COMMENT 'Id of the host', - `initial_mgmt_server_id` bigint unsigned COMMENT 'management server the host is transfered from', - `future_mgmt_server_id` bigint unsigned COMMENT 'management server the host is transfered to', - `state` varchar(32) NOT NULL COMMENT 'the transfer state of the host', - `created` datetime NOT NULL COMMENT 'date created', - PRIMARY KEY (`id`), - CONSTRAINT `fk_op_host_transfer__id` FOREIGN KEY `fk_op_host_transfer__id` (`id`) REFERENCES `host` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_op_host_transfer__initial_mgmt_server_id` FOREIGN KEY `fk_op_host_transfer__initial_mgmt_server_id`(`initial_mgmt_server_id`) REFERENCES `mshost`(`msid`), - CONSTRAINT `fk_op_host_transfer__future_mgmt_server_id` FOREIGN KEY `fk_op_host_transfer__future_mgmt_server_id`(`future_mgmt_server_id`) REFERENCES `mshost`(`msid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -ALTER TABLE `cloud`.`snapshots` ADD COLUMN `swift_id` bigint unsigned; -ALTER TABLE `cloud`.`snapshots` ADD COLUMN `swift_name` varchar(255); -ALTER TABLE `cloud`.`snapshots` ADD COLUMN `sechost_id` bigint unsigned; - - -CREATE TABLE IF NOT EXISTS `cloud`.`swift` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `hostname` varchar(255), - `account` varchar(255) COMMENT ' account in swift', - `username` varchar(255) COMMENT ' username in swift', - `token` varchar(255) COMMENT 'token for this user', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `vm_type` varchar(32) NOT NULL; -UPDATE vm_instance set vm_type=type; - -ALTER TABLE `cloud`.`networks` ADD COLUMN `is_domain_specific` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if network is domain specific, 0 false otherwise'; -INSERT INTO configuration (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'allow.subdomain.network.access', 'true', 'Allow subdomains to use networks dedicated to their parent domain(s)'); - -INSERT INTO configuration (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'management-server', 'encode.api.response', 'false', 'Do UTF-8 encoding for the api response, false by default'); - - -DELETE FROM load_balancer_vm_map WHERE instance_id IN (SELECT id FROM vm_instance WHERE removed IS NOT NULL); - -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'hypervisor.list', 'KVM,XenServer,VMware,BareMetal', 'The list of hypervisors that this deployment will use.'); - - -UPDATE IGNORE configuration set name='guest.domain.suffix' where name='domain.suffix'; -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'guest.domain.suffix', 'cloud.internal', 'Default domain name for vms inside virtualized networks fronted by router'); -DELETE FROM configuration WHERE name='domain.suffix'; - -ALTER TABLE `cloud`.`user` ADD COLUMN `registration_token` varchar(255) default NULL; -ALTER TABLE `cloud`.`user` ADD COLUMN `is_registered` tinyint NOT NULL DEFAULT 0; -ALTER TABLE `cloud`.`data_center` ADD COLUMN `removed` datetime; - -CREATE INDEX `i_op_lock__mac_ip_thread` on `op_lock` (`mac`, `ip`, `thread`); - -UPDATE `cloud`.`mshost` set removed=NULL where removed IS NOT NULL; - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.management.portgroup', 'Management Network', 'Specify the management network name(for ESXi hosts)'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.additional.vnc.portrange.start', '59000', 'Start port number of additional VNC port range'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.additional.vnc.portrange.size', '1000', 'Start port number of additional VNC port range'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Console Proxy', 'DEFAULT', 'AgentManager', 'consoleproxy.management.state', 'Auto', 'console proxy service management state'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Console Proxy', 'DEFAULT', 'AgentManager', 'consoleproxy.management.state.last', 'Auto', 'last console proxy service management state'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'cluster.message.timeout.seconds', '300', 'Time (in seconds) to wait before a inter-management server message post times out.'); - - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.2.7 to 2.2.8; +--; + +ALTER TABLE `cloud`.`mshost` ADD COLUMN `runid` bigint NOT NULL DEFAULT 0 COMMENT 'run id, combined with msid to form a cluster session'; +ALTER TABLE `cloud`.`mshost` ADD COLUMN `state` varchar(10) NOT NULL default 'Down'; +ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `limit_cpu_use` tinyint(1) NOT NULL DEFAULT 0 ; +ALTER TABLE `cloud`.`service_offering` ADD COLUMN `limit_cpu_use` tinyint(1) NOT NULL DEFAULT 0 ; +ALTER TABLE `cloud`.`service_offering` ADD COLUMN `default_use` tinyint(1) NOT NULL DEFAULT 0 ; +ALTER TABLE `cloud`.`service_offering` ADD COLUMN `vm_type` varchar(32) COMMENT 'type of offering specified for system offerings'; +ALTER TABLE `cloud`.`storage_pool` MODIFY `host_address` varchar(255) NOT NULL; + +DROP TABLE IF EXISTS `cloud`.`certificate`; +CREATE TABLE IF NOT EXISTS `cloud`.`keystore` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `name` varchar(64) NOT NULL COMMENT 'unique name for the certifiation', + `certificate` text NOT NULL COMMENT 'the actual certificate being stored in the db', + `key` text NOT NULL COMMENT 'private key associated wih the certificate', + `domain_suffix` varchar(256) NOT NULL COMMENT 'DNS domain suffix associated with the certificate', + PRIMARY KEY (`id`), + UNIQUE(name) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `cloud`.`cmd_exec_log` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `host_id` bigint unsigned NOT NULL COMMENT 'host id of the system VM agent that command is sent to', + `instance_id` bigint unsigned NOT NULL COMMENT 'instance id of the system VM that command is executed on', + `command_name` varchar(255) NOT NULL COMMENT 'command name', + `weight` integer NOT NULL DEFAULT 1 COMMENT 'command weight in consideration of the load factor added to host that is executing the command', + `created` datetime NOT NULL COMMENT 'date created', + PRIMARY KEY (`id`), + INDEX `i_cmd_exec_log__host_id`(`host_id`), + INDEX `i_cmd_exec_log__instance_id`(`instance_id`), + CONSTRAINT `fk_cmd_exec_log_ref__inst_id` FOREIGN KEY (`instance_id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `cloud`.`network_tags` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `network_id` bigint unsigned NOT NULL COMMENT 'id of the network', + `tag` varchar(255) NOT NULL COMMENT 'tag', + PRIMARY KEY (`id`), + CONSTRAINT `fk_network_tags__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`), + UNIQUE KEY(`network_id`, `tag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `cloud`.`firewall_rules_cidrs` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `firewall_rule_id` bigint(20) unsigned NOT NULL COMMENT 'firewall rule id', + `source_cidr` varchar(18) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `fk_firewall_cidrs_firewall_rules` (`firewall_rule_id`), + CONSTRAINT `fk_firewall_cidrs_firewall_rules` FOREIGN KEY (`firewall_rule_id`) REFERENCES `firewall_rules` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +ALTER TABLE `cloud`.`secondary_storage_vm` ADD COLUMN `role` varchar(64) NOT NULL DEFAULT 'templateProcessor'; + +INSERT INTO `cloud`.`configuration` (category, instance, component, name, value, description) VALUES ('Network', 'DEFAULT', 'management-server', 'vm.network.throttling.rate', 200, 'Default data transfer rate in megabits per second allowed in user vm\'s default network.'); + +DELETE FROM `cloud`.`configuration` where name='guest.ip.network'; +DELETE FROM `cloud`.`configuration` where name='guest.netmask'; + +ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `removed` datetime COMMENT 'date removed if not null'; +ALTER TABLE `cloud`.`host_pod_ref` MODIFY `name` varchar(255); + +ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `external_dhcp` tinyint NOT NULL DEFAULT 0 COMMENT 'Is this Pod using external DHCP'; + + +ALTER TABLE `cloud`.`security_group` DROP COLUMN `account_name`; + +ALTER TABLE `cloud`.`security_ingress_rule` DROP COLUMN `allowed_security_group`; +ALTER TABLE `cloud`.`security_ingress_rule` DROP COLUMN `allowed_sec_grp_acct`; + +ALTER TABLE `cloud`.`data_center` ADD COLUMN `zone_token` varchar(255); +ALTER TABLE `cloud`.`data_center` ADD INDEX `i_data_center__zone_token`(`zone_token`); + +ALTER TABLE `cloud`.`vm_template` ADD COLUMN `source_template_id` bigint unsigned COMMENT 'Id of the original template, if this template is created from snapshot'; + +ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` ADD INDEX `i_op_dc_link_local_ip_address_alloc__pod_id`(`pod_id`); +ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` ADD INDEX `i_op_dc_link_local_ip_address_alloc__data_center_id`(`data_center_id`); +ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` ADD INDEX `i_op_dc_link_local_ip_address_alloc__nic_id_reservation_id`(`nic_id`,`reservation_id`); + +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (139, 7, 'Other PV (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (140, 7, 'Other PV (64-bit)'); + +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other PV (32-bit)', 139); +INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other PV (64-bit)', 140); + +ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `shared_source_nat_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if the network offering provides the shared source nat service'; + +CREATE TABLE IF NOT EXISTS `cloud`.`op_host_transfer` ( + `id` bigint unsigned UNIQUE NOT NULL COMMENT 'Id of the host', + `initial_mgmt_server_id` bigint unsigned COMMENT 'management server the host is transfered from', + `future_mgmt_server_id` bigint unsigned COMMENT 'management server the host is transfered to', + `state` varchar(32) NOT NULL COMMENT 'the transfer state of the host', + `created` datetime NOT NULL COMMENT 'date created', + PRIMARY KEY (`id`), + CONSTRAINT `fk_op_host_transfer__id` FOREIGN KEY `fk_op_host_transfer__id` (`id`) REFERENCES `host` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_op_host_transfer__initial_mgmt_server_id` FOREIGN KEY `fk_op_host_transfer__initial_mgmt_server_id`(`initial_mgmt_server_id`) REFERENCES `mshost`(`msid`), + CONSTRAINT `fk_op_host_transfer__future_mgmt_server_id` FOREIGN KEY `fk_op_host_transfer__future_mgmt_server_id`(`future_mgmt_server_id`) REFERENCES `mshost`(`msid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +ALTER TABLE `cloud`.`snapshots` ADD COLUMN `swift_id` bigint unsigned; +ALTER TABLE `cloud`.`snapshots` ADD COLUMN `swift_name` varchar(255); +ALTER TABLE `cloud`.`snapshots` ADD COLUMN `sechost_id` bigint unsigned; + + +CREATE TABLE IF NOT EXISTS `cloud`.`swift` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `hostname` varchar(255), + `account` varchar(255) COMMENT ' account in swift', + `username` varchar(255) COMMENT ' username in swift', + `token` varchar(255) COMMENT 'token for this user', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `vm_type` varchar(32) NOT NULL; +UPDATE vm_instance set vm_type=type; + +ALTER TABLE `cloud`.`networks` ADD COLUMN `is_domain_specific` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if network is domain specific, 0 false otherwise'; +INSERT INTO configuration (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'allow.subdomain.network.access', 'true', 'Allow subdomains to use networks dedicated to their parent domain(s)'); + +INSERT INTO configuration (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'management-server', 'encode.api.response', 'false', 'Do UTF-8 encoding for the api response, false by default'); + + +DELETE FROM load_balancer_vm_map WHERE instance_id IN (SELECT id FROM vm_instance WHERE removed IS NOT NULL); + +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'hypervisor.list', 'KVM,XenServer,VMware,BareMetal', 'The list of hypervisors that this deployment will use.'); + + +UPDATE IGNORE configuration set name='guest.domain.suffix' where name='domain.suffix'; +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'guest.domain.suffix', 'cloud.internal', 'Default domain name for vms inside virtualized networks fronted by router'); +DELETE FROM configuration WHERE name='domain.suffix'; + +ALTER TABLE `cloud`.`user` ADD COLUMN `registration_token` varchar(255) default NULL; +ALTER TABLE `cloud`.`user` ADD COLUMN `is_registered` tinyint NOT NULL DEFAULT 0; +ALTER TABLE `cloud`.`data_center` ADD COLUMN `removed` datetime; + +CREATE INDEX `i_op_lock__mac_ip_thread` on `op_lock` (`mac`, `ip`, `thread`); + +UPDATE `cloud`.`mshost` set removed=NULL where removed IS NOT NULL; + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.management.portgroup', 'Management Network', 'Specify the management network name(for ESXi hosts)'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.additional.vnc.portrange.start', '59000', 'Start port number of additional VNC port range'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.additional.vnc.portrange.size', '1000', 'Start port number of additional VNC port range'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Console Proxy', 'DEFAULT', 'AgentManager', 'consoleproxy.management.state', 'Auto', 'console proxy service management state'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Console Proxy', 'DEFAULT', 'AgentManager', 'consoleproxy.management.state.last', 'Auto', 'last console proxy service management state'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'cluster.message.timeout.seconds', '300', 'Time (in seconds) to wait before a inter-management server message post times out.'); + + diff --git a/setup/db/db/schema-228to229.sql b/setup/db/db/schema-228to229.sql index dc17c067e99..97791fcb006 100644 --- a/setup/db/db/schema-228to229.sql +++ b/setup/db/db/schema-228to229.sql @@ -1,91 +1,96 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.2.8 to 2.2.9; ---; - -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'network.dns.basiczone.updates', 'all', 'This parameter can take 2 values: all (default) and pod. It defines if DHCP/DNS requests have to be send to all dhcp servers in cloudstack, or only to the one in the same pod'); - -ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__pod_id`; -ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__data_center_id`; -ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__cluster_id`; - -ALTER TABLE `cloud`.`firewall_rules_cidrs` ADD UNIQUE INDEX `unique_rule_cidrs` (`firewall_rule_id`, `source_cidr`); -ALTER TABLE `cloud`.`firewall_rules` ADD INDEX `i_firewall_rules__purpose` (`purpose`); - -ALTER TABLE `cloud`.`cluster` ADD INDEX `i_cluster__removed`(`removed`); -ALTER TABLE `cloud`.`data_center` ADD INDEX `i_data_center__removed`(`removed`); -ALTER TABLE `cloud`.`host_pod_ref` ADD INDEX `i_host_pod_ref__removed`(`removed`); - -ALTER TABLE `cloud`.`mshost` ADD INDEX `i_mshost__removed`(`removed`); -ALTER TABLE `cloud`.`mshost` ADD INDEX `i_mshost__last_update` (`last_update`); - -ALTER TABLE `cloud`.`template_zone_ref` ADD INDEX `i_template_zone_ref__removed`(`removed`); -ALTER TABLE `cloud`.`domain` ADD INDEX `i_domain__removed`(`removed`); -ALTER TABLE `cloud`.`disk_offering` ADD INDEX `i_disk_offering__removed`(`removed`); -ALTER TABLE `cloud`.`storage_pool` ADD INDEX `i_storage_pool__removed`(`removed`); -ALTER TABLE `cloud`.`instance_group` ADD INDEX `i_instance_group__removed`(`removed`); - -ALTER TABLE `cloud`.`sync_queue_item` ADD INDEX `i_sync_queue_item__queue_proc_number`(`queue_proc_number`); -ALTER TABLE `cloud`.`sync_queue_item` ADD INDEX `i_sync_queue_item__queue_proc_msid`(`queue_proc_msid`); -ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__taken`(`taken`); -ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__step`(`step`); -ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__seq_no`(`seq_no`); -ALTER TABLE `cloud`.`volumes` ADD INDEX `i_volumes__state`(`state`); - -ALTER TABLE `cloud`.`op_vm_ruleset_log` ADD INDEX `i_op_vm_ruleset_log__instance_id` (`instance_id`); - -ALTER TABLE `cloud`.`storage_pool_host_ref` ADD CONSTRAINT `fk_storage_pool_host_ref__host_id` FOREIGN KEY `fk_storage_pool_host_ref__host_id`(`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`storage_pool_host_ref` ADD CONSTRAINT `fk_storage_pool_host_ref__pool_id` FOREIGN KEY `fk_storage_pool_host_ref__pool_id`(`pool_id`) REFERENCES `storage_pool`(`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`network_offerings` ADD INDEX `i_network_offerings__system_only` (`system_only`); -ALTER TABLE `cloud`.`resource_count` ADD CONSTRAINT `fk_resource_count__account_id` FOREIGN KEY `fk_resource_count__account_id`(`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`resource_count` ADD CONSTRAINT `fk_resource_count__domain_id` FOREIGN KEY `fk_resource_count__domain_id`(`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`resource_count` ADD INDEX `i_resource_count__type` (`type`); - -ALTER TABLE `cloud`.`configuration` ADD INDEX `i_configuration__instance`(`instance`); -ALTER TABLE `cloud`.`configuration` ADD INDEX `i_configuration__name` (`name`); -ALTER TABLE `cloud`.`configuration` ADD INDEX `i_configuration__category` (`category`); -ALTER TABLE `cloud`.`configuration` ADD INDEX `i_configuration__component` (`component`); - -ALTER TABLE `cloud`.`port_forwarding_rules` ADD CONSTRAINT `fk_port_forwarding_rules__instance_id` FOREIGN KEY `fk_port_forwarding_rules__instance_id` (`instance_id`) REFERENCES `vm_instance` (`id`) ON DELETE CASCADE; - -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.load.threshold', '0.70', 'Percentage (as a value between 0 and 1) of connected agents after which agent load balancing will start happening'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.visibility', 'global', 'Load Balancer(haproxy) stats visibilty, it can take the following four parameters : global,guest-network,link-local,disabled'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.uri','/admin?stats','Load Balancer(haproxy) uri.'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authetication string in the format username:password'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.port','8081','Load Balancer(haproxy) stats port number.'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass the cloudstack DHCP/DNS server vm name service, use zone external dns1 and dns2'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.enabled', 'false', 'Whether the load balancing service is enabled for basic zones'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.gc.interval.minutes', '120', 'Garbage collection interval to destroy unused ELB vms in minutes. Minimum of 5'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.network', 'guest', 'Whether the elastic load balancing service public ips are taken from the public or guest network'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.cpu.mhz', '128', 'CPU speed for the elastic load balancer vm'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.ram.size', '128', 'Memory in MB for the elastic load balancer vm'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.vcpu.num', '1', 'Number of VCPU for the elastic load balancer vm'); - -UPDATE `cloud`.`nics` SET strategy='Start' where reserver_name='DirectPodBasedNetworkGuru'; -UPDATE `cloud`.`network_offerings` SET lb_service=1 where unique_name='System-Guest-Network'; - - -CREATE TABLE `cloud`.`elastic_lb_vm_map` ( - `id` bigint unsigned NOT NULL auto_increment, - `ip_addr_id` bigint unsigned NOT NULL, - `elb_vm_id` bigint unsigned NOT NULL, - `lb_id` bigint unsigned, - PRIMARY KEY (`id`), - CONSTRAINT `fk_elastic_lb_vm_map__ip_id` FOREIGN KEY `fk_elastic_lb_vm_map__ip_id` (`ip_addr_id`) REFERENCES `user_ip_address` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_elastic_lb_vm_map__elb_vm_id` FOREIGN KEY `fk_elastic_lb_vm_map__elb_vm_id` (`elb_vm_id`) REFERENCES `vm_instance` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_elastic_lb_vm_map__lb_id` FOREIGN KEY `fk_elastic_lb_vm_map__lb_id` (`lb_id`) REFERENCES `load_balancing_rules` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.2.8 to 2.2.9; +--; + +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'network.dns.basiczone.updates', 'all', 'This parameter can take 2 values: all (default) and pod. It defines if DHCP/DNS requests have to be send to all dhcp servers in cloudstack, or only to the one in the same pod'); + +ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__pod_id`; +ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__data_center_id`; +ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__cluster_id`; + +ALTER TABLE `cloud`.`firewall_rules_cidrs` ADD UNIQUE INDEX `unique_rule_cidrs` (`firewall_rule_id`, `source_cidr`); +ALTER TABLE `cloud`.`firewall_rules` ADD INDEX `i_firewall_rules__purpose` (`purpose`); + +ALTER TABLE `cloud`.`cluster` ADD INDEX `i_cluster__removed`(`removed`); +ALTER TABLE `cloud`.`data_center` ADD INDEX `i_data_center__removed`(`removed`); +ALTER TABLE `cloud`.`host_pod_ref` ADD INDEX `i_host_pod_ref__removed`(`removed`); + +ALTER TABLE `cloud`.`mshost` ADD INDEX `i_mshost__removed`(`removed`); +ALTER TABLE `cloud`.`mshost` ADD INDEX `i_mshost__last_update` (`last_update`); + +ALTER TABLE `cloud`.`template_zone_ref` ADD INDEX `i_template_zone_ref__removed`(`removed`); +ALTER TABLE `cloud`.`domain` ADD INDEX `i_domain__removed`(`removed`); +ALTER TABLE `cloud`.`disk_offering` ADD INDEX `i_disk_offering__removed`(`removed`); +ALTER TABLE `cloud`.`storage_pool` ADD INDEX `i_storage_pool__removed`(`removed`); +ALTER TABLE `cloud`.`instance_group` ADD INDEX `i_instance_group__removed`(`removed`); + +ALTER TABLE `cloud`.`sync_queue_item` ADD INDEX `i_sync_queue_item__queue_proc_number`(`queue_proc_number`); +ALTER TABLE `cloud`.`sync_queue_item` ADD INDEX `i_sync_queue_item__queue_proc_msid`(`queue_proc_msid`); +ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__taken`(`taken`); +ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__step`(`step`); +ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__seq_no`(`seq_no`); +ALTER TABLE `cloud`.`volumes` ADD INDEX `i_volumes__state`(`state`); + +ALTER TABLE `cloud`.`op_vm_ruleset_log` ADD INDEX `i_op_vm_ruleset_log__instance_id` (`instance_id`); + +ALTER TABLE `cloud`.`storage_pool_host_ref` ADD CONSTRAINT `fk_storage_pool_host_ref__host_id` FOREIGN KEY `fk_storage_pool_host_ref__host_id`(`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`storage_pool_host_ref` ADD CONSTRAINT `fk_storage_pool_host_ref__pool_id` FOREIGN KEY `fk_storage_pool_host_ref__pool_id`(`pool_id`) REFERENCES `storage_pool`(`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`network_offerings` ADD INDEX `i_network_offerings__system_only` (`system_only`); +ALTER TABLE `cloud`.`resource_count` ADD CONSTRAINT `fk_resource_count__account_id` FOREIGN KEY `fk_resource_count__account_id`(`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`resource_count` ADD CONSTRAINT `fk_resource_count__domain_id` FOREIGN KEY `fk_resource_count__domain_id`(`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`resource_count` ADD INDEX `i_resource_count__type` (`type`); + +ALTER TABLE `cloud`.`configuration` ADD INDEX `i_configuration__instance`(`instance`); +ALTER TABLE `cloud`.`configuration` ADD INDEX `i_configuration__name` (`name`); +ALTER TABLE `cloud`.`configuration` ADD INDEX `i_configuration__category` (`category`); +ALTER TABLE `cloud`.`configuration` ADD INDEX `i_configuration__component` (`component`); + +ALTER TABLE `cloud`.`port_forwarding_rules` ADD CONSTRAINT `fk_port_forwarding_rules__instance_id` FOREIGN KEY `fk_port_forwarding_rules__instance_id` (`instance_id`) REFERENCES `vm_instance` (`id`) ON DELETE CASCADE; + +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.load.threshold', '0.70', 'Percentage (as a value between 0 and 1) of connected agents after which agent load balancing will start happening'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.visibility', 'global', 'Load Balancer(haproxy) stats visibilty, it can take the following four parameters : global,guest-network,link-local,disabled'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.uri','/admin?stats','Load Balancer(haproxy) uri.'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authetication string in the format username:password'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.port','8081','Load Balancer(haproxy) stats port number.'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass the cloudstack DHCP/DNS server vm name service, use zone external dns1 and dns2'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.enabled', 'false', 'Whether the load balancing service is enabled for basic zones'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.gc.interval.minutes', '120', 'Garbage collection interval to destroy unused ELB vms in minutes. Minimum of 5'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.network', 'guest', 'Whether the elastic load balancing service public ips are taken from the public or guest network'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.cpu.mhz', '128', 'CPU speed for the elastic load balancer vm'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.ram.size', '128', 'Memory in MB for the elastic load balancer vm'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.vcpu.num', '1', 'Number of VCPU for the elastic load balancer vm'); + +UPDATE `cloud`.`nics` SET strategy='Start' where reserver_name='DirectPodBasedNetworkGuru'; +UPDATE `cloud`.`network_offerings` SET lb_service=1 where unique_name='System-Guest-Network'; + + +CREATE TABLE `cloud`.`elastic_lb_vm_map` ( + `id` bigint unsigned NOT NULL auto_increment, + `ip_addr_id` bigint unsigned NOT NULL, + `elb_vm_id` bigint unsigned NOT NULL, + `lb_id` bigint unsigned, + PRIMARY KEY (`id`), + CONSTRAINT `fk_elastic_lb_vm_map__ip_id` FOREIGN KEY `fk_elastic_lb_vm_map__ip_id` (`ip_addr_id`) REFERENCES `user_ip_address` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_elastic_lb_vm_map__elb_vm_id` FOREIGN KEY `fk_elastic_lb_vm_map__elb_vm_id` (`elb_vm_id`) REFERENCES `vm_instance` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_elastic_lb_vm_map__lb_id` FOREIGN KEY `fk_elastic_lb_vm_map__lb_id` (`lb_id`) REFERENCES `load_balancing_rules` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + diff --git a/setup/db/db/schema-229to2210.sql b/setup/db/db/schema-229to2210.sql index 98f5881fb5c..86224ba0f58 100644 --- a/setup/db/db/schema-229to2210.sql +++ b/setup/db/db/schema-229to2210.sql @@ -1,76 +1,81 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 ---; --- Schema upgrade from 2.2.9 to 2.2.10; ---; - -ALTER TABLE `cloud`.`account` ADD COLUMN `network_domain` varchar(255); -ALTER TABLE `cloud`.`domain` ADD COLUMN `network_domain` varchar(255); - -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass internal dns, use exetrnal dns1 and dns2'); - -ALTER TABLE `cloud`.`domain_router` ADD COLUMN `is_redundant_router` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'if in redundant router mode'; -ALTER TABLE `cloud`.`domain_router` ADD COLUMN `priority` int(4) unsigned COMMENT 'priority of router in the redundant router mode'; -ALTER TABLE `cloud`.`domain_router` ADD COLUMN `redundant_state` varchar(64) NOT NULL DEFAULT 'UNKNOWN' COMMENT 'the state of redundant virtual router'; - -ALTER TABLE `cloud`.`cluster` ADD COLUMN `managed_state` varchar(32) NOT NULL DEFAULT 'Managed' COMMENT 'Is this cluster managed by cloudstack'; - -ALTER TABLE `cloud`.`host` MODIFY `storage_ip_address` char(40); - -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.redundantrouter', 'false', 'enable/disable redundant virtual router'); -INSERT IGNORE INTO configuration VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.pool.max.waitseconds', '3600', 'Timeout (in seconds) to synchronize storage pool operations.'); -INSERT IGNORE INTO configuration VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.template.cleanup.enabled', 'true', 'Enable/disable template cleanup activity, only take effect when overall storage cleanup is enabled'); - -ALTER TABLE `cloud`.`firewall_rules` ADD COLUMN `icmp_code` int(10) COMMENT 'The ICMP code (if protocol=ICMP). A value of -1 means all codes for the given ICMP type.'; -ALTER TABLE `cloud`.`firewall_rules` ADD COLUMN `icmp_type` int(10) COMMENT 'The ICMP type (if protocol=ICMP). A value of -1 means all types.'; -ALTER TABLE `cloud`.`firewall_rules` ADD COLUMN `related` bigint unsigned COMMENT 'related to what other firewall rule'; -ALTER TABLE `cloud`.`firewall_rules` ADD CONSTRAINT `fk_firewall_rules__related` FOREIGN KEY(`related`) REFERENCES `firewall_rules`(`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`firewall_rules` MODIFY `start_port` int(10) COMMENT 'starting port of a port range'; -ALTER TABLE `cloud`.`firewall_rules` MODIFY `end_port` int(10) COMMENT 'end port of a port range'; - -INSERT IGNORE INTO `cloud`.`configuration` (category, instance, name, value, description) VALUES ('Network', 'DEFAULT', 'firewall.rule.ui.enabled', 'false', 'enable/disable UI that separates firewall rules from NAT/LB rules'); - - -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.load.threshold', '0.70', 'Percentage (as a value between 0 and 1) of connected agents after which agent load balancing will start happening'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.visibility', 'global', 'Load Balancer(haproxy) stats visibilty, it can take the following four parameters : global,guest-network,link-local,disabled'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.uri','/admin?stats','Load Balancer(haproxy) uri.'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authetication string in the format username:password'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.port','8081','Load Balancer(haproxy) stats port number.'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass the cloudstack DHCP/DNS server vm name service, use zone external dns1 and dns2'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.enabled', 'false', 'Whether the load balancing service is enabled for basic zones'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.gc.interval.minutes', '120', 'Garbage collection interval to destroy unused ELB vms in minutes. Minimum of 5'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.network', 'guest', 'Whether the elastic load balancing service public ips are taken from the public or guest network'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.cpu.mhz', '128', 'CPU speed for the elastic load balancer vm'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.ram.size', '128', 'Memory in MB for the elastic load balancer vm'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.vcpu.num', '1', 'Number of VCPU for the elastic load balancer vm'); - -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.reserve.mem', 'false', 'Specify whether or not to reserve memory based on memory overprovisioning factor'); -INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'mem.overprovisioning.factor', '1', 'Used for memory overprovisioning calculation'); - -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.psk.length', '24', 'The length of the ipsec preshared key (minimum 8, maximum 256)'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.client.iprange', '10.1.2.1-10.1.2.8', 'The range of ips to be allocated to remote access vpn clients. The first ip in the range is used by the VPN server'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.user.limit', '8', 'The maximum number of VPN users that can be created per account'); - -CREATE TABLE IF NOT exists `cloud`.`elastic_lb_vm_map` ( - `id` bigint unsigned NOT NULL auto_increment, - `ip_addr_id` bigint unsigned NOT NULL, - `elb_vm_id` bigint unsigned NOT NULL, - `lb_id` bigint unsigned, - PRIMARY KEY (`id`), - CONSTRAINT `fk_elastic_lb_vm_map__ip_id` FOREIGN KEY `fk_elastic_lb_vm_map__ip_id` (`ip_addr_id`) REFERENCES `user_ip_address` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_elastic_lb_vm_map__elb_vm_id` FOREIGN KEY `fk_elastic_lb_vm_map__elb_vm_id` (`elb_vm_id`) REFERENCES `vm_instance` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_elastic_lb_vm_map__lb_id` FOREIGN KEY `fk_elastic_lb_vm_map__lb_id` (`lb_id`) REFERENCES `load_balancing_rules` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -UPDATE `cloud`.`network_offerings` SET lb_service=1 where unique_name='System-Guest-Network'; +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +--; +-- Schema upgrade from 2.2.9 to 2.2.10; +--; + +ALTER TABLE `cloud`.`account` ADD COLUMN `network_domain` varchar(255); +ALTER TABLE `cloud`.`domain` ADD COLUMN `network_domain` varchar(255); + +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass internal dns, use exetrnal dns1 and dns2'); + +ALTER TABLE `cloud`.`domain_router` ADD COLUMN `is_redundant_router` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'if in redundant router mode'; +ALTER TABLE `cloud`.`domain_router` ADD COLUMN `priority` int(4) unsigned COMMENT 'priority of router in the redundant router mode'; +ALTER TABLE `cloud`.`domain_router` ADD COLUMN `redundant_state` varchar(64) NOT NULL DEFAULT 'UNKNOWN' COMMENT 'the state of redundant virtual router'; + +ALTER TABLE `cloud`.`cluster` ADD COLUMN `managed_state` varchar(32) NOT NULL DEFAULT 'Managed' COMMENT 'Is this cluster managed by cloudstack'; + +ALTER TABLE `cloud`.`host` MODIFY `storage_ip_address` char(40); + +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.redundantrouter', 'false', 'enable/disable redundant virtual router'); +INSERT IGNORE INTO configuration VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.pool.max.waitseconds', '3600', 'Timeout (in seconds) to synchronize storage pool operations.'); +INSERT IGNORE INTO configuration VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.template.cleanup.enabled', 'true', 'Enable/disable template cleanup activity, only take effect when overall storage cleanup is enabled'); + +ALTER TABLE `cloud`.`firewall_rules` ADD COLUMN `icmp_code` int(10) COMMENT 'The ICMP code (if protocol=ICMP). A value of -1 means all codes for the given ICMP type.'; +ALTER TABLE `cloud`.`firewall_rules` ADD COLUMN `icmp_type` int(10) COMMENT 'The ICMP type (if protocol=ICMP). A value of -1 means all types.'; +ALTER TABLE `cloud`.`firewall_rules` ADD COLUMN `related` bigint unsigned COMMENT 'related to what other firewall rule'; +ALTER TABLE `cloud`.`firewall_rules` ADD CONSTRAINT `fk_firewall_rules__related` FOREIGN KEY(`related`) REFERENCES `firewall_rules`(`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`firewall_rules` MODIFY `start_port` int(10) COMMENT 'starting port of a port range'; +ALTER TABLE `cloud`.`firewall_rules` MODIFY `end_port` int(10) COMMENT 'end port of a port range'; + +INSERT IGNORE INTO `cloud`.`configuration` (category, instance, name, value, description) VALUES ('Network', 'DEFAULT', 'firewall.rule.ui.enabled', 'false', 'enable/disable UI that separates firewall rules from NAT/LB rules'); + + +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.load.threshold', '0.70', 'Percentage (as a value between 0 and 1) of connected agents after which agent load balancing will start happening'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.visibility', 'global', 'Load Balancer(haproxy) stats visibilty, it can take the following four parameters : global,guest-network,link-local,disabled'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.uri','/admin?stats','Load Balancer(haproxy) uri.'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authetication string in the format username:password'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.port','8081','Load Balancer(haproxy) stats port number.'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass the cloudstack DHCP/DNS server vm name service, use zone external dns1 and dns2'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.enabled', 'false', 'Whether the load balancing service is enabled for basic zones'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.gc.interval.minutes', '120', 'Garbage collection interval to destroy unused ELB vms in minutes. Minimum of 5'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.network', 'guest', 'Whether the elastic load balancing service public ips are taken from the public or guest network'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.cpu.mhz', '128', 'CPU speed for the elastic load balancer vm'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.ram.size', '128', 'Memory in MB for the elastic load balancer vm'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.vm.vcpu.num', '1', 'Number of VCPU for the elastic load balancer vm'); + +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.reserve.mem', 'false', 'Specify whether or not to reserve memory based on memory overprovisioning factor'); +INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'mem.overprovisioning.factor', '1', 'Used for memory overprovisioning calculation'); + +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.psk.length', '24', 'The length of the ipsec preshared key (minimum 8, maximum 256)'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.client.iprange', '10.1.2.1-10.1.2.8', 'The range of ips to be allocated to remote access vpn clients. The first ip in the range is used by the VPN server'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'AgentManager', 'remote.access.vpn.user.limit', '8', 'The maximum number of VPN users that can be created per account'); + +CREATE TABLE IF NOT exists `cloud`.`elastic_lb_vm_map` ( + `id` bigint unsigned NOT NULL auto_increment, + `ip_addr_id` bigint unsigned NOT NULL, + `elb_vm_id` bigint unsigned NOT NULL, + `lb_id` bigint unsigned, + PRIMARY KEY (`id`), + CONSTRAINT `fk_elastic_lb_vm_map__ip_id` FOREIGN KEY `fk_elastic_lb_vm_map__ip_id` (`ip_addr_id`) REFERENCES `user_ip_address` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_elastic_lb_vm_map__elb_vm_id` FOREIGN KEY `fk_elastic_lb_vm_map__elb_vm_id` (`elb_vm_id`) REFERENCES `vm_instance` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_elastic_lb_vm_map__lb_id` FOREIGN KEY `fk_elastic_lb_vm_map__lb_id` (`lb_id`) REFERENCES `load_balancing_rules` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +UPDATE `cloud`.`network_offerings` SET lb_service=1 where unique_name='System-Guest-Network'; diff --git a/setup/db/db/schema-22beta1to22beta2.sql b/setup/db/db/schema-22beta1to22beta2.sql index 66c1a9d3336..1b7c6a64eb0 100644 --- a/setup/db/db/schema-22beta1to22beta2.sql +++ b/setup/db/db/schema-22beta1to22beta2.sql @@ -1,13 +1,18 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + ALTER TABLE `cloud`.`snapshots` MODIFY COLUMN `id` bigint unsigned UNIQUE NOT NULL diff --git a/setup/db/db/schema-22beta3to22beta4.sql b/setup/db/db/schema-22beta3to22beta4.sql index 9e167e36328..2160878e687 100755 --- a/setup/db/db/schema-22beta3to22beta4.sql +++ b/setup/db/db/schema-22beta3to22beta4.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + CREATE TABLE `cloud`.`host_tags` ( `id` bigint unsigned NOT NULL auto_increment, `host_id` bigint unsigned NOT NULL COMMENT 'host id', diff --git a/setup/db/db/schema-301to302-cleanup.sql b/setup/db/db/schema-301to302-cleanup.sql index 151d98365ec..7922d98ea99 100644 --- a/setup/db/db/schema-301to302-cleanup.sql +++ b/setup/db/db/schema-301to302-cleanup.sql @@ -1,14 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http:#www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. #Schema cleanup from 3.0.1 to 3.0.2; @@ -27,4 +32,4 @@ ALTER TABLE `cloud_usage`.`usage_ip_address` MODIFY `id` bigint(20) UNSIGNED NOT ALTER TABLE `cloud_usage`.`usage_ip_address` MODIFY `is_source_nat` smallint(1) NOT NULL; ALTER TABLE `cloud_usage`.`usage_network` MODIFY `host_id` bigint(20) UNSIGNED NOT NULL; ALTER TABLE `cloud_usage`.`usage_network` MODIFY `host_type` varchar(32) DEFAULT NULL; -ALTER TABLE `cloud_usage`.`user_statistics` MODIFY `device_id` bigint(20) UNSIGNED NOT NULL; \ No newline at end of file +ALTER TABLE `cloud_usage`.`user_statistics` MODIFY `device_id` bigint(20) UNSIGNED NOT NULL; diff --git a/setup/db/db/schema-301to302.sql b/setup/db/db/schema-301to302.sql index a689d574ca7..595ce1974b5 100755 --- a/setup/db/db/schema-301to302.sql +++ b/setup/db/db/schema-301to302.sql @@ -1,57 +1,62 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http:#www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -#Schema upgrade from 3.0.1 to 3.0.2; - -DELETE FROM `cloud`.`configuration` WHERE name='consoleproxy.cpu.mhz'; -DELETE FROM `cloud`.`configuration` WHERE name='secstorage.vm.cpu.mhz'; -DELETE FROM `cloud`.`configuration` WHERE name='consoleproxy.ram.size'; -DELETE FROM `cloud`.`configuration` WHERE name='secstorage.vm.ram.size'; - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'consoleproxy.service.offering', NULL, 'Service offering used by console proxy; if NULL - system offering will be used'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'secstorage.service.offering', NULL, 'Service offering used by secondary storage; if NULL - system offering will be used'); - -UPDATE `cloud`.`network_offerings` SET display_text='Offering for Isolated networks with Source Nat service enabled' WHERE name='DefaultIsolatedNetworkOfferingWithSourceNatService' and `cloud`.`network_offerings`.default=1; -UPDATE `cloud`.`network_offerings` SET display_text='Offering for Isolated networks with no Source Nat service' WHERE name='DefaultIsolatedNetworkOffering' and `cloud`.`network_offerings`.default=1; -UPDATE `cloud`.`network_offerings` SET display_text='Offering for Shared networks' WHERE name='DefaultSharedNetworkOffering' and `cloud`.`network_offerings`.default=1; - -INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('XenServer', '6.0.2', 50, 1); -INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('VMware', '5.0', 128, 0); - - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'direct.agent.load.size', '16', 'The number of direct agents to load each time'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'direct.network.no.default.route', 'false', 'Direct Network Dhcp Server should not send a default route'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'endpointe.url', 'http://localhost:8080/client/api', 'Endpointe Url'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'extract.url.expiration.interval', '14400', 'The life of an extract URL after which it is deleted'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Hidden', 'DEFAULT', 'management-server', 'kvm.guest.network.device', null, 'Specify the private bridge on host for private network'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'network.disable.rpfilter', 'true', 'disable rp_filter on Domain Router VM public interfaces.'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'network.securitygroups.work.cleanup.interval', '120', 'Time interval (seconds) in which finished work is cleaned up from the work table'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'network.securitygroups.work.lock.timeout', '300', 'Lock wait timeout (seconds) while updating the security group work queues'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'network.securitygroups.work.per.agent.queue.size', '100', -'The number of outstanding security group work items that can be queued to a host. If exceeded, work items will get dropped to conserve memory. Security Group Sync will take care of ensuring that the host gets updated eventually'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'network.securitygroups.workers.pool.size', '50', 'Number of worker threads processing the security group update work queue'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Hidden', 'DEFAULT', 'management-server', 'ovm.guest.network.device', null, 'Specify the private bridge on host for private network'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Hidden', 'DEFAULT', 'management-server', 'ovm.private.network.device', null, 'Specify the private bridge on host for private network'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Hidden', 'DEFAULT', 'management-server', 'ovm.public.network.device', null, 'Specify the public bridge on host for public network'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'router.extra.public.nics', '2', 'specify extra public nics used for virtual router(up to 5)'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'secstorage.capacity.standby', '10', 'The minimal number of command execution sessions that system is able to serve immediately(standby capacity)'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'secstorage.cmd.execution.time.max', '30', 'The max command execution time in minute'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'secstorage.session.max', '50', 'The max number of command execution sessions that a SSVM can handle'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.max.volume.size', '2000', 'The maximum size for a volume (in GB).'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'task.cleanup.retry.interval', '600', 'Time (in seconds) to wait before retrying cleanup of tasks if the cleanup failed previously. 0 means to never retry.'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.additional.vnc.portrange.start', '50000', 'Start port number of additional VNC port range'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.percluster.host.max', '8', 'maxmium hosts per vCenter cluster(do not let it grow over 8)'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.reserve.cpu', 'false', 'Specify whether or not to reserve CPU based on CPU overprovisioning factor'); - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.reserve.mem', 'false', 'Specify whether or not to reserve memory based on memory overprovisioning factor'); - -UPDATE `cloud`.`storage_pool` SET removed=now() WHERE path='lvm' AND id NOT IN (select pool_id from storage_pool_host_ref); +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +-- Schema upgrade from 3.0.1 to 3.0.2; + +DELETE FROM `cloud`.`configuration` WHERE name='consoleproxy.cpu.mhz'; +DELETE FROM `cloud`.`configuration` WHERE name='secstorage.vm.cpu.mhz'; +DELETE FROM `cloud`.`configuration` WHERE name='consoleproxy.ram.size'; +DELETE FROM `cloud`.`configuration` WHERE name='secstorage.vm.ram.size'; + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'consoleproxy.service.offering', NULL, 'Service offering used by console proxy; if NULL - system offering will be used'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'secstorage.service.offering', NULL, 'Service offering used by secondary storage; if NULL - system offering will be used'); + +UPDATE `cloud`.`network_offerings` SET display_text='Offering for Isolated networks with Source Nat service enabled' WHERE name='DefaultIsolatedNetworkOfferingWithSourceNatService' and `cloud`.`network_offerings`.default=1; +UPDATE `cloud`.`network_offerings` SET display_text='Offering for Isolated networks with no Source Nat service' WHERE name='DefaultIsolatedNetworkOffering' and `cloud`.`network_offerings`.default=1; +UPDATE `cloud`.`network_offerings` SET display_text='Offering for Shared networks' WHERE name='DefaultSharedNetworkOffering' and `cloud`.`network_offerings`.default=1; + +INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('XenServer', '6.0.2', 50, 1); +INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('VMware', '5.0', 128, 0); + + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'direct.agent.load.size', '16', 'The number of direct agents to load each time'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'direct.network.no.default.route', 'false', 'Direct Network Dhcp Server should not send a default route'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'endpointe.url', 'http://localhost:8080/client/api', 'Endpointe Url'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'extract.url.expiration.interval', '14400', 'The life of an extract URL after which it is deleted'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Hidden', 'DEFAULT', 'management-server', 'kvm.guest.network.device', null, 'Specify the private bridge on host for private network'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'network.disable.rpfilter', 'true', 'disable rp_filter on Domain Router VM public interfaces.'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'network.securitygroups.work.cleanup.interval', '120', 'Time interval (seconds) in which finished work is cleaned up from the work table'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'network.securitygroups.work.lock.timeout', '300', 'Lock wait timeout (seconds) while updating the security group work queues'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'network.securitygroups.work.per.agent.queue.size', '100', +'The number of outstanding security group work items that can be queued to a host. If exceeded, work items will get dropped to conserve memory. Security Group Sync will take care of ensuring that the host gets updated eventually'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'network.securitygroups.workers.pool.size', '50', 'Number of worker threads processing the security group update work queue'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Hidden', 'DEFAULT', 'management-server', 'ovm.guest.network.device', null, 'Specify the private bridge on host for private network'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Hidden', 'DEFAULT', 'management-server', 'ovm.private.network.device', null, 'Specify the private bridge on host for private network'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Hidden', 'DEFAULT', 'management-server', 'ovm.public.network.device', null, 'Specify the public bridge on host for public network'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'router.extra.public.nics', '2', 'specify extra public nics used for virtual router(up to 5)'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'secstorage.capacity.standby', '10', 'The minimal number of command execution sessions that system is able to serve immediately(standby capacity)'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'secstorage.cmd.execution.time.max', '30', 'The max command execution time in minute'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'secstorage.session.max', '50', 'The max number of command execution sessions that a SSVM can handle'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.max.volume.size', '2000', 'The maximum size for a volume (in GB).'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'task.cleanup.retry.interval', '600', 'Time (in seconds) to wait before retrying cleanup of tasks if the cleanup failed previously. 0 means to never retry.'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.additional.vnc.portrange.start', '50000', 'Start port number of additional VNC port range'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.percluster.host.max', '8', 'maxmium hosts per vCenter cluster(do not let it grow over 8)'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.reserve.cpu', 'false', 'Specify whether or not to reserve CPU based on CPU overprovisioning factor'); + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.reserve.mem', 'false', 'Specify whether or not to reserve memory based on memory overprovisioning factor'); + +UPDATE `cloud`.`storage_pool` SET removed=now() WHERE path='lvm' AND id NOT IN (select pool_id from storage_pool_host_ref); diff --git a/setup/db/db/schema-302to303.sql b/setup/db/db/schema-302to303.sql index d22d88d60eb..5f1f88586e0 100755 --- a/setup/db/db/schema-302to303.sql +++ b/setup/db/db/schema-302to303.sql @@ -1,175 +1,180 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http:#www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - -#Schema upgrade from 3.0.2 to 3.0.3; - -DELETE FROM `cloud`.`configuration` WHERE name='consoleproxy.cpu.mhz'; -DELETE FROM `cloud`.`configuration` WHERE name='secstorage.vm.cpu.mhz'; -DELETE FROM `cloud`.`configuration` WHERE name='consoleproxy.ram.size'; -DELETE FROM `cloud`.`configuration` WHERE name='secstorage.vm.ram.size'; -DELETE FROM `cloud`.`configuration` WHERE name='open.vswitch.vlan.network'; -DELETE FROM `cloud`.`configuration` WHERE name='open.vswitch.tunnel.network'; - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'consoleproxy.service.offering', NULL, 'Service offering used by console proxy; if NULL - system offering will be used'); - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'secstorage.service.offering', NULL, 'Service offering used by secondary storage; if NULL - system offering will be used'); - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'sdn.ovs.controller', NULL, 'Enable/Disable Open vSwitch SDN controller for L2-in-L3 overlay networks'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'sdn.ovs.controller.default.label', NULL, 'Default network label to be used when fetching interface for GRE endpoints'); - -ALTER TABLE `cloud`.`user_vm` ADD COLUMN `update_parameters` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Defines if the parameters need to be set for the vm'; -UPDATE `cloud`.`user_vm` SET update_parameters=0 where id>0; - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'ha.tag', NULL, 'HA tag defining that the host marked with this tag can be used for HA purposes only'); - -# Changes for Upload Volume -CREATE TABLE `cloud`.`volume_host_ref` ( - `id` bigint unsigned NOT NULL auto_increment, - `host_id` bigint unsigned NOT NULL, - `volume_id` bigint unsigned NOT NULL, - `zone_id` bigint unsigned NOT NULL, - `created` DATETIME NOT NULL, - `last_updated` DATETIME, - `job_id` varchar(255), - `download_pct` int(10) unsigned, - `size` bigint unsigned, - `physical_size` bigint unsigned DEFAULT 0, - `download_state` varchar(255), - `checksum` varchar(255) COMMENT 'checksum for the data disk', - `error_str` varchar(255), - `local_path` varchar(255), - `install_path` varchar(255), - `url` varchar(255), - `format` varchar(32) NOT NULL COMMENT 'format for the volume', - `destroyed` tinyint(1) COMMENT 'indicates whether the volume_host entry was destroyed by the user or not', - PRIMARY KEY (`id`), - CONSTRAINT `fk_volume_host_ref__host_id` FOREIGN KEY `fk_volume_host_ref__host_id` (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE, - INDEX `i_volume_host_ref__host_id`(`host_id`), - CONSTRAINT `fk_volume_host_ref__volume_id` FOREIGN KEY `fk_volume_host_ref__volume_id` (`volume_id`) REFERENCES `volumes` (`id`), - INDEX `i_volume_host_ref__volume_id`(`volume_id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; - -INSERT IGNORE INTO `cloud`.`disk_offering` (name, display_text, customized, unique_name, disk_size, system_use, type) VALUES ( 'Custom', 'Custom Disk', 1, 'Cloud.com-Custom', 0, 0, 'Disk'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.max.volume.upload.size', 500, 'The maximum size for a uploaded volume(in GB).'); -# Changes for OVS tunnel manager - -# The Following tables are not used anymore -DROP TABLE IF EXISTS `cloud`.`ovs_host_vlan_alloc`; -DROP TABLE IF EXISTS `cloud`.`ovs_tunnel`; -DROP TABLE IF EXISTS `cloud`.`ovs_tunnel_alloc`; -DROP TABLE IF EXISTS `cloud`.`ovs_vlan_mapping_dirty`; -DROP TABLE IF EXISTS `cloud`.`ovs_vm_flow_log`; -DROP TABLE IF EXISTS `cloud`.`ovs_work`; - -CREATE TABLE `cloud`.`ovs_tunnel_interface` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `ip` varchar(16) DEFAULT NULL, - `netmask` varchar(16) DEFAULT NULL, - `mac` varchar(18) DEFAULT NULL, - `host_id` bigint(20) DEFAULT NULL, - `label` varchar(45) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`ovs_tunnel_network`( - `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, - `from` bigint unsigned COMMENT 'from host id', - `to` bigint unsigned COMMENT 'to host id', - `network_id` bigint unsigned COMMENT 'network identifier', - `key` int unsigned COMMENT 'gre key', - `port_name` varchar(32) COMMENT 'in port on open vswitch', - `state` varchar(16) default 'FAILED' COMMENT 'result of tunnel creatation', - PRIMARY KEY(`from`, `to`, `network_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO `cloud`.`ovs_tunnel_interface` (`ip`, `netmask`, `mac`, `host_id`, `label`) VALUES ('0', '0', '0', 0, 'lock'); - -INSERT INTO `cloud`.`ovs_tunnel_network` (`from`, `to`, `network_id`, `key`, `port_name`, `state`) VALUES (0, 0, 0, 0, 'lock', 'SUCCESS'); - -UPDATE `cloud`.`configuration` set component='NetworkManager' where name='external.network.stats.interval'; -UPDATE `cloud`.`configuration` set category='Advanced' where name='guest.domain.suffix'; -UPDATE `cloud`.`configuration` set component='NetworkManager' where name='network.guest.cidr.limit'; -UPDATE `cloud`.`configuration` set component='NetworkManager' where name='router.cpu.mhz'; -UPDATE `cloud`.`configuration` set component='NetworkManager' where name='router.ram.size'; -UPDATE `cloud`.`configuration` set component='NetworkManager' where name='router.stats.interval'; -UPDATE `cloud`.`configuration` set component='NetworkManager' where name='router.template.id'; -UPDATE `cloud`.`configuration` set category='Advanced ' where name='capacity.skipcounting.hours'; -UPDATE `cloud`.`configuration` set category='Advanced ' where name='use.local.storage'; -UPDATE `cloud`.`configuration` set category='Hidden ' where name='router.ram.size'; -UPDATE `cloud`.`configuration` set category='Hidden ' where name='secondary.storage.vm'; -UPDATE `cloud`.`configuration` set category='Hidden ' where name='security.hash.key'; -UPDATE `cloud`.`configuration` set description = 'Percentage (as a value between 0 and 1) of local storage utilization above which alerts will be sent about low local storage available.' where name = 'cluster.localStorage.capacity.notificationthreshold'; - -DELETE FROM `cloud`.`configuration` WHERE name='direct.agent.pool.size'; -DELETE FROM `cloud`.`configuration` WHERE name='xen.max.product.version'; -DELETE FROM `cloud`.`configuration` WHERE name='xen.max.version'; -DELETE FROM `cloud`.`configuration` WHERE name='xen.max.xapi.version'; -DELETE FROM `cloud`.`configuration` WHERE name='xen.min.product.version'; -DELETE FROM `cloud`.`configuration` WHERE name='xen.min.version'; -DELETE FROM `cloud`.`configuration` WHERE name='xen.min.xapi.version'; - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'enable.ec2.api', 'false', 'enable EC2 API on CloudStack'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'enable.s3.api', 'false', 'enable Amazon S3 API on CloudStack'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'vmware.use.nexus.vswitch', 'false', 'Enable/Disable Cisco Nexus 1000v vSwitch in VMware environment'); -ALTER TABLE `cloud`.`account` ADD COLUMN `default_zone_id` bigint unsigned; -ALTER TABLE `cloud`.`account` ADD CONSTRAINT `fk_account__default_zone_id` FOREIGN KEY `fk_account__default_zone_id`(`default_zone_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE; - - -DELETE FROM `cloud`.`storage_pool_host_ref` WHERE pool_id IN (SELECT id FROM storage_pool WHERE removed IS NOT NULL); - -DROP TABLE IF EXISTS `cloud`.`cluster_vsm_map`; -DROP TABLE IF EXISTS `cloud`.`virtual_supervisor_module`; -DROP TABLE IF EXISTS `cloud`.`port_profile`; - -CREATE TABLE `cloud`.`cluster_vsm_map` ( - `cluster_id` bigint unsigned NOT NULL, - `vsm_id` bigint unsigned NOT NULL, - PRIMARY KEY (`cluster_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`virtual_supervisor_module` ( - `id` bigint unsigned NOT NULL auto_increment COMMENT 'id', - `uuid` varchar(40), - `host_id` bigint NOT NULL, - `vsm_name` varchar(255), - `username` varchar(255) NOT NULL, - `password` varchar(255) NOT NULL, - `ipaddr` varchar(80) NOT NULL, - `management_vlan` int(32), - `control_vlan` int(32), - `packet_vlan` int(32), - `storage_vlan` int(32), - `vsm_domain_id` bigint unsigned, - `config_mode` varchar(20), - `config_state` varchar(20), - `vsm_device_state` varchar(20) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`port_profile` ( - `id` bigint unsigned NOT NULL auto_increment COMMENT 'id', - `uuid` varchar(40), - `port_profile_name` varchar(255), - `port_mode` varchar(10), - `vsm_id` bigint unsigned NOT NULL, - `trunk_low_vlan_id` int, - `trunk_high_vlan_id` int, - `access_vlan_id` int, - `port_type` varchar(20) NOT NULL, - `port_binding` varchar(20), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DELETE FROM `cloud`.`storage_pool_host_ref` WHERE pool_id IN (SELECT id FROM storage_pool WHERE removed IS NOT NULL); - -ALTER TABLE `cloud`.`service_offering` MODIFY `nw_rate` smallint(5) unsigned DEFAULT '200' COMMENT 'network rate throttle mbits/s'; +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + +-- Schema upgrade from 3.0.2 to 3.0.3; + +DELETE FROM `cloud`.`configuration` WHERE name='consoleproxy.cpu.mhz'; +DELETE FROM `cloud`.`configuration` WHERE name='secstorage.vm.cpu.mhz'; +DELETE FROM `cloud`.`configuration` WHERE name='consoleproxy.ram.size'; +DELETE FROM `cloud`.`configuration` WHERE name='secstorage.vm.ram.size'; +DELETE FROM `cloud`.`configuration` WHERE name='open.vswitch.vlan.network'; +DELETE FROM `cloud`.`configuration` WHERE name='open.vswitch.tunnel.network'; + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'consoleproxy.service.offering', NULL, 'Service offering used by console proxy; if NULL - system offering will be used'); + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'secstorage.service.offering', NULL, 'Service offering used by secondary storage; if NULL - system offering will be used'); + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'sdn.ovs.controller', NULL, 'Enable/Disable Open vSwitch SDN controller for L2-in-L3 overlay networks'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'sdn.ovs.controller.default.label', NULL, 'Default network label to be used when fetching interface for GRE endpoints'); + +ALTER TABLE `cloud`.`user_vm` ADD COLUMN `update_parameters` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Defines if the parameters need to be set for the vm'; +UPDATE `cloud`.`user_vm` SET update_parameters=0 where id>0; + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'ha.tag', NULL, 'HA tag defining that the host marked with this tag can be used for HA purposes only'); + +# Changes for Upload Volume +CREATE TABLE `cloud`.`volume_host_ref` ( + `id` bigint unsigned NOT NULL auto_increment, + `host_id` bigint unsigned NOT NULL, + `volume_id` bigint unsigned NOT NULL, + `zone_id` bigint unsigned NOT NULL, + `created` DATETIME NOT NULL, + `last_updated` DATETIME, + `job_id` varchar(255), + `download_pct` int(10) unsigned, + `size` bigint unsigned, + `physical_size` bigint unsigned DEFAULT 0, + `download_state` varchar(255), + `checksum` varchar(255) COMMENT 'checksum for the data disk', + `error_str` varchar(255), + `local_path` varchar(255), + `install_path` varchar(255), + `url` varchar(255), + `format` varchar(32) NOT NULL COMMENT 'format for the volume', + `destroyed` tinyint(1) COMMENT 'indicates whether the volume_host entry was destroyed by the user or not', + PRIMARY KEY (`id`), + CONSTRAINT `fk_volume_host_ref__host_id` FOREIGN KEY `fk_volume_host_ref__host_id` (`host_id`) REFERENCES `host` (`id`) ON DELETE CASCADE, + INDEX `i_volume_host_ref__host_id`(`host_id`), + CONSTRAINT `fk_volume_host_ref__volume_id` FOREIGN KEY `fk_volume_host_ref__volume_id` (`volume_id`) REFERENCES `volumes` (`id`), + INDEX `i_volume_host_ref__volume_id`(`volume_id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + +INSERT IGNORE INTO `cloud`.`disk_offering` (name, display_text, customized, unique_name, disk_size, system_use, type) VALUES ( 'Custom', 'Custom Disk', 1, 'Cloud.com-Custom', 0, 0, 'Disk'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.max.volume.upload.size', 500, 'The maximum size for a uploaded volume(in GB).'); +# Changes for OVS tunnel manager + +# The Following tables are not used anymore +DROP TABLE IF EXISTS `cloud`.`ovs_host_vlan_alloc`; +DROP TABLE IF EXISTS `cloud`.`ovs_tunnel`; +DROP TABLE IF EXISTS `cloud`.`ovs_tunnel_alloc`; +DROP TABLE IF EXISTS `cloud`.`ovs_vlan_mapping_dirty`; +DROP TABLE IF EXISTS `cloud`.`ovs_vm_flow_log`; +DROP TABLE IF EXISTS `cloud`.`ovs_work`; + +CREATE TABLE `cloud`.`ovs_tunnel_interface` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `ip` varchar(16) DEFAULT NULL, + `netmask` varchar(16) DEFAULT NULL, + `mac` varchar(18) DEFAULT NULL, + `host_id` bigint(20) DEFAULT NULL, + `label` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ovs_tunnel_network`( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, + `from` bigint unsigned COMMENT 'from host id', + `to` bigint unsigned COMMENT 'to host id', + `network_id` bigint unsigned COMMENT 'network identifier', + `key` int unsigned COMMENT 'gre key', + `port_name` varchar(32) COMMENT 'in port on open vswitch', + `state` varchar(16) default 'FAILED' COMMENT 'result of tunnel creatation', + PRIMARY KEY(`from`, `to`, `network_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `cloud`.`ovs_tunnel_interface` (`ip`, `netmask`, `mac`, `host_id`, `label`) VALUES ('0', '0', '0', 0, 'lock'); + +INSERT INTO `cloud`.`ovs_tunnel_network` (`from`, `to`, `network_id`, `key`, `port_name`, `state`) VALUES (0, 0, 0, 0, 'lock', 'SUCCESS'); + +UPDATE `cloud`.`configuration` set component='NetworkManager' where name='external.network.stats.interval'; +UPDATE `cloud`.`configuration` set category='Advanced' where name='guest.domain.suffix'; +UPDATE `cloud`.`configuration` set component='NetworkManager' where name='network.guest.cidr.limit'; +UPDATE `cloud`.`configuration` set component='NetworkManager' where name='router.cpu.mhz'; +UPDATE `cloud`.`configuration` set component='NetworkManager' where name='router.ram.size'; +UPDATE `cloud`.`configuration` set component='NetworkManager' where name='router.stats.interval'; +UPDATE `cloud`.`configuration` set component='NetworkManager' where name='router.template.id'; +UPDATE `cloud`.`configuration` set category='Advanced ' where name='capacity.skipcounting.hours'; +UPDATE `cloud`.`configuration` set category='Advanced ' where name='use.local.storage'; +UPDATE `cloud`.`configuration` set category='Hidden ' where name='router.ram.size'; +UPDATE `cloud`.`configuration` set category='Hidden ' where name='secondary.storage.vm'; +UPDATE `cloud`.`configuration` set category='Hidden ' where name='security.hash.key'; +UPDATE `cloud`.`configuration` set description = 'Percentage (as a value between 0 and 1) of local storage utilization above which alerts will be sent about low local storage available.' where name = 'cluster.localStorage.capacity.notificationthreshold'; + +DELETE FROM `cloud`.`configuration` WHERE name='direct.agent.pool.size'; +DELETE FROM `cloud`.`configuration` WHERE name='xen.max.product.version'; +DELETE FROM `cloud`.`configuration` WHERE name='xen.max.version'; +DELETE FROM `cloud`.`configuration` WHERE name='xen.max.xapi.version'; +DELETE FROM `cloud`.`configuration` WHERE name='xen.min.product.version'; +DELETE FROM `cloud`.`configuration` WHERE name='xen.min.version'; +DELETE FROM `cloud`.`configuration` WHERE name='xen.min.xapi.version'; + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'enable.ec2.api', 'false', 'enable EC2 API on CloudStack'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'enable.s3.api', 'false', 'enable Amazon S3 API on CloudStack'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'vmware.use.nexus.vswitch', 'false', 'Enable/Disable Cisco Nexus 1000v vSwitch in VMware environment'); +ALTER TABLE `cloud`.`account` ADD COLUMN `default_zone_id` bigint unsigned; +ALTER TABLE `cloud`.`account` ADD CONSTRAINT `fk_account__default_zone_id` FOREIGN KEY `fk_account__default_zone_id`(`default_zone_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE; + + +DELETE FROM `cloud`.`storage_pool_host_ref` WHERE pool_id IN (SELECT id FROM storage_pool WHERE removed IS NOT NULL); + +DROP TABLE IF EXISTS `cloud`.`cluster_vsm_map`; +DROP TABLE IF EXISTS `cloud`.`virtual_supervisor_module`; +DROP TABLE IF EXISTS `cloud`.`port_profile`; + +CREATE TABLE `cloud`.`cluster_vsm_map` ( + `cluster_id` bigint unsigned NOT NULL, + `vsm_id` bigint unsigned NOT NULL, + PRIMARY KEY (`cluster_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`virtual_supervisor_module` ( + `id` bigint unsigned NOT NULL auto_increment COMMENT 'id', + `uuid` varchar(40), + `host_id` bigint NOT NULL, + `vsm_name` varchar(255), + `username` varchar(255) NOT NULL, + `password` varchar(255) NOT NULL, + `ipaddr` varchar(80) NOT NULL, + `management_vlan` int(32), + `control_vlan` int(32), + `packet_vlan` int(32), + `storage_vlan` int(32), + `vsm_domain_id` bigint unsigned, + `config_mode` varchar(20), + `config_state` varchar(20), + `vsm_device_state` varchar(20) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`port_profile` ( + `id` bigint unsigned NOT NULL auto_increment COMMENT 'id', + `uuid` varchar(40), + `port_profile_name` varchar(255), + `port_mode` varchar(10), + `vsm_id` bigint unsigned NOT NULL, + `trunk_low_vlan_id` int, + `trunk_high_vlan_id` int, + `access_vlan_id` int, + `port_type` varchar(20) NOT NULL, + `port_binding` varchar(20), + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DELETE FROM `cloud`.`storage_pool_host_ref` WHERE pool_id IN (SELECT id FROM storage_pool WHERE removed IS NOT NULL); + +ALTER TABLE `cloud`.`service_offering` MODIFY `nw_rate` smallint(5) unsigned DEFAULT '200' COMMENT 'network rate throttle mbits/s'; diff --git a/setup/db/db/schema-30to301.sql b/setup/db/db/schema-30to301.sql index 1a493881bf1..615d7930481 100755 --- a/setup/db/db/schema-30to301.sql +++ b/setup/db/db/schema-30to301.sql @@ -1,32 +1,35 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/02/2012 - - -#Schema upgrade from 3.0 to 3.0.1; - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Project Defaults', 'DEFAULT', 'management-server', 'max.project.networks', '20', 'The default maximum number of networks that can be created for a project'); - - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.networks', '20', 'The default maximum number of networks that can be created for an account'); - -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.networks', '20', 'The default maximum number of networks that can be created for an account'); - -UPDATE snapshots SET removed=now() WHERE removed IS NULL AND sechost_id IN (SELECT id FROM host WHERE type='SecondaryStorage' AND removed IS NOT NULL); - -ALTER TABLE `cloud_usage`.`usage_ip_address` MODIFY COLUMN `is_system` smallint(1) NOT NULL default '0'; - -ALTER TABLE `cloud_usage`.`account` ADD CONSTRAINT `uc_account__uuid` UNIQUE (`uuid`); - -ALTER TABLE `cloud`.`host` ALTER COLUMN `resource_state` SET DEFAULT 'Enabled'; - -ALTER TABLE `cloud`.`physical_network_service_providers` ADD COLUMN `removed` datetime COMMENT 'date removed if not null'; +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +-- Schema upgrade from 3.0 to 3.0.1; + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Project Defaults', 'DEFAULT', 'management-server', 'max.project.networks', '20', 'The default maximum number of networks that can be created for a project'); + + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.networks', '20', 'The default maximum number of networks that can be created for an account'); + +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.networks', '20', 'The default maximum number of networks that can be created for an account'); + +UPDATE snapshots SET removed=now() WHERE removed IS NULL AND sechost_id IN (SELECT id FROM host WHERE type='SecondaryStorage' AND removed IS NOT NULL); + +ALTER TABLE `cloud_usage`.`usage_ip_address` MODIFY COLUMN `is_system` smallint(1) NOT NULL default '0'; + +ALTER TABLE `cloud_usage`.`account` ADD CONSTRAINT `uc_account__uuid` UNIQUE (`uuid`); + +ALTER TABLE `cloud`.`host` ALTER COLUMN `resource_state` SET DEFAULT 'Enabled'; + +ALTER TABLE `cloud`.`physical_network_service_providers` ADD COLUMN `removed` datetime COMMENT 'date removed if not null'; diff --git a/setup/db/db/schema-level.sql b/setup/db/db/schema-level.sql index efbe8cc6f36..72aade4e501 100644 --- a/setup/db/db/schema-level.sql +++ b/setup/db/db/schema-level.sql @@ -1,13 +1,18 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + INSERT INTO `cloud`.`configuration` (category, instance, component, name, value, description) VALUES ('Hidden', 'DEFAULT', 'database', 'schema.level', '2.2', 'The schema level of this database'); diff --git a/setup/db/db/schema-snapshot-217to224.sql b/setup/db/db/schema-snapshot-217to224.sql index eaf0b17a1fe..7320bda5906 100644 --- a/setup/db/db/schema-snapshot-217to224.sql +++ b/setup/db/db/schema-snapshot-217to224.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + ALTER table snapshots add column `data_center_id` bigint unsigned NOT NULL ; ALTER table snapshots add column `domain_id` bigint unsigned NOT NULL; ALTER table snapshots add column `disk_offering_id` bigint unsigned NOT NULL; diff --git a/setup/db/db/schema-snapshot-223to224.sql b/setup/db/db/schema-snapshot-223to224.sql index 4410c90ea8c..668cbb692b9 100644 --- a/setup/db/db/schema-snapshot-223to224.sql +++ b/setup/db/db/schema-snapshot-223to224.sql @@ -1,15 +1,21 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + ALTER table snapshots add column `data_center_id` bigint unsigned NOT NULL ; ALTER table snapshots add column `domain_id` bigint unsigned NOT NULL; ALTER table snapshots add column `disk_offering_id` bigint unsigned NOT NULL; diff --git a/setup/db/deploy-db-dev.sh b/setup/db/deploy-db-dev.sh index 100245ebdb0..f149e9efd02 100755 --- a/setup/db/deploy-db-dev.sh +++ b/setup/db/deploy-db-dev.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/setup/db/deploy-db-simulator.sh b/setup/db/deploy-db-simulator.sh index c7ff914d486..9fe3383d636 100644 --- a/setup/db/deploy-db-simulator.sh +++ b/setup/db/deploy-db-simulator.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/setup/db/index-20to21.sql b/setup/db/index-20to21.sql index 3d6d0ba80f1..d259f793c87 100644 --- a/setup/db/index-20to21.sql +++ b/setup/db/index-20to21.sql @@ -1,55 +1,60 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 --- --- INDEX/CONSTRAINT upgrade from 2.0 to 2.1 --- - -ALTER TABLE `cloud`.`host` ADD CONSTRAINT `fk_host__cluster_id` FOREIGN KEY `fk_host__cluster_id`(`cluster_id`) REFERENCES `cloud`.`cluster`(`id`); - -ALTER TABLE `cloud`.`storage_pool` ADD CONSTRAINT `fk_storage_pool__cluster_id` FOREIGN KEY `fk_storage_pool__cluster_id`(`cluster_id`) REFERENCES `cloud`.`cluster`(`id`); - -ALTER TABLE `cloud`.`storage_pool_details` ADD CONSTRAINT `fk_storage_pool_details__pool_id` FOREIGN KEY `fk_storage_pool__pool_id`(`pool_id`) REFERENCES `storage_pool`(`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`storage_pool_details` ADD INDEX `i_storage_pool_details__name__value`(`name`, `value`); - -ALTER TABLE `cloud`.`ext_lun_alloc` ADD UNIQUE `i_ext_lun_alloc__target_iqn__lun`(`target_iqn`, `lun`); -ALTER TABLE `cloud`.`ext_lun_details` ADD CONSTRAINT `fk_ext_lun_details__ext_lun_id` FOREIGN KEY `fk_ext_lun_details__ext_lun_id`(`ext_lun_id`) REFERENCES `ext_lun_alloc`(`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`cluster` ADD CONSTRAINT `fk_cluster__data_center_id` FOREIGN KEY `fk_cluster__data_center_id`(`data_center_id`) REFERENCES `cloud`.`data_center`(`id`); -ALTER TABLE `cloud`.`cluster` ADD CONSTRAINT `fk_cluster__pod_id` FOREIGN KEY `fd_cluster__pod_id`(`pod_id`) REFERENCES `cloud`.`host_pod_ref`(`id`); -ALTER TABLE `cloud`.`cluster` ADD UNIQUE `i_cluster__pod_id__name`(`pod_id`, `name`); - -ALTER TABLE `cloud`.`account_vlan_map` ADD CONSTRAINT `fk_account_vlan_map__account_id` FOREIGN KEY `fk_account_vlan_map__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`account_vlan_map` ADD INDEX `i_account_vlan_map__account_id`(`account_id`); -ALTER TABLE `cloud`.`account_vlan_map` ADD CONSTRAINT `fk_account_vlan_map__vlan_id` FOREIGN KEY `fk_account_vlan_map__vlan_id` (`vlan_db_id`) REFERENCES `vlan` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`account_vlan_map` ADD INDEX `i_account_vlan_map__vlan_id`(`vlan_db_id`); - -ALTER TABLE `cloud`.`network_group` ADD CONSTRAINT `fk_network_group___account_id` FOREIGN KEY `fk_network_group__account_id` (`account_id`) REFERENCES `account` (`id`); -ALTER TABLE `cloud`.`network_group` ADD CONSTRAINT `fk_network_group__domain_id` FOREIGN KEY `fk_network_group__domain_id` (`domain_id`) REFERENCES `domain` (`id`); -ALTER TABLE `cloud`.`network_group` ADD INDEX `i_network_group_name`(`name`); - -ALTER TABLE `cloud`.`network_ingress_rule` ADD CONSTRAINT `fk_network_ingress_rule___network_group_id` FOREIGN KEY `fk_network_ingress_rule__network_group_id` (`network_group_id`) REFERENCES `network_group` (`id`); -ALTER TABLE `cloud`.`network_ingress_rule` ADD CONSTRAINT `fk_network_ingress_rule___allowed_network_id` FOREIGN KEY `fk_network_ingress_rule__allowed_network_id` (`allowed_network_id`) REFERENCES `network_group` (`id`); -ALTER TABLE `cloud`.`network_ingress_rule` ADD INDEX `i_network_ingress_rule_network_id`(`network_group_id`); -ALTER TABLE `cloud`.`network_ingress_rule` ADD INDEX `i_network_ingress_rule_allowed_network`(`allowed_network_id`); - -ALTER TABLE `cloud`.`network_group_vm_map` ADD CONSTRAINT `fk_network_group_vm_map___network_group_id` FOREIGN KEY `fk_network_group_vm_map___network_group_id` (`network_group_id`) REFERENCES `network_group` (`id`) ON DELETE CASCADE; -ALTER TABLE `cloud`.`network_group_vm_map` ADD CONSTRAINT `fk_network_group_vm_map___instance_id` FOREIGN KEY `fk_network_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__instance_id`(`instance_id`); -ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__mgmt_server_id`(`mgmt_server_id`); - -ALTER TABLE `cloud`.`vm_instance` ADD INDEX `i_vm_instance__last_host_id`(`last_host_id`); - --- drop foreign key constraits temporarily to allow data update in migration process -ALTER TABLE `cloud`.`user_vm` DROP FOREIGN KEY `fk_user_vm__service_offering_id`; - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +-- +-- INDEX/CONSTRAINT upgrade from 2.0 to 2.1 +-- + +ALTER TABLE `cloud`.`host` ADD CONSTRAINT `fk_host__cluster_id` FOREIGN KEY `fk_host__cluster_id`(`cluster_id`) REFERENCES `cloud`.`cluster`(`id`); + +ALTER TABLE `cloud`.`storage_pool` ADD CONSTRAINT `fk_storage_pool__cluster_id` FOREIGN KEY `fk_storage_pool__cluster_id`(`cluster_id`) REFERENCES `cloud`.`cluster`(`id`); + +ALTER TABLE `cloud`.`storage_pool_details` ADD CONSTRAINT `fk_storage_pool_details__pool_id` FOREIGN KEY `fk_storage_pool__pool_id`(`pool_id`) REFERENCES `storage_pool`(`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`storage_pool_details` ADD INDEX `i_storage_pool_details__name__value`(`name`, `value`); + +ALTER TABLE `cloud`.`ext_lun_alloc` ADD UNIQUE `i_ext_lun_alloc__target_iqn__lun`(`target_iqn`, `lun`); +ALTER TABLE `cloud`.`ext_lun_details` ADD CONSTRAINT `fk_ext_lun_details__ext_lun_id` FOREIGN KEY `fk_ext_lun_details__ext_lun_id`(`ext_lun_id`) REFERENCES `ext_lun_alloc`(`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`cluster` ADD CONSTRAINT `fk_cluster__data_center_id` FOREIGN KEY `fk_cluster__data_center_id`(`data_center_id`) REFERENCES `cloud`.`data_center`(`id`); +ALTER TABLE `cloud`.`cluster` ADD CONSTRAINT `fk_cluster__pod_id` FOREIGN KEY `fd_cluster__pod_id`(`pod_id`) REFERENCES `cloud`.`host_pod_ref`(`id`); +ALTER TABLE `cloud`.`cluster` ADD UNIQUE `i_cluster__pod_id__name`(`pod_id`, `name`); + +ALTER TABLE `cloud`.`account_vlan_map` ADD CONSTRAINT `fk_account_vlan_map__account_id` FOREIGN KEY `fk_account_vlan_map__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`account_vlan_map` ADD INDEX `i_account_vlan_map__account_id`(`account_id`); +ALTER TABLE `cloud`.`account_vlan_map` ADD CONSTRAINT `fk_account_vlan_map__vlan_id` FOREIGN KEY `fk_account_vlan_map__vlan_id` (`vlan_db_id`) REFERENCES `vlan` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`account_vlan_map` ADD INDEX `i_account_vlan_map__vlan_id`(`vlan_db_id`); + +ALTER TABLE `cloud`.`network_group` ADD CONSTRAINT `fk_network_group___account_id` FOREIGN KEY `fk_network_group__account_id` (`account_id`) REFERENCES `account` (`id`); +ALTER TABLE `cloud`.`network_group` ADD CONSTRAINT `fk_network_group__domain_id` FOREIGN KEY `fk_network_group__domain_id` (`domain_id`) REFERENCES `domain` (`id`); +ALTER TABLE `cloud`.`network_group` ADD INDEX `i_network_group_name`(`name`); + +ALTER TABLE `cloud`.`network_ingress_rule` ADD CONSTRAINT `fk_network_ingress_rule___network_group_id` FOREIGN KEY `fk_network_ingress_rule__network_group_id` (`network_group_id`) REFERENCES `network_group` (`id`); +ALTER TABLE `cloud`.`network_ingress_rule` ADD CONSTRAINT `fk_network_ingress_rule___allowed_network_id` FOREIGN KEY `fk_network_ingress_rule__allowed_network_id` (`allowed_network_id`) REFERENCES `network_group` (`id`); +ALTER TABLE `cloud`.`network_ingress_rule` ADD INDEX `i_network_ingress_rule_network_id`(`network_group_id`); +ALTER TABLE `cloud`.`network_ingress_rule` ADD INDEX `i_network_ingress_rule_allowed_network`(`allowed_network_id`); + +ALTER TABLE `cloud`.`network_group_vm_map` ADD CONSTRAINT `fk_network_group_vm_map___network_group_id` FOREIGN KEY `fk_network_group_vm_map___network_group_id` (`network_group_id`) REFERENCES `network_group` (`id`) ON DELETE CASCADE; +ALTER TABLE `cloud`.`network_group_vm_map` ADD CONSTRAINT `fk_network_group_vm_map___instance_id` FOREIGN KEY `fk_network_group_vm_map___instance_id` (`instance_id`) REFERENCES `user_vm` (`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__instance_id`(`instance_id`); +ALTER TABLE `cloud`.`op_nwgrp_work` ADD INDEX `i_op_nwgrp_work__mgmt_server_id`(`mgmt_server_id`); + +ALTER TABLE `cloud`.`vm_instance` ADD INDEX `i_vm_instance__last_host_id`(`last_host_id`); + +-- drop foreign key constraits temporarily to allow data update in migration process +ALTER TABLE `cloud`.`user_vm` DROP FOREIGN KEY `fk_user_vm__service_offering_id`; + diff --git a/setup/db/index-212to213.sql b/setup/db/index-212to213.sql index 793a7145d69..d03b29aa114 100644 --- a/setup/db/index-212to213.sql +++ b/setup/db/index-212to213.sql @@ -1,14 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + ALTER TABLE `cloud`.`user` DROP KEY `i_user__username__removed`; diff --git a/setup/db/postprocess-20to21.sql b/setup/db/postprocess-20to21.sql index 00c7f9eb544..9ad0b0c0473 100644 --- a/setup/db/postprocess-20to21.sql +++ b/setup/db/postprocess-20to21.sql @@ -1,30 +1,35 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 -use cloud; - -SET foreign_key_checks = 0; -DROP TABLE disk_offering; -DROP TABLE service_offering; - -RENAME TABLE disk_offering_21 TO disk_offering, service_offering_21 TO service_offering; -ALTER TABLE `cloud`.`service_offering` ADD CONSTRAINT `fk_service_offering__id` FOREIGN KEY `fk_service_offering__id`(`id`) REFERENCES `disk_offering`(`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`volumes` MODIFY COLUMN `disk_offering_id` bigint unsigned NOT NULL; -- add NOT NULL constraint -ALTER TABLE `cloud`.`host_pod_ref` MODIFY COLUMN `gateway` varchar(255) NOT NULL; -- add NOT NULL constrait - -ALTER TABLE `cloud`.`console_proxy` MODIFY COLUMN `guest_mac_address` varchar(17) NOT NULL UNIQUE; -- add NOT NULL UNIQUE constraint -ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `guest_mac_address` varchar(17)NOT NULL UNIQUE; -- add NOT NULL UNIQUE constraint - -update disk_offering set removed=NOW() where type='Service' and unique_name like 'Cloud.com-%'; - -ALTER TABLE `cloud`.`user_vm` ADD CONSTRAINT `fk_user_vm__service_offering_id` FOREIGN KEY `fk_user_vm__service_offering_id` (`service_offering_id`) REFERENCES `service_offering` (`id`); +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +use cloud; + +SET foreign_key_checks = 0; +DROP TABLE disk_offering; +DROP TABLE service_offering; + +RENAME TABLE disk_offering_21 TO disk_offering, service_offering_21 TO service_offering; +ALTER TABLE `cloud`.`service_offering` ADD CONSTRAINT `fk_service_offering__id` FOREIGN KEY `fk_service_offering__id`(`id`) REFERENCES `disk_offering`(`id`) ON DELETE CASCADE; + +ALTER TABLE `cloud`.`volumes` MODIFY COLUMN `disk_offering_id` bigint unsigned NOT NULL; -- add NOT NULL constraint +ALTER TABLE `cloud`.`host_pod_ref` MODIFY COLUMN `gateway` varchar(255) NOT NULL; -- add NOT NULL constrait + +ALTER TABLE `cloud`.`console_proxy` MODIFY COLUMN `guest_mac_address` varchar(17) NOT NULL UNIQUE; -- add NOT NULL UNIQUE constraint +ALTER TABLE `cloud`.`secondary_storage_vm` MODIFY COLUMN `guest_mac_address` varchar(17)NOT NULL UNIQUE; -- add NOT NULL UNIQUE constraint + +update disk_offering set removed=NOW() where type='Service' and unique_name like 'Cloud.com-%'; + +ALTER TABLE `cloud`.`user_vm` ADD CONSTRAINT `fk_user_vm__service_offering_id` FOREIGN KEY `fk_user_vm__service_offering_id` (`service_offering_id`) REFERENCES `service_offering` (`id`); diff --git a/setup/db/server-setup.sql b/setup/db/server-setup.sql index ba5afff0ad0..2cbfc162e1f 100644 --- a/setup/db/server-setup.sql +++ b/setup/db/server-setup.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + /* This file specifies default values that go into the database, before the Management Server is run. */ /* Root Domain */ diff --git a/setup/db/templates.kvm.sql b/setup/db/templates.kvm.sql index ec20e953dbf..7b9502719da 100644 --- a/setup/db/templates.kvm.sql +++ b/setup/db/templates.kvm.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, display_text, enable_password, format, guest_os_id, featured, cross_zones) VALUES (1, 'routing', 'DomR Template', 0, now(), 'ext3', 0, 64, 1, 'http://download.cloud.com/templates/builtin/a88232bf-6a18-38e7-aeee-c1702725079f.qcow2.bz2', 'e39c55e93ae96bd43bfd588ca6ee3269', 'DomR Template', 0, 'QCOW2', 21, 0, 1); INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, display_text, enable_password, format, guest_os_id, featured, cross_zones) diff --git a/setup/db/templates.simulator.sql b/setup/db/templates.simulator.sql index a839a478e91..2a140a4b21f 100755 --- a/setup/db/templates.simulator.sql +++ b/setup/db/templates.simulator.sql @@ -1,15 +1,21 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) VALUES (1, 'routing-1', 'SystemVM Template (XenServer)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/routing/debian/latest/systemvm.vhd.bz2', 'c33dfaf0937b35c25ef6a0fdd98f24d3', 0, 'SystemVM Template (XenServer)', 'VHD', 15, 0, 1, 'XenServer'); INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) diff --git a/setup/db/templates.sql b/setup/db/templates.sql index 536d4792abc..71f2b9dffc2 100755 --- a/setup/db/templates.sql +++ b/setup/db/templates.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) VALUES (1, 'routing-1', 'SystemVM Template (XenServer)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://download.cloud.com/templates/acton/acton-systemvm-02062012.vhd.bz2', 'f613f38c96bf039f2e5cbf92fa8ad4f8', 0, 'SystemVM Template (XenServer)', 'VHD', 15, 0, 1, 'XenServer'); INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, removed, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type, extractable) diff --git a/setup/db/templates.vmware.sql b/setup/db/templates.vmware.sql index fd387046ad5..02d72986a50 100644 --- a/setup/db/templates.vmware.sql +++ b/setup/db/templates.vmware.sql @@ -1,95 +1,100 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones) - VALUES (2, 'blank', 'BlankVM', 1, now(), 'ext3', 0, 32, 1, 'http://nfs1.lab.vmops.com/templates/vmware/blankvm.tar.bz2', '3eff7ce3d25cf9433efde8b245c63fcb', 0, 'BlankVM', 'VMDK', 47, 1, 1); -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones) - VALUES (3, 'winxpsp3', 'WindowsXP-SP3', 1, now(), 'ntfs', 0, 32, 1, 'http://nfs1.lab.vmops.com/templates/vmware/winxpsp3.tar.bz2', '385e67d17a2cb3795bd0b0fb7f88dc5e', 0, 'WindowsXP-SP3', 'VMDK', 16, 1, 1); - -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (1, 'Windows'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (2, 'Linux'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (3, 'Novell Netware'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (4, 'Solaris'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (5, 'Other'); - -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (1, 1, 'Microsoft Windows 7(32-bit)', 'Microsoft Windows 7(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (2, 1, 'Microsoft Windows 7(64-bit)', 'Microsoft Windows 7(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (3, 1, 'Microsoft Windows Server 2008 R2(64-bit)', 'Microsoft Windows Server 2008 R2(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (4, 1, 'Microsoft Windows Server 2008(32-bit)', 'Microsoft Windows Server 2008(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (5, 1, 'Microsoft Windows Server 2008(64-bit)', 'Windows Windows Server 2008(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (6, 1, 'Microsoft Windows Server 2003, Enterprise Edition (32-bit)', 'Microsoft Windows Server 2003, Enterprise Edition (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (7, 1, 'Microsoft Windows Server 2003, Enterprise Edition (64-bit)', 'Microsoft Windows Server 2003, Enterprise Edition (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (8, 1, 'Microsoft Windows Server 2003, Datacenter Edition (32-bit)', 'Microsoft Windows Server 2003, Datacenter Edition (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (9, 1, 'Microsoft Windows Server 2003, Datacenter Edition (64-bit)', 'Microsoft Windows Server 2003, Datacenter Edition (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (10, 1, 'Microsoft Windows Server 2003, Standard Edition (32-bit)', 'Microsoft Windows Server 2003, Standard Edition (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (11, 1, 'Microsoft Windows Server 2003, Standard Edition (64-bit)', 'Microsoft Windows Server 2003, Standard Edition (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (12, 1, 'Microsoft Windows Server 2003, Web Edition', 'Microsoft Windows Server 2003, Web Edition'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (13, 1, 'Microsoft Small Bussiness Server 2003', 'Microsoft Small Bussiness Server 2003'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (14, 1, 'Microsoft Windows Vista (32-bit)', 'Microsoft Windows Vista (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (15, 1, 'Microsoft Windows Vista (64-bit)', 'Microsoft Windows Vista (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (16, 1, 'Microsoft Windows XP Professional (32-bit)', 'Microsoft Windows XP Professional (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (17, 1, 'Microsoft Windows XP Professional (64-bit)', 'Microsoft Windows XP Professional (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (18, 1, 'Microsoft Windows 2000 Advanced Server', 'Microsoft Windows 2000 Advanced Server'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (19, 1, 'Microsoft Windows 2000 Server', 'Microsoft Windows 2000 Server'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (20, 1, 'Microsoft Windows 2000 Professional', 'Microsoft Windows 2000 Professional'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (21, 1, 'Microsoft Windows 98', 'Microsoft Windows 98'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (22, 1, 'Microsoft Windows 95', 'Microsoft Windows 95'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (23, 1, 'Microsoft Windows NT 4', 'Microsoft Windows NT 4'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (24, 1, 'Microsoft Windows 3.1', 'Microsoft Windows 3.1'); - -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (25, 2, 'Red Hat Enterprise Linux 5(32-bit)', 'Red Hat Enterprise Linux 5(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (26, 2, 'Red Hat Enterprise Linux 5(64-bit)', 'Red Hat Enterprise Linux 5(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (27, 2, 'Red Hat Enterprise Linux 4(32-bit)', 'Red Hat Enterprise Linux 4(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (28, 2, 'Red Hat Enterprise Linux 4(64-bit)', 'Red Hat Enterprise Linux 4(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (29, 2, 'Red Hat Enterprise Linux 3(32-bit)', 'Red Hat Enterprise Linux 3(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (30, 2, 'Red Hat Enterprise Linux 3(64-bit)', 'Red Hat Enterprise Linux 3(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (31, 2, 'Red Hat Enterprise Linux 2', 'Red Hat Enterprise Linux 2'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (32, 2, 'Suse Linux Enterprise 11(32-bit)', 'Suse Linux Enterprise 11(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (33, 2, 'Suse Linux Enterprise 11(64-bit)', 'Suse Linux Enterprise 11(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (34, 2, 'Suse Linux Enterprise 10(32-bit)', 'Suse Linux Enterprise 10(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (35, 2, 'Suse Linux Enterprise 10(64-bit)', 'Suse Linux Enterprise 10(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (36, 2, 'Suse Linux Enterprise 8/9(32-bit)', 'Suse Linux Enterprise 8/9(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (37, 2, 'Suse Linux Enterprise 8/9(64-bit)', 'Suse Linux Enterprise 8/9(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (38, 2, 'Open Enterprise Server', 'Open Enterprise Server'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (39, 2, 'Asianux 3(32-bit)', 'Asianux 3(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (40, 2, 'Asianux 3(64-bit)', 'Asianux 3(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (41, 2, 'Debian GNU/Linux 5(32-bit)', 'Debian GNU/Linux 5(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (42, 2, 'Debian GNU/Linux 5(64-bit)', 'Debian GNU/Linux 5(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (43, 2, 'Debian GNU/Linux 4(32-bit)', 'Debian GNU/Linux 4(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (44, 2, 'Debian GNU/Linux 4(64-bit)', 'Debian GNU/Linux 4(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (45, 2, 'Ubuntu Linux (32-bit)', 'Ubuntu Linux (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (46, 2, 'Ubuntu Linux (64-bit)', 'Ubuntu Linux (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (47, 2, 'Other 2.6x Linux (32-bit)', 'Other 2.6x Linux (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (48, 2, 'Other 2.6x Linux (64-bit)', 'Other 2.6x Linux (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (49, 2, 'Other Linux (32-bit)', 'Other Linux (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (50, 2, 'Other Linux (64-bit)', 'Other Linux (64-bit)'); - -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (51, 3, 'Novell Netware 6.x', 'Novell Netware 6.x'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (52, 3, 'Novell Netware 5.1', 'Novell Netware 5.1'); - -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (53, 4, 'Sun Solaris 10(32-bit)', 'Sun Solaris 10(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (54, 4, 'Sun Solaris 10(64-bit)', 'Sun Solaris 10(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (55, 4, 'Sun Solaris 9(Experimental)', 'Sun Solaris 9(Experimental)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (56, 4, 'Sun Solaris 8(Experimental)', 'Sun Solaris 8(Experimental)'); - -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (57, 5, 'FreeBSD (32-bit)', 'FreeBSD (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (58, 5, 'FreeBSD (64-bit)', 'FreeBSD (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (59, 5, 'OS/2', 'OS/2'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (60, 5, 'SCO OpenServer 5', 'SCO OpenServer 5'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (61, 5, 'SCO UnixWare 7', 'SCO UnixWare 7'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (62, 5, 'DOS', 'DOS'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (63, 5, 'Other (32-bit)', 'Other (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (64, 5, 'Other (64-bit)', 'Other (64-bit)'); - - --- temporarily added for vmware, will be moved when vmware support is fully in-place -INSERT INTO `cloud`.`host_master`(`type`, `service_address`, `admin`, `password`) VALUES('VSphere', 'vsphere-1.lab.vmops.com', 'Administrator', 'Suite219'); +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones) + VALUES (2, 'blank', 'BlankVM', 1, now(), 'ext3', 0, 32, 1, 'http://nfs1.lab.vmops.com/templates/vmware/blankvm.tar.bz2', '3eff7ce3d25cf9433efde8b245c63fcb', 0, 'BlankVM', 'VMDK', 47, 1, 1); +INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones) + VALUES (3, 'winxpsp3', 'WindowsXP-SP3', 1, now(), 'ntfs', 0, 32, 1, 'http://nfs1.lab.vmops.com/templates/vmware/winxpsp3.tar.bz2', '385e67d17a2cb3795bd0b0fb7f88dc5e', 0, 'WindowsXP-SP3', 'VMDK', 16, 1, 1); + +INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (1, 'Windows'); +INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (2, 'Linux'); +INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (3, 'Novell Netware'); +INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (4, 'Solaris'); +INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (5, 'Other'); + +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (1, 1, 'Microsoft Windows 7(32-bit)', 'Microsoft Windows 7(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (2, 1, 'Microsoft Windows 7(64-bit)', 'Microsoft Windows 7(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (3, 1, 'Microsoft Windows Server 2008 R2(64-bit)', 'Microsoft Windows Server 2008 R2(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (4, 1, 'Microsoft Windows Server 2008(32-bit)', 'Microsoft Windows Server 2008(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (5, 1, 'Microsoft Windows Server 2008(64-bit)', 'Windows Windows Server 2008(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (6, 1, 'Microsoft Windows Server 2003, Enterprise Edition (32-bit)', 'Microsoft Windows Server 2003, Enterprise Edition (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (7, 1, 'Microsoft Windows Server 2003, Enterprise Edition (64-bit)', 'Microsoft Windows Server 2003, Enterprise Edition (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (8, 1, 'Microsoft Windows Server 2003, Datacenter Edition (32-bit)', 'Microsoft Windows Server 2003, Datacenter Edition (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (9, 1, 'Microsoft Windows Server 2003, Datacenter Edition (64-bit)', 'Microsoft Windows Server 2003, Datacenter Edition (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (10, 1, 'Microsoft Windows Server 2003, Standard Edition (32-bit)', 'Microsoft Windows Server 2003, Standard Edition (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (11, 1, 'Microsoft Windows Server 2003, Standard Edition (64-bit)', 'Microsoft Windows Server 2003, Standard Edition (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (12, 1, 'Microsoft Windows Server 2003, Web Edition', 'Microsoft Windows Server 2003, Web Edition'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (13, 1, 'Microsoft Small Bussiness Server 2003', 'Microsoft Small Bussiness Server 2003'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (14, 1, 'Microsoft Windows Vista (32-bit)', 'Microsoft Windows Vista (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (15, 1, 'Microsoft Windows Vista (64-bit)', 'Microsoft Windows Vista (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (16, 1, 'Microsoft Windows XP Professional (32-bit)', 'Microsoft Windows XP Professional (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (17, 1, 'Microsoft Windows XP Professional (64-bit)', 'Microsoft Windows XP Professional (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (18, 1, 'Microsoft Windows 2000 Advanced Server', 'Microsoft Windows 2000 Advanced Server'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (19, 1, 'Microsoft Windows 2000 Server', 'Microsoft Windows 2000 Server'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (20, 1, 'Microsoft Windows 2000 Professional', 'Microsoft Windows 2000 Professional'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (21, 1, 'Microsoft Windows 98', 'Microsoft Windows 98'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (22, 1, 'Microsoft Windows 95', 'Microsoft Windows 95'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (23, 1, 'Microsoft Windows NT 4', 'Microsoft Windows NT 4'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (24, 1, 'Microsoft Windows 3.1', 'Microsoft Windows 3.1'); + +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (25, 2, 'Red Hat Enterprise Linux 5(32-bit)', 'Red Hat Enterprise Linux 5(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (26, 2, 'Red Hat Enterprise Linux 5(64-bit)', 'Red Hat Enterprise Linux 5(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (27, 2, 'Red Hat Enterprise Linux 4(32-bit)', 'Red Hat Enterprise Linux 4(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (28, 2, 'Red Hat Enterprise Linux 4(64-bit)', 'Red Hat Enterprise Linux 4(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (29, 2, 'Red Hat Enterprise Linux 3(32-bit)', 'Red Hat Enterprise Linux 3(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (30, 2, 'Red Hat Enterprise Linux 3(64-bit)', 'Red Hat Enterprise Linux 3(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (31, 2, 'Red Hat Enterprise Linux 2', 'Red Hat Enterprise Linux 2'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (32, 2, 'Suse Linux Enterprise 11(32-bit)', 'Suse Linux Enterprise 11(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (33, 2, 'Suse Linux Enterprise 11(64-bit)', 'Suse Linux Enterprise 11(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (34, 2, 'Suse Linux Enterprise 10(32-bit)', 'Suse Linux Enterprise 10(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (35, 2, 'Suse Linux Enterprise 10(64-bit)', 'Suse Linux Enterprise 10(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (36, 2, 'Suse Linux Enterprise 8/9(32-bit)', 'Suse Linux Enterprise 8/9(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (37, 2, 'Suse Linux Enterprise 8/9(64-bit)', 'Suse Linux Enterprise 8/9(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (38, 2, 'Open Enterprise Server', 'Open Enterprise Server'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (39, 2, 'Asianux 3(32-bit)', 'Asianux 3(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (40, 2, 'Asianux 3(64-bit)', 'Asianux 3(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (41, 2, 'Debian GNU/Linux 5(32-bit)', 'Debian GNU/Linux 5(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (42, 2, 'Debian GNU/Linux 5(64-bit)', 'Debian GNU/Linux 5(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (43, 2, 'Debian GNU/Linux 4(32-bit)', 'Debian GNU/Linux 4(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (44, 2, 'Debian GNU/Linux 4(64-bit)', 'Debian GNU/Linux 4(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (45, 2, 'Ubuntu Linux (32-bit)', 'Ubuntu Linux (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (46, 2, 'Ubuntu Linux (64-bit)', 'Ubuntu Linux (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (47, 2, 'Other 2.6x Linux (32-bit)', 'Other 2.6x Linux (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (48, 2, 'Other 2.6x Linux (64-bit)', 'Other 2.6x Linux (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (49, 2, 'Other Linux (32-bit)', 'Other Linux (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (50, 2, 'Other Linux (64-bit)', 'Other Linux (64-bit)'); + +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (51, 3, 'Novell Netware 6.x', 'Novell Netware 6.x'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (52, 3, 'Novell Netware 5.1', 'Novell Netware 5.1'); + +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (53, 4, 'Sun Solaris 10(32-bit)', 'Sun Solaris 10(32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (54, 4, 'Sun Solaris 10(64-bit)', 'Sun Solaris 10(64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (55, 4, 'Sun Solaris 9(Experimental)', 'Sun Solaris 9(Experimental)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (56, 4, 'Sun Solaris 8(Experimental)', 'Sun Solaris 8(Experimental)'); + +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (57, 5, 'FreeBSD (32-bit)', 'FreeBSD (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (58, 5, 'FreeBSD (64-bit)', 'FreeBSD (64-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (59, 5, 'OS/2', 'OS/2'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (60, 5, 'SCO OpenServer 5', 'SCO OpenServer 5'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (61, 5, 'SCO UnixWare 7', 'SCO UnixWare 7'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (62, 5, 'DOS', 'DOS'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (63, 5, 'Other (32-bit)', 'Other (32-bit)'); +INSERT INTO `cloud`.`guest_os` (id, category_id, name, display_name) VALUES (64, 5, 'Other (64-bit)', 'Other (64-bit)'); + + +-- temporarily added for vmware, will be moved when vmware support is fully in-place +INSERT INTO `cloud`.`host_master`(`type`, `service_address`, `admin`, `password`) VALUES('VSphere', 'vsphere-1.lab.vmops.com', 'Administrator', 'Suite219'); diff --git a/setup/db/templates.xenserver.sql b/setup/db/templates.xenserver.sql index bcca7fb03c1..c8b6d6d3718 100644 --- a/setup/db/templates.xenserver.sql +++ b/setup/db/templates.xenserver.sql @@ -1,15 +1,20 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones) VALUES (1, 'routing', 'SystemVM Template', 0, now(), 'ext3', 0, 64, 1, 'http://download.cloud.com/releases/2.2/systemvm.vhd.bz2', 'bcc7f290f4c27ab4d0fe95d1012829ea', 0, 'SystemVM Template', 'VHD', 15, 0, 1); INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones) From 5f0ece801452ea3214c47df8419891b1598023ba Mon Sep 17 00:00:00 2001 From: David Nalley Date: Tue, 26 Jun 2012 10:45:51 -0400 Subject: [PATCH 03/37] fixing line encoding --- core/src/com/cloud/storage/VolumeHostVO.java | 592 +++++++++---------- 1 file changed, 296 insertions(+), 296 deletions(-) diff --git a/core/src/com/cloud/storage/VolumeHostVO.java b/core/src/com/cloud/storage/VolumeHostVO.java index 3bba4e18d6e..9140da00bc0 100755 --- a/core/src/com/cloud/storage/VolumeHostVO.java +++ b/core/src/com/cloud/storage/VolumeHostVO.java @@ -1,296 +1,296 @@ -package com.cloud.storage; - -import java.util.Date; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; - -//import com.cloud.storage.VMVolumeStorageResourceAssoc.Status; -import com.cloud.storage.Storage.ImageFormat; -import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; -import com.cloud.utils.db.GenericDaoBase; - -/** - * Join table for storage hosts and volumes - * @author Nitin - * - */ -@Entity -@Table(name="volume_host_ref") -public class VolumeHostVO { - @Id - @GeneratedValue(strategy=GenerationType.IDENTITY) - Long id; - - @Column(name="host_id") - private long hostId; - - @Column(name="volume_id") - private long volumeId; - - @Column(name="zone_id") - private long zoneId; - - @Column(name=GenericDaoBase.CREATED_COLUMN) - private Date created = null; - - @Column(name="last_updated") - @Temporal(value=TemporalType.TIMESTAMP) - private Date lastUpdated = null; - - @Column (name="download_pct") - private int downloadPercent; - - @Column (name="size") - private long size; - - @Column (name="physical_size") - private long physicalSize; - - @Column (name="download_state") - @Enumerated(EnumType.STRING) - private Status downloadState; - - @Column(name="checksum") - private String checksum; - - @Column (name="local_path") - private String localDownloadPath; - - @Column (name="error_str") - private String errorString; - - @Column (name="job_id") - private String jobId; - - @Column (name="install_path") - private String installPath; - - @Column (name="url") - private String downloadUrl; - - @Column(name="format") - private Storage.ImageFormat format; - - @Column(name="destroyed") - boolean destroyed = false; - - - public String getInstallPath() { - return installPath; - } - - public long getHostId() { - return hostId; - } - - public void setHostId(long hostId) { - this.hostId = hostId; - } - - - public long getVolumeId() { - return volumeId; - } - - - public void setVolumeId(long volumeId) { - this.volumeId = volumeId; - } - - - public long getZoneId() { - return zoneId; - } - - public void setZoneId(long zoneId) { - this.zoneId = zoneId; - } - - public int getDownloadPercent() { - return downloadPercent; - } - - - public void setDownloadPercent(int downloadPercent) { - this.downloadPercent = downloadPercent; - } - - - public void setDownloadState(Status downloadState) { - this.downloadState = downloadState; - } - - - public long getId() { - return id; - } - - - public Date getCreated() { - return created; - } - - - public Date getLastUpdated() { - return lastUpdated; - } - - - public void setLastUpdated(Date date) { - lastUpdated = date; - } - - - public void setInstallPath(String installPath) { - this.installPath = installPath; - } - - - public Status getDownloadState() { - return downloadState; - } - - public String getChecksum() { - return checksum; - } - - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - public VolumeHostVO(long hostId, long volumeId) { - super(); - this.hostId = hostId; - this.volumeId = volumeId; - } - - public VolumeHostVO(long hostId, long volumeId, long zoneId, Date lastUpdated, - int downloadPercent, Status downloadState, - String localDownloadPath, String errorString, String jobId, - String installPath, String downloadUrl, String checksum, ImageFormat format) { - //super(); - this.hostId = hostId; - this.volumeId = volumeId; - this.zoneId = zoneId; - this.lastUpdated = lastUpdated; - this.downloadPercent = downloadPercent; - this.downloadState = downloadState; - this.localDownloadPath = localDownloadPath; - this.errorString = errorString; - this.jobId = jobId; - this.installPath = installPath; - this.setDownloadUrl(downloadUrl); - this.checksum = checksum; - this.format = format; - } - - protected VolumeHostVO() { - - } - - - public void setLocalDownloadPath(String localPath) { - this.localDownloadPath = localPath; - } - - - public String getLocalDownloadPath() { - return localDownloadPath; - } - - - public void setErrorString(String errorString) { - this.errorString = errorString; - } - - - public String getErrorString() { - return errorString; - } - - - public void setJobId(String jobId) { - this.jobId = jobId; - } - - - public String getJobId() { - return jobId; - } - - - public boolean equals(Object obj) { - if (obj instanceof VolumeHostVO) { - VolumeHostVO other = (VolumeHostVO)obj; - return (this.volumeId==other.getVolumeId() && this.hostId==other.getHostId()); - } - return false; - } - - - public int hashCode() { - Long tid = new Long(volumeId); - Long hid = new Long(hostId); - return tid.hashCode()+hid.hashCode(); - } - - public void setSize(long size) { - this.size = size; - } - - public long getSize() { - return size; - } - - - public void setPhysicalSize(long physicalSize) { - this.physicalSize = physicalSize; - } - - public long getPhysicalSize() { - return physicalSize; - } - - public void setDestroyed(boolean destroyed) { - this.destroyed = destroyed; - } - - public boolean getDestroyed() { - return destroyed; - } - - public void setDownloadUrl(String downloadUrl) { - this.downloadUrl = downloadUrl; - } - - public String getDownloadUrl() { - return downloadUrl; - } - - public Storage.ImageFormat getFormat() { - return format; - } - - public void setFormat(Storage.ImageFormat format) { - this.format = format; - } - - public long getVolumeSize() { - return -1; - } - - - public String toString() { - return new StringBuilder("VolumeHost[").append(id).append("-").append(volumeId).append("-").append(hostId).append(installPath).append("]").toString(); - } - -} +package com.cloud.storage; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +//import com.cloud.storage.VMVolumeStorageResourceAssoc.Status; +import com.cloud.storage.Storage.ImageFormat; +import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; +import com.cloud.utils.db.GenericDaoBase; + +/** + * Join table for storage hosts and volumes + * @author Nitin + * + */ +@Entity +@Table(name="volume_host_ref") +public class VolumeHostVO { + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + Long id; + + @Column(name="host_id") + private long hostId; + + @Column(name="volume_id") + private long volumeId; + + @Column(name="zone_id") + private long zoneId; + + @Column(name=GenericDaoBase.CREATED_COLUMN) + private Date created = null; + + @Column(name="last_updated") + @Temporal(value=TemporalType.TIMESTAMP) + private Date lastUpdated = null; + + @Column (name="download_pct") + private int downloadPercent; + + @Column (name="size") + private long size; + + @Column (name="physical_size") + private long physicalSize; + + @Column (name="download_state") + @Enumerated(EnumType.STRING) + private Status downloadState; + + @Column(name="checksum") + private String checksum; + + @Column (name="local_path") + private String localDownloadPath; + + @Column (name="error_str") + private String errorString; + + @Column (name="job_id") + private String jobId; + + @Column (name="install_path") + private String installPath; + + @Column (name="url") + private String downloadUrl; + + @Column(name="format") + private Storage.ImageFormat format; + + @Column(name="destroyed") + boolean destroyed = false; + + + public String getInstallPath() { + return installPath; + } + + public long getHostId() { + return hostId; + } + + public void setHostId(long hostId) { + this.hostId = hostId; + } + + + public long getVolumeId() { + return volumeId; + } + + + public void setVolumeId(long volumeId) { + this.volumeId = volumeId; + } + + + public long getZoneId() { + return zoneId; + } + + public void setZoneId(long zoneId) { + this.zoneId = zoneId; + } + + public int getDownloadPercent() { + return downloadPercent; + } + + + public void setDownloadPercent(int downloadPercent) { + this.downloadPercent = downloadPercent; + } + + + public void setDownloadState(Status downloadState) { + this.downloadState = downloadState; + } + + + public long getId() { + return id; + } + + + public Date getCreated() { + return created; + } + + + public Date getLastUpdated() { + return lastUpdated; + } + + + public void setLastUpdated(Date date) { + lastUpdated = date; + } + + + public void setInstallPath(String installPath) { + this.installPath = installPath; + } + + + public Status getDownloadState() { + return downloadState; + } + + public String getChecksum() { + return checksum; + } + + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + public VolumeHostVO(long hostId, long volumeId) { + super(); + this.hostId = hostId; + this.volumeId = volumeId; + } + + public VolumeHostVO(long hostId, long volumeId, long zoneId, Date lastUpdated, + int downloadPercent, Status downloadState, + String localDownloadPath, String errorString, String jobId, + String installPath, String downloadUrl, String checksum, ImageFormat format) { + //super(); + this.hostId = hostId; + this.volumeId = volumeId; + this.zoneId = zoneId; + this.lastUpdated = lastUpdated; + this.downloadPercent = downloadPercent; + this.downloadState = downloadState; + this.localDownloadPath = localDownloadPath; + this.errorString = errorString; + this.jobId = jobId; + this.installPath = installPath; + this.setDownloadUrl(downloadUrl); + this.checksum = checksum; + this.format = format; + } + + protected VolumeHostVO() { + + } + + + public void setLocalDownloadPath(String localPath) { + this.localDownloadPath = localPath; + } + + + public String getLocalDownloadPath() { + return localDownloadPath; + } + + + public void setErrorString(String errorString) { + this.errorString = errorString; + } + + + public String getErrorString() { + return errorString; + } + + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + + public String getJobId() { + return jobId; + } + + + public boolean equals(Object obj) { + if (obj instanceof VolumeHostVO) { + VolumeHostVO other = (VolumeHostVO)obj; + return (this.volumeId==other.getVolumeId() && this.hostId==other.getHostId()); + } + return false; + } + + + public int hashCode() { + Long tid = new Long(volumeId); + Long hid = new Long(hostId); + return tid.hashCode()+hid.hashCode(); + } + + public void setSize(long size) { + this.size = size; + } + + public long getSize() { + return size; + } + + + public void setPhysicalSize(long physicalSize) { + this.physicalSize = physicalSize; + } + + public long getPhysicalSize() { + return physicalSize; + } + + public void setDestroyed(boolean destroyed) { + this.destroyed = destroyed; + } + + public boolean getDestroyed() { + return destroyed; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public Storage.ImageFormat getFormat() { + return format; + } + + public void setFormat(Storage.ImageFormat format) { + this.format = format; + } + + public long getVolumeSize() { + return -1; + } + + + public String toString() { + return new StringBuilder("VolumeHost[").append(id).append("-").append(volumeId).append("-").append(hostId).append(installPath).append("]").toString(); + } + +} From 968752071291f3cc47b86ff67289d7cfc7cac3dd Mon Sep 17 00:00:00 2001 From: David Nalley Date: Tue, 26 Jun 2012 10:46:53 -0400 Subject: [PATCH 04/37] applying Chip Childer's patches for license headers in the ui directory --- ui/scripts/accounts.js | 28 ++++++++++++---------- ui/scripts/cloud.core.callbacks.js | 28 ++++++++++++---------- ui/scripts/cloudStack.js | 28 ++++++++++++---------- ui/scripts/configuration.js | 28 ++++++++++++---------- ui/scripts/dashboard.js | 28 ++++++++++++---------- ui/scripts/domains.js | 28 ++++++++++++---------- ui/scripts/events.js | 28 ++++++++++++---------- ui/scripts/globalSettings.js | 28 ++++++++++++---------- ui/scripts/installWizard.js | 28 ++++++++++++---------- ui/scripts/instances.js | 28 ++++++++++++---------- ui/scripts/lbStickyPolicy.js | 28 ++++++++++++---------- ui/scripts/network.js | 28 ++++++++++++---------- ui/scripts/projects.js | 28 ++++++++++++---------- ui/scripts/sharedFunctions.js | 28 ++++++++++++---------- ui/scripts/storage.js | 28 ++++++++++++---------- ui/scripts/system.js | 28 ++++++++++++---------- ui/scripts/templates.js | 28 ++++++++++++---------- ui/scripts/ui-custom/dashboard.js | 26 +++++++++++--------- ui/scripts/ui-custom/enableStaticNAT.js | 26 +++++++++++--------- ui/scripts/ui-custom/installWizard.js | 26 +++++++++++--------- ui/scripts/ui-custom/instanceWizard.js | 26 +++++++++++--------- ui/scripts/ui-custom/ipRules.js | 26 +++++++++++--------- ui/scripts/ui-custom/login.js | 26 +++++++++++--------- ui/scripts/ui-custom/physicalResources.js | 26 +++++++++++--------- ui/scripts/ui-custom/projects.js | 26 +++++++++++--------- ui/scripts/ui-custom/recurringSnapshots.js | 26 +++++++++++--------- ui/scripts/ui-custom/securityRules.js | 26 +++++++++++--------- ui/scripts/ui-custom/uploadVolume.js | 16 +++++++++++++ ui/scripts/ui-custom/zoneChart.js | 26 +++++++++++--------- ui/scripts/ui-custom/zoneWizard.js | 26 +++++++++++--------- ui/scripts/ui/core.js | 26 +++++++++++--------- ui/scripts/ui/dialog.js | 26 +++++++++++--------- ui/scripts/ui/events.js | 26 +++++++++++--------- ui/scripts/ui/utils.js | 26 +++++++++++--------- ui/scripts/ui/widgets/cloudBrowser.js | 26 +++++++++++--------- ui/scripts/ui/widgets/dataTable.js | 26 +++++++++++--------- ui/scripts/ui/widgets/detailView.js | 26 +++++++++++--------- ui/scripts/ui/widgets/listView.js | 26 +++++++++++--------- ui/scripts/ui/widgets/multiEdit.js | 26 +++++++++++--------- ui/scripts/ui/widgets/notifications.js | 26 +++++++++++--------- ui/scripts/ui/widgets/overlay.js | 26 +++++++++++--------- ui/scripts/ui/widgets/treeView.js | 26 +++++++++++--------- ui/scripts/zoneWizard.js | 28 ++++++++++++---------- ui/tests/test.cloudBrowser.js | 28 ++++++++++++---------- ui/tests/test.core.js | 28 ++++++++++++---------- ui/tests/test.detailView.js | 26 +++++++++++--------- ui/tests/test.listView.js | 28 ++++++++++++---------- ui/tests/test.multiEdit.js | 28 ++++++++++++---------- ui/tests/test.notifications.js | 28 ++++++++++++---------- 49 files changed, 759 insertions(+), 551 deletions(-) diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index 6d67d7a332c..eafe5c5f271 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack) { var domainObjs; diff --git a/ui/scripts/cloud.core.callbacks.js b/ui/scripts/cloud.core.callbacks.js index 505b739115d..857c247d9d1 100644 --- a/ui/scripts/cloud.core.callbacks.js +++ b/ui/scripts/cloud.core.callbacks.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); if (!results) { return 0; } return results[1] || 0;} /* diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index c528a154dfd..1decd685637 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack, $) { $.extend(cloudStack, { home: 'dashboard', diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 22bf47f861e..4a8f9586d90 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/02/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack, $) { var requiredNetworkOfferingExists = false; diff --git a/ui/scripts/dashboard.js b/ui/scripts/dashboard.js index 07581779d45..ce723f7ce7d 100644 --- a/ui/scripts/dashboard.js +++ b/ui/scripts/dashboard.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { // Admin dashboard cloudStack.sections.dashboard = { diff --git a/ui/scripts/domains.js b/ui/scripts/domains.js index 9179b42c14f..b288e24db22 100644 --- a/ui/scripts/domains.js +++ b/ui/scripts/domains.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack) { cloudStack.sections.domains = { title: 'label.menu.domains', diff --git a/ui/scripts/events.js b/ui/scripts/events.js index b3c010d2e18..37eadbd019f 100644 --- a/ui/scripts/events.js +++ b/ui/scripts/events.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack) { cloudStack.sections.events = { title: 'label.menu.events', diff --git a/ui/scripts/globalSettings.js b/ui/scripts/globalSettings.js index fdaaa0413ef..0ae73ca9c5f 100644 --- a/ui/scripts/globalSettings.js +++ b/ui/scripts/globalSettings.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack) { cloudStack.sections['global-settings'] = { title: 'label.menu.global.settings', diff --git a/ui/scripts/installWizard.js b/ui/scripts/installWizard.js index 2ac5bb27441..ce136d7dc13 100644 --- a/ui/scripts/installWizard.js +++ b/ui/scripts/installWizard.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { cloudStack.installWizard = { // Check if install wizard should be invoked diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index b892fd7e5b2..4a143607cf2 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { var zoneObjs, hypervisorObjs, featuredTemplateObjs, communityTemplateObjs, myTemplateObjs, featuredIsoObjs, communityIsoObjs, myIsoObjs, serviceOfferingObjs, diskOfferingObjs, networkOfferingObjs, physicalNetworkObjs; diff --git a/ui/scripts/lbStickyPolicy.js b/ui/scripts/lbStickyPolicy.js index 542a23d5be3..c38da92dff9 100644 --- a/ui/scripts/lbStickyPolicy.js +++ b/ui/scripts/lbStickyPolicy.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { cloudStack.lbStickyPolicy = { dialog: function(args) { diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 1661a8f8421..597186ee257 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack, $) { var ipChangeNotice = function() { diff --git a/ui/scripts/projects.js b/ui/scripts/projects.js index 6132e793f84..6a99939d45b 100644 --- a/ui/scripts/projects.js +++ b/ui/scripts/projects.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack) { cloudStack.projects = { requireInvitation: function(args) { diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index e7d2aeb7d56..b1d771c67f2 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/02/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. var g_mySession = null; var g_sessionKey = null; var g_role = null; // roles - root, domain-admin, ro-admin, user diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 6f90d699f21..92e7b506c97 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack) { var diskofferingObjs, selectedDiskOfferingObj; diff --git a/ui/scripts/system.js b/ui/scripts/system.js index f6a5540a6e0..541aabc45d0 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/02/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { var zoneObjs, podObjs, clusterObjs, domainObjs, networkOfferingObjs, physicalNetworkObjs; diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index e49b94ff52c..bf34f925fb7 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack, $) { cloudStack.sections.templates = { diff --git a/ui/scripts/ui-custom/dashboard.js b/ui/scripts/ui-custom/dashboard.js index 4b53eb0a0e0..0ae8bb1a598 100644 --- a/ui/scripts/ui-custom/dashboard.js +++ b/ui/scripts/ui-custom/dashboard.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { cloudStack.uiCustom.dashboard = function() { /** diff --git a/ui/scripts/ui-custom/enableStaticNAT.js b/ui/scripts/ui-custom/enableStaticNAT.js index ef645f43f0e..ad4fbc46825 100644 --- a/ui/scripts/ui-custom/enableStaticNAT.js +++ b/ui/scripts/ui-custom/enableStaticNAT.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack, $) { cloudStack.uiCustom.enableStaticNAT = function(args) { var listView = args.listView; diff --git a/ui/scripts/ui-custom/installWizard.js b/ui/scripts/ui-custom/installWizard.js index ee2fcd86a73..96d9d5c5d94 100644 --- a/ui/scripts/ui-custom/installWizard.js +++ b/ui/scripts/ui-custom/installWizard.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { var installWizard = function(args) { var context = args.context; diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index c4980300ca3..c92c0275337 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { /** * Instance wizard diff --git a/ui/scripts/ui-custom/ipRules.js b/ui/scripts/ui-custom/ipRules.js index 5979f7560d9..a2f721a882f 100644 --- a/ui/scripts/ui-custom/ipRules.js +++ b/ui/scripts/ui-custom/ipRules.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { cloudStack.ipRules = function(args) { return function(detailArgs) { diff --git a/ui/scripts/ui-custom/login.js b/ui/scripts/ui-custom/login.js index 40d8aebbe4c..72b3c6c728a 100644 --- a/ui/scripts/ui-custom/login.js +++ b/ui/scripts/ui-custom/login.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { /** * Login process diff --git a/ui/scripts/ui-custom/physicalResources.js b/ui/scripts/ui-custom/physicalResources.js index e531c7b783a..a247dcfe2c2 100644 --- a/ui/scripts/ui-custom/physicalResources.js +++ b/ui/scripts/ui-custom/physicalResources.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack, $) { cloudStack.uiCustom.physicalResources = function(args) { var listView = function(targetID) { diff --git a/ui/scripts/ui-custom/projects.js b/ui/scripts/ui-custom/projects.js index 51b4268ad41..e10a8f16f3a 100644 --- a/ui/scripts/ui-custom/projects.js +++ b/ui/scripts/ui-custom/projects.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack, $) { var pageElems = cloudStack.uiCustom.projectsTabs = { /** diff --git a/ui/scripts/ui-custom/recurringSnapshots.js b/ui/scripts/ui-custom/recurringSnapshots.js index 93ba299796d..e5302e9e1d5 100644 --- a/ui/scripts/ui-custom/recurringSnapshots.js +++ b/ui/scripts/ui-custom/recurringSnapshots.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack, $) { cloudStack.uiCustom.recurringSnapshots = function(args) { var desc = args.desc; diff --git a/ui/scripts/ui-custom/securityRules.js b/ui/scripts/ui-custom/securityRules.js index 6f2df583d0e..2e2c9acad48 100644 --- a/ui/scripts/ui-custom/securityRules.js +++ b/ui/scripts/ui-custom/securityRules.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { cloudStack.uiCustom.securityRules = function(args) { var multiEdit = args; diff --git a/ui/scripts/ui-custom/uploadVolume.js b/ui/scripts/ui-custom/uploadVolume.js index 84d0235196d..996d8ace486 100644 --- a/ui/scripts/ui-custom/uploadVolume.js +++ b/ui/scripts/ui-custom/uploadVolume.js @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack, $) { cloudStack.uiCustom.uploadVolume = function(args) { var listView = args.listView; diff --git a/ui/scripts/ui-custom/zoneChart.js b/ui/scripts/ui-custom/zoneChart.js index dfe26e91f3c..dcc6dacc6c5 100644 --- a/ui/scripts/ui-custom/zoneChart.js +++ b/ui/scripts/ui-custom/zoneChart.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { /** * Zone details chart diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js index d46bad9800b..3928619565c 100644 --- a/ui/scripts/ui-custom/zoneWizard.js +++ b/ui/scripts/ui-custom/zoneWizard.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { /** * Serialize form data as object diff --git a/ui/scripts/ui/core.js b/ui/scripts/ui/core.js index ac691eb21e6..a1c58a7d9f9 100644 --- a/ui/scripts/ui/core.js +++ b/ui/scripts/ui/core.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { $.extend(cloudStack, { ui: { diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 50c4ed77b6a..fe3cbf2e338 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { cloudStack.dialog = { /** diff --git a/ui/scripts/ui/events.js b/ui/scripts/ui/events.js index e4d510b9831..bd609d2ddff 100644 --- a/ui/scripts/ui/events.js +++ b/ui/scripts/ui/events.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { cloudStack.ui.event = { // Attach element to specific event type diff --git a/ui/scripts/ui/utils.js b/ui/scripts/ui/utils.js index 2dc97debb2e..567f566d96e 100644 --- a/ui/scripts/ui/utils.js +++ b/ui/scripts/ui/utils.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { // General utils cloudStack.serializeForm = function($form, options) { diff --git a/ui/scripts/ui/widgets/cloudBrowser.js b/ui/scripts/ui/widgets/cloudBrowser.js index a2c7bd69c8b..c83527da5e6 100644 --- a/ui/scripts/ui/widgets/cloudBrowser.js +++ b/ui/scripts/ui/widgets/cloudBrowser.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { cloudStack.ui.widgets.browser = {}; diff --git a/ui/scripts/ui/widgets/dataTable.js b/ui/scripts/ui/widgets/dataTable.js index 2e733721cbb..176dfd1589c 100644 --- a/ui/scripts/ui/widgets/dataTable.js +++ b/ui/scripts/ui/widgets/dataTable.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($) { /** * Convert table to be resizable and sortable diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js index c7cc716ea75..80e99f6e372 100644 --- a/ui/scripts/ui/widgets/detailView.js +++ b/ui/scripts/ui/widgets/detailView.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack, _l) { var replaceListViewItem = function($detailView, newData) { var $row = $detailView.data('list-view-row'); diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js index 0f20592b0c5..92a862428a4 100644 --- a/ui/scripts/ui/widgets/listView.js +++ b/ui/scripts/ui/widgets/listView.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * Create dynamic list view based on data callbacks */ diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js index ee7fd3ae752..0481dda7c51 100644 --- a/ui/scripts/ui/widgets/multiEdit.js +++ b/ui/scripts/ui/widgets/multiEdit.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { var _medit = cloudStack.ui.widgets.multiEdit = { /** diff --git a/ui/scripts/ui/widgets/notifications.js b/ui/scripts/ui/widgets/notifications.js index c63c0f299d6..5ab5fcc444b 100644 --- a/ui/scripts/ui/widgets/notifications.js +++ b/ui/scripts/ui/widgets/notifications.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack, _l) { /** * Notification handling diff --git a/ui/scripts/ui/widgets/overlay.js b/ui/scripts/ui/widgets/overlay.js index cff04a05f69..296b58a1a3d 100644 --- a/ui/scripts/ui/widgets/overlay.js +++ b/ui/scripts/ui/widgets/overlay.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($) { /** * Create a dark overlay, for modal dialogs, etc. diff --git a/ui/scripts/ui/widgets/treeView.js b/ui/scripts/ui/widgets/treeView.js index cd2776a7895..fa1ceb6cffe 100644 --- a/ui/scripts/ui/widgets/treeView.js +++ b/ui/scripts/ui/widgets/treeView.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack, _s) { /** * Make
    of tree items diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 5843001dce4..92015bb5bb1 100644 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function(cloudStack, $) { var selectedNetworkOfferingHavingSG = false; var selectedNetworkOfferingHavingEIP = false; diff --git a/ui/tests/test.cloudBrowser.js b/ui/tests/test.cloudBrowser.js index 441fd398bf5..4a27821285b 100644 --- a/ui/tests/test.cloudBrowser.js +++ b/ui/tests/test.cloudBrowser.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($) { var $browser, $breadcrumbs, $browserContainer; diff --git a/ui/tests/test.core.js b/ui/tests/test.core.js index 38cabfed404..8ccab7d9e20 100644 --- a/ui/tests/test.core.js +++ b/ui/tests/test.core.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($) { var $cloudStack, cloudStack; diff --git a/ui/tests/test.detailView.js b/ui/tests/test.detailView.js index 413e28dac20..6098300811e 100644 --- a/ui/tests/test.detailView.js +++ b/ui/tests/test.detailView.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Automatically generated by addcopyright.py at 04/03/2012 +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($) { module('Detail view', { setup: function() { diff --git a/ui/tests/test.listView.js b/ui/tests/test.listView.js index 55a8c54ed12..3449ab29234 100644 --- a/ui/tests/test.listView.js +++ b/ui/tests/test.listView.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($) { module('List view', { setup: function() { diff --git a/ui/tests/test.multiEdit.js b/ui/tests/test.multiEdit.js index 4e5eb30de52..aea072935fe 100644 --- a/ui/tests/test.multiEdit.js +++ b/ui/tests/test.multiEdit.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($) { module('Mutli-edit'); diff --git a/ui/tests/test.notifications.js b/ui/tests/test.notifications.js index e880769340e..b0ce313e5cd 100644 --- a/ui/tests/test.notifications.js +++ b/ui/tests/test.notifications.js @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($) { var $notifications, $notificationBox, $cloudStack, cloudStack; From bc1c89790181c233debbdf5bccfac9595d35c1b2 Mon Sep 17 00:00:00 2001 From: David Nalley Date: Tue, 26 Jun 2012 10:51:23 -0400 Subject: [PATCH 05/37] Chip Childers patch for fixing license headers - awsapi-setup https://reviews.apache.org/r/5438/ --- .../db/mysql/cloudbridge_bucketpolicy.sql | 18 ++ awsapi-setup/db/mysql/cloudbridge_db.sql | 18 ++ awsapi-setup/db/mysql/cloudbridge_index.sql | 111 ++++--- .../db/mysql/cloudbridge_multipart.sql | 17 + .../db/mysql/cloudbridge_multipart_alter.sql | 18 ++ .../db/mysql/cloudbridge_offering.sql | 18 ++ .../db/mysql/cloudbridge_offering_alter.sql | 18 ++ .../db/mysql/cloudbridge_policy_alter.sql | 18 ++ awsapi-setup/db/mysql/cloudbridge_schema.sql | 306 +++++++++--------- awsapi-setup/db/mysql/deploy-db-bridge.sh | 19 +- awsapi-setup/init/debian/cloud-bridge | 16 + awsapi-setup/init/rpm/cloud-bridge | 17 + awsapi-setup/setup/cloud-setup-bridge | 17 + .../setup/cloudstack-aws-api-register | 17 + 14 files changed, 434 insertions(+), 194 deletions(-) diff --git a/awsapi-setup/db/mysql/cloudbridge_bucketpolicy.sql b/awsapi-setup/db/mysql/cloudbridge_bucketpolicy.sql index 9d6a650b09e..44019f1315b 100644 --- a/awsapi-setup/db/mysql/cloudbridge_bucketpolicy.sql +++ b/awsapi-setup/db/mysql/cloudbridge_bucketpolicy.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + USE cloudbridge; -- This file (and cloudbridge_policy_alter.sql) can be applied to an existing cloudbridge diff --git a/awsapi-setup/db/mysql/cloudbridge_db.sql b/awsapi-setup/db/mysql/cloudbridge_db.sql index 04ea41a75b9..952a34d9fb8 100644 --- a/awsapi-setup/db/mysql/cloudbridge_db.sql +++ b/awsapi-setup/db/mysql/cloudbridge_db.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI'; DROP DATABASE IF EXISTS cloudbridge; diff --git a/awsapi-setup/db/mysql/cloudbridge_index.sql b/awsapi-setup/db/mysql/cloudbridge_index.sql index d00e5d87acb..e099b658a4d 100644 --- a/awsapi-setup/db/mysql/cloudbridge_index.sql +++ b/awsapi-setup/db/mysql/cloudbridge_index.sql @@ -1,47 +1,64 @@ -USE cloudbridge; - -ALTER TABLE shost ADD UNIQUE shost_uq_host(Host, HostType, ExportRoot); -ALTER TABLE shost ADD CONSTRAINT FOREIGN KEY shost_fk_mhost_id(MHostID) REFERENCES mhost(ID); -ALTER TABLE shost ADD INDEX shost_idx_mhost_id(MHostID); - -ALTER TABLE sbucket ADD UNIQUE sbucket_uq_name(Name); -ALTER TABLE sbucket ADD CONSTRAINT FOREIGN KEY sbucket_fk_shost_id(SHostID) REFERENCES shost(ID); -ALTER TABLE sbucket ADD INDEX sbucket_idx_shost_id(SHostID); -ALTER TABLE sbucket ADD INDEX sbucket_idx_owner_cid(OwnerCanonicalID); -ALTER TABLE sbucket ADD INDEX sbucket_idx_create_time(CreateTime); - -ALTER TABLE sobject ADD CONSTRAINT FOREIGN KEY sobject_fk_sbuckt_id(SBucketID) REFERENCES sbucket(ID) ON DELETE CASCADE; -ALTER TABLE sobject ADD INDEX sobject_idx_bucket_id(SBucketID); -ALTER TABLE sobject ADD INDEX sobject_idx_owner_cid(OwnerCanonicalID); -ALTER TABLE sobject ADD UNIQUE sobject_uq_sbucket_id_name_key(SBucketID, NameKey); -ALTER TABLE sobject ADD INDEX sobject_idx_create_time(CreateTime); - -ALTER TABLE sobject_item ADD CONSTRAINT FOREIGN KEY sobject_item_fk_object_id(SObjectID) REFERENCES sobject(ID) ON DELETE CASCADE; -ALTER TABLE sobject_item ADD INDEX sobject_item_idx_object_id(SObjectID); -ALTER TABLE sobject_item ADD UNIQUE sobject_item_uq_sobject_id_version(SObjectID, Version); -ALTER TABLE sobject_item ADD INDEX sobject_item_idx_create_time(CreateTime); -ALTER TABLE sobject_item ADD INDEX sobject_item_idx_modify_time(LastModifiedTime); -ALTER TABLE sobject_item ADD INDEX sobject_item_idx_access_time(LastAccessTime); -ALTER TABLE sobject_item ADD INDEX sobject_item_idx_stored_size(StoredSize); - -ALTER TABLE meta ADD UNIQUE meta_uq_target_name(Target, TargetID, Name); -ALTER TABLE meta ADD INDEX meta_idx_target(Target, TargetID); - -ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings1(AccessKey); -ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings2(CertUniqueId); -ALTER TABLE usercredentials ADD INDEX usercredentials_idx_access(AccessKey); -ALTER TABLE usercredentials ADD INDEX usercredentials_idx_cert(CertUniqueId); - -ALTER TABLE acl ADD INDEX acl_idx_target(Target, TargetID); -ALTER TABLE acl ADD INDEX acl_idx_modify_time(LastModifiedTime); - -ALTER TABLE mhost ADD UNIQUE mhost_uq_host(Host); -ALTER TABLE mhost ADD INDEX mhost_idx_mhost_key(MHostKey); -ALTER TABLE mhost ADD INDEX mhost_idx_heartbeat_time(LastHeartbeatTime); - -ALTER TABLE mhost_mount ADD UNIQUE mhost_mnt_uq_mhost_shost(MHostID, SHostID); -ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_mhost_id(MHostID) REFERENCES mhost(ID) ON DELETE CASCADE; -ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_shost_id(SHostID) REFERENCES shost(ID) ON DELETE CASCADE; -ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mhost_id(MHostID); -ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_shost_id(SHostID); -ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mount_time(LastMountTime); +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +USE cloudbridge; + +ALTER TABLE shost ADD UNIQUE shost_uq_host(Host, HostType, ExportRoot); +ALTER TABLE shost ADD CONSTRAINT FOREIGN KEY shost_fk_mhost_id(MHostID) REFERENCES mhost(ID); +ALTER TABLE shost ADD INDEX shost_idx_mhost_id(MHostID); + +ALTER TABLE sbucket ADD UNIQUE sbucket_uq_name(Name); +ALTER TABLE sbucket ADD CONSTRAINT FOREIGN KEY sbucket_fk_shost_id(SHostID) REFERENCES shost(ID); +ALTER TABLE sbucket ADD INDEX sbucket_idx_shost_id(SHostID); +ALTER TABLE sbucket ADD INDEX sbucket_idx_owner_cid(OwnerCanonicalID); +ALTER TABLE sbucket ADD INDEX sbucket_idx_create_time(CreateTime); + +ALTER TABLE sobject ADD CONSTRAINT FOREIGN KEY sobject_fk_sbuckt_id(SBucketID) REFERENCES sbucket(ID) ON DELETE CASCADE; +ALTER TABLE sobject ADD INDEX sobject_idx_bucket_id(SBucketID); +ALTER TABLE sobject ADD INDEX sobject_idx_owner_cid(OwnerCanonicalID); +ALTER TABLE sobject ADD UNIQUE sobject_uq_sbucket_id_name_key(SBucketID, NameKey); +ALTER TABLE sobject ADD INDEX sobject_idx_create_time(CreateTime); + +ALTER TABLE sobject_item ADD CONSTRAINT FOREIGN KEY sobject_item_fk_object_id(SObjectID) REFERENCES sobject(ID) ON DELETE CASCADE; +ALTER TABLE sobject_item ADD INDEX sobject_item_idx_object_id(SObjectID); +ALTER TABLE sobject_item ADD UNIQUE sobject_item_uq_sobject_id_version(SObjectID, Version); +ALTER TABLE sobject_item ADD INDEX sobject_item_idx_create_time(CreateTime); +ALTER TABLE sobject_item ADD INDEX sobject_item_idx_modify_time(LastModifiedTime); +ALTER TABLE sobject_item ADD INDEX sobject_item_idx_access_time(LastAccessTime); +ALTER TABLE sobject_item ADD INDEX sobject_item_idx_stored_size(StoredSize); + +ALTER TABLE meta ADD UNIQUE meta_uq_target_name(Target, TargetID, Name); +ALTER TABLE meta ADD INDEX meta_idx_target(Target, TargetID); + +ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings1(AccessKey); +ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings2(CertUniqueId); +ALTER TABLE usercredentials ADD INDEX usercredentials_idx_access(AccessKey); +ALTER TABLE usercredentials ADD INDEX usercredentials_idx_cert(CertUniqueId); + +ALTER TABLE acl ADD INDEX acl_idx_target(Target, TargetID); +ALTER TABLE acl ADD INDEX acl_idx_modify_time(LastModifiedTime); + +ALTER TABLE mhost ADD UNIQUE mhost_uq_host(Host); +ALTER TABLE mhost ADD INDEX mhost_idx_mhost_key(MHostKey); +ALTER TABLE mhost ADD INDEX mhost_idx_heartbeat_time(LastHeartbeatTime); + +ALTER TABLE mhost_mount ADD UNIQUE mhost_mnt_uq_mhost_shost(MHostID, SHostID); +ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_mhost_id(MHostID) REFERENCES mhost(ID) ON DELETE CASCADE; +ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_shost_id(SHostID) REFERENCES shost(ID) ON DELETE CASCADE; +ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mhost_id(MHostID); +ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_shost_id(SHostID); +ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mount_time(LastMountTime); diff --git a/awsapi-setup/db/mysql/cloudbridge_multipart.sql b/awsapi-setup/db/mysql/cloudbridge_multipart.sql index 27456c4f41b..e30c0ce4dee 100644 --- a/awsapi-setup/db/mysql/cloudbridge_multipart.sql +++ b/awsapi-setup/db/mysql/cloudbridge_multipart.sql @@ -1,3 +1,20 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + USE cloudbridge; -- This file can be applied to an existing cloudbridge database. It is used diff --git a/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql b/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql index 203bf3aa9c8..2614aaff459 100644 --- a/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql +++ b/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + USE cloudbridge; ALTER TABLE multipart_meta ADD CONSTRAINT FOREIGN KEY meta_uploads_id(UploadID) REFERENCES multipart_uploads(ID) ON DELETE CASCADE; diff --git a/awsapi-setup/db/mysql/cloudbridge_offering.sql b/awsapi-setup/db/mysql/cloudbridge_offering.sql index 064fd93fe7f..f21af5aff32 100644 --- a/awsapi-setup/db/mysql/cloudbridge_offering.sql +++ b/awsapi-setup/db/mysql/cloudbridge_offering.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + USE cloudbridge; -- This file (and cloudbridge_offering_alter.sql) can be applied to an existing cloudbridge diff --git a/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql b/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql index c44df79f479..bffb34d1d24 100644 --- a/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql +++ b/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + USE cloudbridge; ALTER TABLE offering_bundle ADD UNIQUE one_offering (AmazonEC2Offering); diff --git a/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql b/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql index 311a86528e7..53ab40bae39 100644 --- a/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql +++ b/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql @@ -1,3 +1,21 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + USE cloudbridge; ALTER TABLE bucket_policies ADD UNIQUE one_policy_per_bucket(BucketName); diff --git a/awsapi-setup/db/mysql/cloudbridge_schema.sql b/awsapi-setup/db/mysql/cloudbridge_schema.sql index f4b21a04376..de22f113086 100644 --- a/awsapi-setup/db/mysql/cloudbridge_schema.sql +++ b/awsapi-setup/db/mysql/cloudbridge_schema.sql @@ -1,144 +1,162 @@ -USE cloudbridge; - -SET foreign_key_checks = 0; - -DROP TABLE IF EXISTS shost; -DROP TABLE IF EXISTS mhost; -DROP TABLE IF EXISTS mhost_mount; -DROP TABLE IF EXISTS sbucket; -DROP TABLE IF EXISTS sobject; -DROP TABLE IF EXISTS sobject_item; -DROP TABLE IF EXISTS meta; -DROP TABLE IF EXISTS acl; -DROP TABLE IF EXISTS usercredentials; - --- storage host -CREATE TABLE shost ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Host VARCHAR(128) NOT NULL, - HostType INT NOT NULL DEFAULT 0, -- 0 : local, 1 : nfs - ExportRoot VARCHAR(128) NOT NULL, - - MHostID BIGINT, -- when host type is local, MHostID points to its owner management host - - UserOnHost VARCHAR(64), - UserPassword VARCHAR(128), - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- management host -CREATE TABLE mhost ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - MHostKey VARCHAR(128) NOT NULL, -- host key could be derived from MAC address or named configuration value - Host VARCHAR(128), -- public host address for redirecting request from/to - - Version VARCHAR(64), - LastHeartbeatTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE mhost_mount ( - ID BIGINT NOT NULL AUTO_INCREMENT, - MHostID BIGINT NOT NULL, - SHostID BIGINT NOT NULL, - - MountPath VARCHAR(256), -- local mount path - LastMountTime DATETIME, -- null : unmounted, otherwise the mount location - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE sbucket ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Name VARCHAR(64) NOT NULL, - OwnerCanonicalID VARCHAR(150) NOT NULL, - - SHostID BIGINT, - - CreateTime DATETIME, - - VersioningStatus INT NOT NULL DEFAULT 0, -- 0 : initial not set, 1 : enabled, 2 : suspended - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE sobject ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - SBucketID BIGINT NOT NULL, - NameKey VARCHAR(255) NOT NULL, - - OwnerCanonicalID VARCHAR(150) NOT NULL, - NextSequence INT NOT NULL DEFAULT 1, - DeletionMark VARCHAR (150), - - CreateTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE sobject_item ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - SObjectID BIGINT NOT NULL, - Version VARCHAR(64), - - MD5 VARCHAR(128), - StoredPath VARCHAR(256), -- relative to mount point of the root - StoredSize BIGINT NOT NULL DEFAULT 0, - - CreateTime DATETIME, - LastModifiedTime DATETIME, - LastAccessTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE meta ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Target VARCHAR(64) NOT NULL, - TargetID BIGINT NOT NULL, - - Name VARCHAR(64) NOT NULL, - Value VARCHAR(256), - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE acl ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Target VARCHAR(64) NOT NULL, - TargetID BIGINT NOT NULL, - - GranteeType INT NOT NULL DEFAULT 0, -- 0 : Cloud service user, 1 : Cloud user community, 2: Public user community - GranteeCanonicalID VARCHAR(150), -- make it big enought to hold a Cloud API access key - - Permission INT NOT NULL DEFAULT 0, -- 0 : no permission, 1 : read, 2 : write, 4 : read_acl, 8 : write_acl - GrantOrder INT NOT NULL DEFAULT 0, - - CreateTime DATETIME, - LastModifiedTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- each account has to have a separate --- each account has to have a separate mappings -CREATE TABLE usercredentials ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - AccessKey VARCHAR(150) NOT NULL, - SecretKey VARCHAR(150) NOT NULL, - CertUniqueId VARCHAR(200), - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -SET foreign_key_checks = 1; - +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + +USE cloudbridge; + +SET foreign_key_checks = 0; + +DROP TABLE IF EXISTS shost; +DROP TABLE IF EXISTS mhost; +DROP TABLE IF EXISTS mhost_mount; +DROP TABLE IF EXISTS sbucket; +DROP TABLE IF EXISTS sobject; +DROP TABLE IF EXISTS sobject_item; +DROP TABLE IF EXISTS meta; +DROP TABLE IF EXISTS acl; +DROP TABLE IF EXISTS usercredentials; + +-- storage host +CREATE TABLE shost ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + Host VARCHAR(128) NOT NULL, + HostType INT NOT NULL DEFAULT 0, -- 0 : local, 1 : nfs + ExportRoot VARCHAR(128) NOT NULL, + + MHostID BIGINT, -- when host type is local, MHostID points to its owner management host + + UserOnHost VARCHAR(64), + UserPassword VARCHAR(128), + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- management host +CREATE TABLE mhost ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + MHostKey VARCHAR(128) NOT NULL, -- host key could be derived from MAC address or named configuration value + Host VARCHAR(128), -- public host address for redirecting request from/to + + Version VARCHAR(64), + LastHeartbeatTime DATETIME, + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE mhost_mount ( + ID BIGINT NOT NULL AUTO_INCREMENT, + MHostID BIGINT NOT NULL, + SHostID BIGINT NOT NULL, + + MountPath VARCHAR(256), -- local mount path + LastMountTime DATETIME, -- null : unmounted, otherwise the mount location + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE sbucket ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + Name VARCHAR(64) NOT NULL, + OwnerCanonicalID VARCHAR(150) NOT NULL, + + SHostID BIGINT, + + CreateTime DATETIME, + + VersioningStatus INT NOT NULL DEFAULT 0, -- 0 : initial not set, 1 : enabled, 2 : suspended + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE sobject ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + SBucketID BIGINT NOT NULL, + NameKey VARCHAR(255) NOT NULL, + + OwnerCanonicalID VARCHAR(150) NOT NULL, + NextSequence INT NOT NULL DEFAULT 1, + DeletionMark VARCHAR (150), + + CreateTime DATETIME, + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE sobject_item ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + SObjectID BIGINT NOT NULL, + Version VARCHAR(64), + + MD5 VARCHAR(128), + StoredPath VARCHAR(256), -- relative to mount point of the root + StoredSize BIGINT NOT NULL DEFAULT 0, + + CreateTime DATETIME, + LastModifiedTime DATETIME, + LastAccessTime DATETIME, + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE meta ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + Target VARCHAR(64) NOT NULL, + TargetID BIGINT NOT NULL, + + Name VARCHAR(64) NOT NULL, + Value VARCHAR(256), + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE acl ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + Target VARCHAR(64) NOT NULL, + TargetID BIGINT NOT NULL, + + GranteeType INT NOT NULL DEFAULT 0, -- 0 : Cloud service user, 1 : Cloud user community, 2: Public user community + GranteeCanonicalID VARCHAR(150), -- make it big enought to hold a Cloud API access key + + Permission INT NOT NULL DEFAULT 0, -- 0 : no permission, 1 : read, 2 : write, 4 : read_acl, 8 : write_acl + GrantOrder INT NOT NULL DEFAULT 0, + + CreateTime DATETIME, + LastModifiedTime DATETIME, + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- each account has to have a separate +-- each account has to have a separate mappings +CREATE TABLE usercredentials ( + ID BIGINT NOT NULL AUTO_INCREMENT, + + AccessKey VARCHAR(150) NOT NULL, + SecretKey VARCHAR(150) NOT NULL, + CertUniqueId VARCHAR(200), + + PRIMARY KEY(ID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +SET foreign_key_checks = 1; + diff --git a/awsapi-setup/db/mysql/deploy-db-bridge.sh b/awsapi-setup/db/mysql/deploy-db-bridge.sh index abaa19b9a0a..2e8ceee24eb 100644 --- a/awsapi-setup/db/mysql/deploy-db-bridge.sh +++ b/awsapi-setup/db/mysql/deploy-db-bridge.sh @@ -1,7 +1,20 @@ #!/usr/bin/env bash -# deploy-db-bridge.sh -- deploys the cloudbridge database configuration. -# -# set -x +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. if [ ! -f cloudbridge_db.sql ]; then printf "Error: Unable to find cloudbridge_db.sql\n" diff --git a/awsapi-setup/init/debian/cloud-bridge b/awsapi-setup/init/debian/cloud-bridge index 8fb0fbf659c..c1bf90b4d93 100644 --- a/awsapi-setup/init/debian/cloud-bridge +++ b/awsapi-setup/init/debian/cloud-bridge @@ -1,4 +1,20 @@ #!/bin/sh +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. # # /etc/init.d/tomcat6 -- startup script for the Tomcat 6 servlet engine # diff --git a/awsapi-setup/init/rpm/cloud-bridge b/awsapi-setup/init/rpm/cloud-bridge index ee9bd5138ee..444b771cb4b 100644 --- a/awsapi-setup/init/rpm/cloud-bridge +++ b/awsapi-setup/init/rpm/cloud-bridge @@ -1,5 +1,22 @@ #!/bin/bash # +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# # tomcat6 This shell script takes care of starting and stopping Tomcat # # chkconfig: - 80 20 diff --git a/awsapi-setup/setup/cloud-setup-bridge b/awsapi-setup/setup/cloud-setup-bridge index ea3fa1faf22..d25072da1eb 100644 --- a/awsapi-setup/setup/cloud-setup-bridge +++ b/awsapi-setup/setup/cloud-setup-bridge @@ -1,5 +1,22 @@ #!/bin/bash # +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# # Cloud.com Bridge setup script. # diff --git a/awsapi-setup/setup/cloudstack-aws-api-register b/awsapi-setup/setup/cloudstack-aws-api-register index 859a57188fc..19b53fd26c5 100644 --- a/awsapi-setup/setup/cloudstack-aws-api-register +++ b/awsapi-setup/setup/cloudstack-aws-api-register @@ -1,4 +1,21 @@ #!/cygdrive/c/python26/python +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. import base64 import hmac From e984c3c098bea3c093727ddf19761959a758eb52 Mon Sep 17 00:00:00 2001 From: David Nalley Date: Tue, 26 Jun 2012 11:07:48 -0400 Subject: [PATCH 06/37] applying chip childers patch for AWSAPI license headers https://reviews.apache.org/r/5437/ --- awsapi/deploy-cloud-bridge.sh | 18 +- awsapi/install.sh | 16 + awsapi/scripts/run.sh | 16 + .../src/com/amazon/ec2/ActivateLicense.java | 16 + .../amazon/ec2/ActivateLicenseResponse.java | 16 + .../ec2/ActivateLicenseResponseType.java | 16 + .../com/amazon/ec2/ActivateLicenseType.java | 16 + .../src/com/amazon/ec2/AllocateAddress.java | 16 + .../amazon/ec2/AllocateAddressResponse.java | 16 + .../ec2/AllocateAddressResponseType.java | 16 + .../com/amazon/ec2/AllocateAddressType.java | 16 + .../ec2/AmazonEC2MessageReceiverInOut.java | 16 + .../src/com/amazon/ec2/AmazonEC2Skeleton.java | 16 + .../ec2/AmazonEC2SkeletonInterface.java | 16 + .../src/com/amazon/ec2/AssociateAddress.java | 16 + .../amazon/ec2/AssociateAddressResponse.java | 16 + .../ec2/AssociateAddressResponseType.java | 16 + .../com/amazon/ec2/AssociateAddressType.java | 16 + .../com/amazon/ec2/AssociateDhcpOptions.java | 16 + .../ec2/AssociateDhcpOptionsResponse.java | 16 + .../ec2/AssociateDhcpOptionsResponseType.java | 16 + .../amazon/ec2/AssociateDhcpOptionsType.java | 16 + awsapi/src/com/amazon/ec2/AttachVolume.java | 16 + .../com/amazon/ec2/AttachVolumeResponse.java | 16 + .../amazon/ec2/AttachVolumeResponseType.java | 16 + .../src/com/amazon/ec2/AttachVolumeType.java | 16 + .../src/com/amazon/ec2/AttachVpnGateway.java | 16 + .../amazon/ec2/AttachVpnGatewayResponse.java | 16 + .../ec2/AttachVpnGatewayResponseType.java | 16 + .../com/amazon/ec2/AttachVpnGatewayType.java | 16 + .../ec2/AttachmentSetItemResponseType.java | 16 + .../amazon/ec2/AttachmentSetResponseType.java | 16 + .../src/com/amazon/ec2/AttachmentSetType.java | 16 + awsapi/src/com/amazon/ec2/AttachmentType.java | 16 + .../amazon/ec2/AttributeBooleanValueType.java | 16 + .../com/amazon/ec2/AttributeValueType.java | 16 + .../ec2/AuthorizeSecurityGroupIngress.java | 16 + ...AuthorizeSecurityGroupIngressResponse.java | 16 + ...orizeSecurityGroupIngressResponseType.java | 16 + .../AuthorizeSecurityGroupIngressType.java | 16 + .../amazon/ec2/AvailabilityZoneItemType.java | 16 + .../ec2/AvailabilityZoneMessageSetType.java | 16 + .../ec2/AvailabilityZoneMessageType.java | 16 + .../amazon/ec2/AvailabilityZoneSetType.java | 16 + .../ec2/BlockDeviceMappingItemType.java | 16 + ...lockDeviceMappingItemTypeChoice_type0.java | 16 + .../amazon/ec2/BlockDeviceMappingType.java | 16 + awsapi/src/com/amazon/ec2/BundleInstance.java | 16 + .../amazon/ec2/BundleInstanceResponse.java | 16 + .../ec2/BundleInstanceResponseType.java | 16 + .../ec2/BundleInstanceS3StorageType.java | 16 + .../ec2/BundleInstanceTaskErrorType.java | 16 + .../ec2/BundleInstanceTaskStorageType.java | 16 + .../amazon/ec2/BundleInstanceTaskType.java | 16 + .../ec2/BundleInstanceTasksSetType.java | 16 + .../com/amazon/ec2/BundleInstanceType.java | 16 + .../src/com/amazon/ec2/CancelBundleTask.java | 16 + .../amazon/ec2/CancelBundleTaskResponse.java | 16 + .../ec2/CancelBundleTaskResponseType.java | 16 + .../com/amazon/ec2/CancelBundleTaskType.java | 16 + .../com/amazon/ec2/CancelConversionTask.java | 16 + .../ec2/CancelConversionTaskResponse.java | 16 + .../ec2/CancelConversionTaskResponseType.java | 16 + .../amazon/ec2/CancelConversionTaskType.java | 16 + .../ec2/CancelSpotInstanceRequests.java | 16 + .../CancelSpotInstanceRequestsResponse.java | 16 + ...otInstanceRequestsResponseSetItemType.java | 16 + ...elSpotInstanceRequestsResponseSetType.java | 16 + ...ancelSpotInstanceRequestsResponseType.java | 16 + .../ec2/CancelSpotInstanceRequestsType.java | 16 + .../amazon/ec2/ConfirmProductInstance.java | 16 + .../ec2/ConfirmProductInstanceResponse.java | 16 + .../ConfirmProductInstanceResponseType.java | 16 + .../ec2/ConfirmProductInstanceType.java | 16 + .../amazon/ec2/ConversionTaskIdItemType.java | 16 + .../amazon/ec2/ConversionTaskIdSetType.java | 16 + .../com/amazon/ec2/ConversionTaskSetType.java | 16 + .../com/amazon/ec2/ConversionTaskType.java | 16 + .../ec2/ConversionTaskTypeChoice_type0.java | 16 + .../com/amazon/ec2/CreateCustomerGateway.java | 16 + .../ec2/CreateCustomerGatewayResponse.java | 16 + .../CreateCustomerGatewayResponseType.java | 16 + .../amazon/ec2/CreateCustomerGatewayType.java | 16 + .../src/com/amazon/ec2/CreateDhcpOptions.java | 16 + .../amazon/ec2/CreateDhcpOptionsResponse.java | 16 + .../ec2/CreateDhcpOptionsResponseType.java | 16 + .../com/amazon/ec2/CreateDhcpOptionsType.java | 16 + awsapi/src/com/amazon/ec2/CreateImage.java | 16 + .../com/amazon/ec2/CreateImageResponse.java | 16 + .../amazon/ec2/CreateImageResponseType.java | 16 + .../src/com/amazon/ec2/CreateImageType.java | 16 + awsapi/src/com/amazon/ec2/CreateKeyPair.java | 16 + .../com/amazon/ec2/CreateKeyPairResponse.java | 16 + .../amazon/ec2/CreateKeyPairResponseType.java | 16 + .../src/com/amazon/ec2/CreateKeyPairType.java | 16 + .../com/amazon/ec2/CreatePlacementGroup.java | 16 + .../ec2/CreatePlacementGroupResponse.java | 16 + .../ec2/CreatePlacementGroupResponseType.java | 16 + .../amazon/ec2/CreatePlacementGroupType.java | 16 + .../com/amazon/ec2/CreateSecurityGroup.java | 16 + .../ec2/CreateSecurityGroupResponse.java | 16 + .../ec2/CreateSecurityGroupResponseType.java | 16 + .../amazon/ec2/CreateSecurityGroupType.java | 16 + awsapi/src/com/amazon/ec2/CreateSnapshot.java | 16 + .../amazon/ec2/CreateSnapshotResponse.java | 16 + .../ec2/CreateSnapshotResponseType.java | 16 + .../com/amazon/ec2/CreateSnapshotType.java | 16 + .../ec2/CreateSpotDatafeedSubscription.java | 16 + ...reateSpotDatafeedSubscriptionResponse.java | 16 + ...eSpotDatafeedSubscriptionResponseType.java | 16 + .../CreateSpotDatafeedSubscriptionType.java | 16 + awsapi/src/com/amazon/ec2/CreateSubnet.java | 16 + .../com/amazon/ec2/CreateSubnetResponse.java | 16 + .../amazon/ec2/CreateSubnetResponseType.java | 16 + .../src/com/amazon/ec2/CreateSubnetType.java | 16 + awsapi/src/com/amazon/ec2/CreateTags.java | 16 + .../com/amazon/ec2/CreateTagsResponse.java | 16 + .../amazon/ec2/CreateTagsResponseType.java | 16 + awsapi/src/com/amazon/ec2/CreateTagsType.java | 16 + awsapi/src/com/amazon/ec2/CreateVolume.java | 16 + .../ec2/CreateVolumePermissionItemType.java | 16 + .../ec2/CreateVolumePermissionListType.java | 16 + .../CreateVolumePermissionOperationType.java | 16 + .../com/amazon/ec2/CreateVolumeResponse.java | 16 + .../amazon/ec2/CreateVolumeResponseType.java | 16 + .../src/com/amazon/ec2/CreateVolumeType.java | 16 + awsapi/src/com/amazon/ec2/CreateVpc.java | 16 + .../src/com/amazon/ec2/CreateVpcResponse.java | 16 + .../com/amazon/ec2/CreateVpcResponseType.java | 16 + awsapi/src/com/amazon/ec2/CreateVpcType.java | 16 + .../com/amazon/ec2/CreateVpnConnection.java | 16 + .../ec2/CreateVpnConnectionResponse.java | 16 + .../ec2/CreateVpnConnectionResponseType.java | 16 + .../amazon/ec2/CreateVpnConnectionType.java | 16 + .../src/com/amazon/ec2/CreateVpnGateway.java | 16 + .../amazon/ec2/CreateVpnGatewayResponse.java | 16 + .../ec2/CreateVpnGatewayResponseType.java | 16 + .../com/amazon/ec2/CreateVpnGatewayType.java | 16 + .../ec2/CustomerGatewayIdSetItemType.java | 16 + .../amazon/ec2/CustomerGatewayIdSetType.java | 16 + .../amazon/ec2/CustomerGatewaySetType.java | 16 + .../com/amazon/ec2/CustomerGatewayType.java | 16 + .../src/com/amazon/ec2/DeactivateLicense.java | 16 + .../amazon/ec2/DeactivateLicenseResponse.java | 16 + .../ec2/DeactivateLicenseResponseType.java | 16 + .../com/amazon/ec2/DeactivateLicenseType.java | 16 + .../com/amazon/ec2/DeleteCustomerGateway.java | 16 + .../ec2/DeleteCustomerGatewayResponse.java | 16 + .../DeleteCustomerGatewayResponseType.java | 16 + .../amazon/ec2/DeleteCustomerGatewayType.java | 16 + .../src/com/amazon/ec2/DeleteDhcpOptions.java | 16 + .../amazon/ec2/DeleteDhcpOptionsResponse.java | 16 + .../ec2/DeleteDhcpOptionsResponseType.java | 16 + .../com/amazon/ec2/DeleteDhcpOptionsType.java | 16 + awsapi/src/com/amazon/ec2/DeleteKeyPair.java | 16 + .../com/amazon/ec2/DeleteKeyPairResponse.java | 16 + .../amazon/ec2/DeleteKeyPairResponseType.java | 16 + .../src/com/amazon/ec2/DeleteKeyPairType.java | 16 + .../com/amazon/ec2/DeletePlacementGroup.java | 16 + .../ec2/DeletePlacementGroupResponse.java | 16 + .../ec2/DeletePlacementGroupResponseType.java | 16 + .../amazon/ec2/DeletePlacementGroupType.java | 16 + .../com/amazon/ec2/DeleteSecurityGroup.java | 16 + .../ec2/DeleteSecurityGroupResponse.java | 16 + .../ec2/DeleteSecurityGroupResponseType.java | 16 + .../amazon/ec2/DeleteSecurityGroupType.java | 16 + awsapi/src/com/amazon/ec2/DeleteSnapshot.java | 16 + .../amazon/ec2/DeleteSnapshotResponse.java | 16 + .../ec2/DeleteSnapshotResponseType.java | 16 + .../com/amazon/ec2/DeleteSnapshotType.java | 16 + .../ec2/DeleteSpotDatafeedSubscription.java | 16 + ...eleteSpotDatafeedSubscriptionResponse.java | 16 + ...eSpotDatafeedSubscriptionResponseType.java | 16 + .../DeleteSpotDatafeedSubscriptionType.java | 16 + awsapi/src/com/amazon/ec2/DeleteSubnet.java | 16 + .../com/amazon/ec2/DeleteSubnetResponse.java | 16 + .../amazon/ec2/DeleteSubnetResponseType.java | 16 + .../src/com/amazon/ec2/DeleteSubnetType.java | 16 + awsapi/src/com/amazon/ec2/DeleteTags.java | 16 + .../com/amazon/ec2/DeleteTagsResponse.java | 16 + .../amazon/ec2/DeleteTagsResponseType.java | 16 + .../com/amazon/ec2/DeleteTagsSetItemType.java | 16 + .../src/com/amazon/ec2/DeleteTagsSetType.java | 16 + awsapi/src/com/amazon/ec2/DeleteTagsType.java | 16 + awsapi/src/com/amazon/ec2/DeleteVolume.java | 16 + .../com/amazon/ec2/DeleteVolumeResponse.java | 16 + .../amazon/ec2/DeleteVolumeResponseType.java | 16 + .../src/com/amazon/ec2/DeleteVolumeType.java | 16 + awsapi/src/com/amazon/ec2/DeleteVpc.java | 16 + .../src/com/amazon/ec2/DeleteVpcResponse.java | 16 + .../com/amazon/ec2/DeleteVpcResponseType.java | 16 + awsapi/src/com/amazon/ec2/DeleteVpcType.java | 16 + .../com/amazon/ec2/DeleteVpnConnection.java | 16 + .../ec2/DeleteVpnConnectionResponse.java | 16 + .../ec2/DeleteVpnConnectionResponseType.java | 16 + .../amazon/ec2/DeleteVpnConnectionType.java | 16 + .../src/com/amazon/ec2/DeleteVpnGateway.java | 16 + .../amazon/ec2/DeleteVpnGatewayResponse.java | 16 + .../ec2/DeleteVpnGatewayResponseType.java | 16 + .../com/amazon/ec2/DeleteVpnGatewayType.java | 16 + .../src/com/amazon/ec2/DeregisterImage.java | 16 + .../amazon/ec2/DeregisterImageResponse.java | 16 + .../ec2/DeregisterImageResponseType.java | 16 + .../com/amazon/ec2/DeregisterImageType.java | 16 + .../src/com/amazon/ec2/DescribeAddresses.java | 16 + .../amazon/ec2/DescribeAddressesInfoType.java | 16 + .../amazon/ec2/DescribeAddressesItemType.java | 16 + .../amazon/ec2/DescribeAddressesResponse.java | 16 + .../DescribeAddressesResponseInfoType.java | 16 + .../DescribeAddressesResponseItemType.java | 16 + .../ec2/DescribeAddressesResponseType.java | 16 + .../com/amazon/ec2/DescribeAddressesType.java | 16 + .../amazon/ec2/DescribeAvailabilityZones.java | 16 + .../DescribeAvailabilityZonesResponse.java | 16 + ...DescribeAvailabilityZonesResponseType.java | 16 + .../DescribeAvailabilityZonesSetItemType.java | 16 + .../ec2/DescribeAvailabilityZonesSetType.java | 16 + .../ec2/DescribeAvailabilityZonesType.java | 16 + .../com/amazon/ec2/DescribeBundleTasks.java | 16 + .../ec2/DescribeBundleTasksInfoType.java | 16 + .../ec2/DescribeBundleTasksItemType.java | 16 + .../ec2/DescribeBundleTasksResponse.java | 16 + .../ec2/DescribeBundleTasksResponseType.java | 16 + .../amazon/ec2/DescribeBundleTasksType.java | 16 + .../amazon/ec2/DescribeConversionTasks.java | 16 + .../ec2/DescribeConversionTasksResponse.java | 16 + .../DescribeConversionTasksResponseType.java | 16 + .../ec2/DescribeConversionTasksType.java | 16 + .../amazon/ec2/DescribeCustomerGateways.java | 16 + .../ec2/DescribeCustomerGatewaysResponse.java | 16 + .../DescribeCustomerGatewaysResponseType.java | 16 + .../ec2/DescribeCustomerGatewaysType.java | 16 + .../com/amazon/ec2/DescribeDhcpOptions.java | 16 + .../ec2/DescribeDhcpOptionsResponse.java | 16 + .../ec2/DescribeDhcpOptionsResponseType.java | 16 + .../amazon/ec2/DescribeDhcpOptionsType.java | 16 + .../amazon/ec2/DescribeImageAttribute.java | 16 + .../ec2/DescribeImageAttributeResponse.java | 16 + .../DescribeImageAttributeResponseType.java | 16 + ...mageAttributeResponseTypeChoice_type0.java | 16 + .../ec2/DescribeImageAttributeType.java | 16 + .../ec2/DescribeImageAttributesGroup.java | 16 + awsapi/src/com/amazon/ec2/DescribeImages.java | 16 + .../DescribeImagesExecutableBySetType.java | 16 + .../ec2/DescribeImagesExecutableByType.java | 16 + .../amazon/ec2/DescribeImagesInfoType.java | 16 + .../amazon/ec2/DescribeImagesItemType.java | 16 + .../amazon/ec2/DescribeImagesOwnerType.java | 16 + .../amazon/ec2/DescribeImagesOwnersType.java | 16 + .../amazon/ec2/DescribeImagesResponse.java | 16 + .../ec2/DescribeImagesResponseInfoType.java | 16 + .../ec2/DescribeImagesResponseItemType.java | 16 + .../ec2/DescribeImagesResponseType.java | 16 + .../com/amazon/ec2/DescribeImagesType.java | 16 + .../amazon/ec2/DescribeInstanceAttribute.java | 16 + .../DescribeInstanceAttributeResponse.java | 16 + ...DescribeInstanceAttributeResponseType.java | 16 + ...anceAttributeResponseTypeChoice_type0.java | 16 + .../ec2/DescribeInstanceAttributeType.java | 16 + .../ec2/DescribeInstanceAttributesGroup.java | 16 + .../src/com/amazon/ec2/DescribeInstances.java | 16 + .../amazon/ec2/DescribeInstancesInfoType.java | 16 + .../amazon/ec2/DescribeInstancesItemType.java | 16 + .../amazon/ec2/DescribeInstancesResponse.java | 16 + .../ec2/DescribeInstancesResponseType.java | 16 + .../com/amazon/ec2/DescribeInstancesType.java | 16 + .../src/com/amazon/ec2/DescribeKeyPairs.java | 16 + .../amazon/ec2/DescribeKeyPairsInfoType.java | 16 + .../amazon/ec2/DescribeKeyPairsItemType.java | 16 + .../amazon/ec2/DescribeKeyPairsResponse.java | 16 + .../ec2/DescribeKeyPairsResponseInfoType.java | 16 + .../ec2/DescribeKeyPairsResponseItemType.java | 16 + .../ec2/DescribeKeyPairsResponseType.java | 16 + .../com/amazon/ec2/DescribeKeyPairsType.java | 16 + .../src/com/amazon/ec2/DescribeLicenses.java | 16 + .../amazon/ec2/DescribeLicensesResponse.java | 16 + .../ec2/DescribeLicensesResponseType.java | 16 + .../com/amazon/ec2/DescribeLicensesType.java | 16 + .../ec2/DescribePlacementGroupItemType.java | 16 + .../amazon/ec2/DescribePlacementGroups.java | 16 + .../ec2/DescribePlacementGroupsInfoType.java | 16 + .../ec2/DescribePlacementGroupsResponse.java | 16 + .../DescribePlacementGroupsResponseType.java | 16 + .../ec2/DescribePlacementGroupsType.java | 16 + .../src/com/amazon/ec2/DescribeRegions.java | 16 + .../amazon/ec2/DescribeRegionsResponse.java | 16 + .../ec2/DescribeRegionsResponseType.java | 16 + .../ec2/DescribeRegionsSetItemType.java | 16 + .../amazon/ec2/DescribeRegionsSetType.java | 16 + .../com/amazon/ec2/DescribeRegionsType.java | 16 + .../amazon/ec2/DescribeReservedInstances.java | 16 + .../DescribeReservedInstancesOfferings.java | 16 + ...ibeReservedInstancesOfferingsResponse.java | 16 + ...InstancesOfferingsResponseSetItemType.java | 16 + ...rvedInstancesOfferingsResponseSetType.java | 16 + ...eservedInstancesOfferingsResponseType.java | 16 + ...ReservedInstancesOfferingsSetItemType.java | 16 + ...ribeReservedInstancesOfferingsSetType.java | 16 + ...escribeReservedInstancesOfferingsType.java | 16 + .../DescribeReservedInstancesResponse.java | 16 + ...eReservedInstancesResponseSetItemType.java | 16 + ...cribeReservedInstancesResponseSetType.java | 16 + ...DescribeReservedInstancesResponseType.java | 16 + .../DescribeReservedInstancesSetItemType.java | 16 + .../ec2/DescribeReservedInstancesSetType.java | 16 + .../ec2/DescribeReservedInstancesType.java | 16 + .../amazon/ec2/DescribeSecurityGroups.java | 16 + .../ec2/DescribeSecurityGroupsResponse.java | 16 + .../DescribeSecurityGroupsResponseType.java | 16 + .../DescribeSecurityGroupsSetItemType.java | 16 + .../ec2/DescribeSecurityGroupsSetType.java | 16 + .../ec2/DescribeSecurityGroupsType.java | 16 + .../amazon/ec2/DescribeSnapshotAttribute.java | 16 + .../DescribeSnapshotAttributeResponse.java | 16 + ...DescribeSnapshotAttributeResponseType.java | 16 + .../ec2/DescribeSnapshotAttributeType.java | 16 + .../ec2/DescribeSnapshotAttributesGroup.java | 16 + .../src/com/amazon/ec2/DescribeSnapshots.java | 16 + .../ec2/DescribeSnapshotsOwnerType.java | 16 + .../ec2/DescribeSnapshotsOwnersType.java | 16 + .../amazon/ec2/DescribeSnapshotsResponse.java | 16 + .../ec2/DescribeSnapshotsResponseType.java | 16 + .../DescribeSnapshotsRestorableBySetType.java | 16 + .../DescribeSnapshotsRestorableByType.java | 16 + .../DescribeSnapshotsSetItemResponseType.java | 16 + .../ec2/DescribeSnapshotsSetItemType.java | 16 + .../ec2/DescribeSnapshotsSetResponseType.java | 16 + .../amazon/ec2/DescribeSnapshotsSetType.java | 16 + .../com/amazon/ec2/DescribeSnapshotsType.java | 16 + .../ec2/DescribeSpotDatafeedSubscription.java | 16 + ...cribeSpotDatafeedSubscriptionResponse.java | 16 + ...eSpotDatafeedSubscriptionResponseType.java | 16 + .../DescribeSpotDatafeedSubscriptionType.java | 16 + .../ec2/DescribeSpotInstanceRequests.java | 16 + .../DescribeSpotInstanceRequestsResponse.java | 16 + ...cribeSpotInstanceRequestsResponseType.java | 16 + .../ec2/DescribeSpotInstanceRequestsType.java | 16 + .../amazon/ec2/DescribeSpotPriceHistory.java | 16 + .../ec2/DescribeSpotPriceHistoryResponse.java | 16 + .../DescribeSpotPriceHistoryResponseType.java | 16 + .../ec2/DescribeSpotPriceHistoryType.java | 16 + .../src/com/amazon/ec2/DescribeSubnets.java | 16 + .../amazon/ec2/DescribeSubnetsResponse.java | 16 + .../ec2/DescribeSubnetsResponseType.java | 16 + .../com/amazon/ec2/DescribeSubnetsType.java | 16 + awsapi/src/com/amazon/ec2/DescribeTags.java | 16 + .../com/amazon/ec2/DescribeTagsResponse.java | 16 + .../amazon/ec2/DescribeTagsResponseType.java | 16 + .../src/com/amazon/ec2/DescribeTagsType.java | 16 + .../src/com/amazon/ec2/DescribeVolumes.java | 16 + .../amazon/ec2/DescribeVolumesResponse.java | 16 + .../ec2/DescribeVolumesResponseType.java | 16 + .../DescribeVolumesSetItemResponseType.java | 16 + .../ec2/DescribeVolumesSetItemType.java | 16 + .../ec2/DescribeVolumesSetResponseType.java | 16 + .../amazon/ec2/DescribeVolumesSetType.java | 16 + .../com/amazon/ec2/DescribeVolumesType.java | 16 + awsapi/src/com/amazon/ec2/DescribeVpcs.java | 16 + .../com/amazon/ec2/DescribeVpcsResponse.java | 16 + .../amazon/ec2/DescribeVpcsResponseType.java | 16 + .../src/com/amazon/ec2/DescribeVpcsType.java | 16 + .../amazon/ec2/DescribeVpnConnections.java | 16 + .../ec2/DescribeVpnConnectionsResponse.java | 16 + .../DescribeVpnConnectionsResponseType.java | 16 + .../ec2/DescribeVpnConnectionsType.java | 16 + .../com/amazon/ec2/DescribeVpnGateways.java | 16 + .../ec2/DescribeVpnGatewaysResponse.java | 16 + .../ec2/DescribeVpnGatewaysResponseType.java | 16 + .../amazon/ec2/DescribeVpnGatewaysType.java | 16 + awsapi/src/com/amazon/ec2/DetachVolume.java | 16 + .../com/amazon/ec2/DetachVolumeResponse.java | 16 + .../amazon/ec2/DetachVolumeResponseType.java | 16 + .../src/com/amazon/ec2/DetachVolumeType.java | 16 + .../src/com/amazon/ec2/DetachVpnGateway.java | 16 + .../amazon/ec2/DetachVpnGatewayResponse.java | 16 + .../ec2/DetachVpnGatewayResponseType.java | 16 + .../com/amazon/ec2/DetachVpnGatewayType.java | 16 + .../ec2/DhcpConfigurationItemSetType.java | 16 + .../amazon/ec2/DhcpConfigurationItemType.java | 16 + .../amazon/ec2/DhcpOptionsIdSetItemType.java | 16 + .../com/amazon/ec2/DhcpOptionsIdSetType.java | 16 + .../com/amazon/ec2/DhcpOptionsSetType.java | 16 + .../src/com/amazon/ec2/DhcpOptionsType.java | 16 + .../src/com/amazon/ec2/DhcpValueSetType.java | 16 + awsapi/src/com/amazon/ec2/DhcpValueType.java | 16 + .../com/amazon/ec2/DisassociateAddress.java | 16 + .../ec2/DisassociateAddressResponse.java | 16 + .../ec2/DisassociateAddressResponseType.java | 16 + .../amazon/ec2/DisassociateAddressType.java | 16 + .../amazon/ec2/DiskImageDescriptionType.java | 16 + .../com/amazon/ec2/DiskImageDetailType.java | 16 + .../src/com/amazon/ec2/DiskImageSetType.java | 16 + awsapi/src/com/amazon/ec2/DiskImageType.java | 16 + .../ec2/DiskImageVolumeDescriptionType.java | 16 + .../com/amazon/ec2/DiskImageVolumeType.java | 16 + .../com/amazon/ec2/EbsBlockDeviceType.java | 16 + ...nstanceBlockDeviceMappingResponseType.java | 16 + .../src/com/amazon/ec2/EmptyElementType.java | 16 + .../src/com/amazon/ec2/ExtensionMapper.java | 16 + awsapi/src/com/amazon/ec2/FilterSetType.java | 16 + awsapi/src/com/amazon/ec2/FilterType.java | 16 + .../src/com/amazon/ec2/GetConsoleOutput.java | 16 + .../amazon/ec2/GetConsoleOutputResponse.java | 16 + .../ec2/GetConsoleOutputResponseType.java | 16 + .../com/amazon/ec2/GetConsoleOutputType.java | 16 + .../src/com/amazon/ec2/GetPasswordData.java | 16 + .../amazon/ec2/GetPasswordDataResponse.java | 16 + .../ec2/GetPasswordDataResponseType.java | 16 + .../com/amazon/ec2/GetPasswordDataType.java | 16 + awsapi/src/com/amazon/ec2/GroupItemType.java | 16 + awsapi/src/com/amazon/ec2/GroupSetType.java | 16 + awsapi/src/com/amazon/ec2/ImportInstance.java | 16 + ...ImportInstanceLaunchSpecificationType.java | 16 + .../amazon/ec2/ImportInstanceResponse.java | 16 + .../ec2/ImportInstanceResponseType.java | 16 + .../ec2/ImportInstanceTaskDetailsType.java | 16 + .../com/amazon/ec2/ImportInstanceType.java | 16 + .../ImportInstanceVolumeDetailItemType.java | 16 + .../ImportInstanceVolumeDetailSetType.java | 16 + awsapi/src/com/amazon/ec2/ImportKeyPair.java | 16 + .../com/amazon/ec2/ImportKeyPairResponse.java | 16 + .../amazon/ec2/ImportKeyPairResponseType.java | 16 + .../src/com/amazon/ec2/ImportKeyPairType.java | 16 + awsapi/src/com/amazon/ec2/ImportVolume.java | 16 + .../com/amazon/ec2/ImportVolumeResponse.java | 16 + .../amazon/ec2/ImportVolumeResponseType.java | 16 + .../ec2/ImportVolumeTaskDetailsType.java | 16 + .../src/com/amazon/ec2/ImportVolumeType.java | 16 + .../InstanceBlockDeviceMappingItemType.java | 16 + ...lockDeviceMappingItemTypeChoice_type0.java | 16 + ...nceBlockDeviceMappingResponseItemType.java | 16 + ...ceMappingResponseItemTypeChoice_type0.java | 16 + ...nstanceBlockDeviceMappingResponseType.java | 16 + .../ec2/InstanceBlockDeviceMappingType.java | 16 + .../ec2/InstanceEbsBlockDeviceType.java | 16 + .../src/com/amazon/ec2/InstanceIdSetType.java | 16 + awsapi/src/com/amazon/ec2/InstanceIdType.java | 16 + .../ec2/InstanceLicenseRequestType.java | 16 + .../ec2/InstanceLicenseResponseType.java | 16 + .../ec2/InstanceMonitoringStateType.java | 16 + .../com/amazon/ec2/InstancePlacementType.java | 16 + .../ec2/InstanceStateChangeSetType.java | 16 + .../amazon/ec2/InstanceStateChangeType.java | 16 + .../src/com/amazon/ec2/InstanceStateType.java | 16 + .../amazon/ec2/InstanceTypeSetItemType.java | 16 + .../com/amazon/ec2/InstanceTypeSetType.java | 16 + .../com/amazon/ec2/IpPermissionSetType.java | 16 + .../src/com/amazon/ec2/IpPermissionType.java | 16 + .../src/com/amazon/ec2/IpRangeItemType.java | 16 + awsapi/src/com/amazon/ec2/IpRangeSetType.java | 16 + .../amazon/ec2/LaunchPermissionItemType.java | 16 + .../amazon/ec2/LaunchPermissionListType.java | 16 + .../ec2/LaunchPermissionOperationType.java | 16 + .../ec2/LaunchSpecificationRequestType.java | 16 + .../ec2/LaunchSpecificationResponseType.java | 16 + .../ec2/LicenseCapacitySetItemType.java | 16 + .../amazon/ec2/LicenseCapacitySetType.java | 16 + .../com/amazon/ec2/LicenseIdSetItemType.java | 16 + .../src/com/amazon/ec2/LicenseIdSetType.java | 16 + .../com/amazon/ec2/LicenseSetItemType.java | 16 + awsapi/src/com/amazon/ec2/LicenseSetType.java | 16 + .../com/amazon/ec2/ModifyImageAttribute.java | 16 + .../ec2/ModifyImageAttributeResponse.java | 16 + .../ec2/ModifyImageAttributeResponseType.java | 16 + .../amazon/ec2/ModifyImageAttributeType.java | 16 + .../ModifyImageAttributeTypeChoice_type0.java | 16 + .../amazon/ec2/ModifyInstanceAttribute.java | 16 + .../ec2/ModifyInstanceAttributeResponse.java | 16 + .../ModifyInstanceAttributeResponseType.java | 16 + .../ec2/ModifyInstanceAttributeType.java | 16 + ...difyInstanceAttributeTypeChoice_type0.java | 16 + .../amazon/ec2/ModifySnapshotAttribute.java | 16 + .../ec2/ModifySnapshotAttributeResponse.java | 16 + .../ModifySnapshotAttributeResponseType.java | 16 + .../ec2/ModifySnapshotAttributeType.java | 16 + .../src/com/amazon/ec2/MonitorInstances.java | 16 + .../amazon/ec2/MonitorInstancesResponse.java | 16 + .../MonitorInstancesResponseSetItemType.java | 16 + .../ec2/MonitorInstancesResponseSetType.java | 16 + .../ec2/MonitorInstancesResponseType.java | 16 + .../ec2/MonitorInstancesSetItemType.java | 16 + .../amazon/ec2/MonitorInstancesSetType.java | 16 + .../com/amazon/ec2/MonitorInstancesType.java | 16 + .../amazon/ec2/MonitoringInstanceType.java | 16 + .../NullableAttributeBooleanValueType.java | 16 + .../ec2/NullableAttributeValueType.java | 16 + .../amazon/ec2/PlacementGroupInfoType.java | 16 + .../com/amazon/ec2/PlacementGroupSetType.java | 16 + .../com/amazon/ec2/PlacementRequestType.java | 16 + .../com/amazon/ec2/PlacementResponseType.java | 16 + .../com/amazon/ec2/ProductCodeItemType.java | 16 + .../com/amazon/ec2/ProductCodeListType.java | 16 + .../com/amazon/ec2/ProductCodeSetType.java | 16 + .../src/com/amazon/ec2/ProductCodeType.java | 16 + .../amazon/ec2/ProductCodesSetItemType.java | 16 + .../com/amazon/ec2/ProductCodesSetType.java | 16 + .../ec2/ProductDescriptionSetItemType.java | 16 + .../amazon/ec2/ProductDescriptionSetType.java | 16 + .../PurchaseReservedInstancesOffering.java | 16 + ...haseReservedInstancesOfferingResponse.java | 16 + ...ReservedInstancesOfferingResponseType.java | 16 + ...PurchaseReservedInstancesOfferingType.java | 16 + .../src/com/amazon/ec2/RebootInstances.java | 16 + .../amazon/ec2/RebootInstancesInfoType.java | 16 + .../amazon/ec2/RebootInstancesItemType.java | 16 + .../amazon/ec2/RebootInstancesResponse.java | 16 + .../ec2/RebootInstancesResponseType.java | 16 + .../com/amazon/ec2/RebootInstancesType.java | 16 + awsapi/src/com/amazon/ec2/RegionItemType.java | 16 + awsapi/src/com/amazon/ec2/RegionSetType.java | 16 + awsapi/src/com/amazon/ec2/RegisterImage.java | 16 + .../com/amazon/ec2/RegisterImageResponse.java | 16 + .../amazon/ec2/RegisterImageResponseType.java | 16 + .../src/com/amazon/ec2/RegisterImageType.java | 16 + awsapi/src/com/amazon/ec2/ReleaseAddress.java | 16 + .../amazon/ec2/ReleaseAddressResponse.java | 16 + .../ec2/ReleaseAddressResponseType.java | 16 + .../com/amazon/ec2/ReleaseAddressType.java | 16 + .../com/amazon/ec2/RequestSpotInstances.java | 16 + .../ec2/RequestSpotInstancesResponse.java | 16 + .../ec2/RequestSpotInstancesResponseType.java | 16 + .../amazon/ec2/RequestSpotInstancesType.java | 16 + .../com/amazon/ec2/ReservationInfoType.java | 16 + .../com/amazon/ec2/ReservationSetType.java | 16 + .../com/amazon/ec2/ResetImageAttribute.java | 16 + .../ec2/ResetImageAttributeResponse.java | 16 + .../ec2/ResetImageAttributeResponseType.java | 16 + .../amazon/ec2/ResetImageAttributeType.java | 16 + .../amazon/ec2/ResetImageAttributesGroup.java | 16 + .../amazon/ec2/ResetInstanceAttribute.java | 16 + .../ec2/ResetInstanceAttributeResponse.java | 16 + .../ResetInstanceAttributeResponseType.java | 16 + .../ec2/ResetInstanceAttributeType.java | 16 + .../ec2/ResetInstanceAttributesGroup.java | 16 + .../amazon/ec2/ResetSnapshotAttribute.java | 16 + .../ec2/ResetSnapshotAttributeResponse.java | 16 + .../ResetSnapshotAttributeResponseType.java | 16 + .../ec2/ResetSnapshotAttributeType.java | 16 + .../ec2/ResetSnapshotAttributesGroup.java | 16 + .../com/amazon/ec2/ResourceIdSetItemType.java | 16 + .../src/com/amazon/ec2/ResourceIdSetType.java | 16 + .../amazon/ec2/ResourceTagSetItemType.java | 16 + .../com/amazon/ec2/ResourceTagSetType.java | 16 + .../ec2/RevokeSecurityGroupIngress.java | 16 + .../RevokeSecurityGroupIngressResponse.java | 16 + ...evokeSecurityGroupIngressResponseType.java | 16 + .../ec2/RevokeSecurityGroupIngressType.java | 16 + awsapi/src/com/amazon/ec2/RunInstances.java | 16 + .../com/amazon/ec2/RunInstancesResponse.java | 16 + .../amazon/ec2/RunInstancesResponseType.java | 16 + .../src/com/amazon/ec2/RunInstancesType.java | 16 + .../amazon/ec2/RunningInstancesItemType.java | 16 + .../amazon/ec2/RunningInstancesSetType.java | 16 + .../com/amazon/ec2/SecurityGroupItemType.java | 16 + .../com/amazon/ec2/SecurityGroupSetType.java | 16 + .../ec2/SpotDatafeedSubscriptionType.java | 16 + .../ec2/SpotInstanceRequestIdSetItemType.java | 16 + .../ec2/SpotInstanceRequestIdSetType.java | 16 + .../ec2/SpotInstanceRequestSetItemType.java | 16 + .../ec2/SpotInstanceRequestSetType.java | 16 + .../ec2/SpotInstanceStateFaultType.java | 16 + .../ec2/SpotPriceHistorySetItemType.java | 16 + .../amazon/ec2/SpotPriceHistorySetType.java | 16 + awsapi/src/com/amazon/ec2/StartInstances.java | 16 + .../amazon/ec2/StartInstancesResponse.java | 16 + .../ec2/StartInstancesResponseType.java | 16 + .../com/amazon/ec2/StartInstancesType.java | 16 + .../src/com/amazon/ec2/StateReasonType.java | 16 + awsapi/src/com/amazon/ec2/StopInstances.java | 16 + .../com/amazon/ec2/StopInstancesResponse.java | 16 + .../amazon/ec2/StopInstancesResponseType.java | 16 + .../src/com/amazon/ec2/StopInstancesType.java | 16 + .../com/amazon/ec2/SubnetIdSetItemType.java | 16 + .../src/com/amazon/ec2/SubnetIdSetType.java | 16 + awsapi/src/com/amazon/ec2/SubnetSetType.java | 16 + awsapi/src/com/amazon/ec2/SubnetType.java | 16 + awsapi/src/com/amazon/ec2/TagSetItemType.java | 16 + awsapi/src/com/amazon/ec2/TagSetType.java | 16 + .../com/amazon/ec2/TerminateInstances.java | 16 + .../ec2/TerminateInstancesResponse.java | 16 + .../ec2/TerminateInstancesResponseType.java | 16 + .../amazon/ec2/TerminateInstancesType.java | 16 + .../com/amazon/ec2/UnmonitorInstances.java | 16 + .../ec2/UnmonitorInstancesResponse.java | 16 + awsapi/src/com/amazon/ec2/UserDataType.java | 16 + .../amazon/ec2/UserIdGroupPairSetType.java | 16 + .../com/amazon/ec2/UserIdGroupPairType.java | 16 + awsapi/src/com/amazon/ec2/ValueSetType.java | 16 + awsapi/src/com/amazon/ec2/ValueType.java | 16 + .../src/com/amazon/ec2/VpcIdSetItemType.java | 16 + awsapi/src/com/amazon/ec2/VpcIdSetType.java | 16 + awsapi/src/com/amazon/ec2/VpcSetType.java | 16 + awsapi/src/com/amazon/ec2/VpcType.java | 16 + .../ec2/VpnConnectionIdSetItemType.java | 16 + .../amazon/ec2/VpnConnectionIdSetType.java | 16 + .../com/amazon/ec2/VpnConnectionSetType.java | 16 + .../src/com/amazon/ec2/VpnConnectionType.java | 16 + .../amazon/ec2/VpnGatewayIdSetItemType.java | 16 + .../com/amazon/ec2/VpnGatewayIdSetType.java | 16 + .../src/com/amazon/ec2/VpnGatewaySetType.java | 16 + awsapi/src/com/amazon/ec2/VpnGatewayType.java | 16 + .../ec2/client/AmazonEC2CallbackHandler.java | 16 + .../com/amazon/ec2/client/AmazonEC2Stub.java | 16 + .../src/com/amazon/s3/AccessControlList.java | 1142 +- .../com/amazon/s3/AccessControlPolicy.java | 1040 +- .../com/amazon/s3/AmazonCustomerByEmail.java | 978 +- .../s3/AmazonS3MessageReceiverInOut.java | 2752 +- .../src/com/amazon/s3/AmazonS3Skeleton.java | 556 +- .../amazon/s3/AmazonS3SkeletonInterface.java | 498 +- .../com/amazon/s3/BucketLoggingStatus.java | 944 +- awsapi/src/com/amazon/s3/CanonicalUser.java | 1188 +- awsapi/src/com/amazon/s3/CopyObject.java | 4380 +- .../src/com/amazon/s3/CopyObjectResponse.java | 920 +- .../src/com/amazon/s3/CopyObjectResult.java | 1164 +- awsapi/src/com/amazon/s3/CreateBucket.java | 1760 +- .../amazon/s3/CreateBucketConfiguration.java | 918 +- .../com/amazon/s3/CreateBucketResponse.java | 920 +- .../src/com/amazon/s3/CreateBucketResult.java | 980 +- awsapi/src/com/amazon/s3/DeleteBucket.java | 1822 +- .../com/amazon/s3/DeleteBucketResponse.java | 920 +- .../src/com/amazon/s3/DeleteMarkerEntry.java | 1664 +- awsapi/src/com/amazon/s3/DeleteObject.java | 2006 +- .../com/amazon/s3/DeleteObjectResponse.java | 920 +- awsapi/src/com/amazon/s3/ExtensionMapper.java | 824 +- .../s3/GetBucketAccessControlPolicy.java | 1822 +- .../GetBucketAccessControlPolicyResponse.java | 920 +- .../com/amazon/s3/GetBucketLoggingStatus.java | 1822 +- .../s3/GetBucketLoggingStatusResponse.java | 920 +- awsapi/src/com/amazon/s3/GetObject.java | 2510 +- .../s3/GetObjectAccessControlPolicy.java | 2006 +- .../GetObjectAccessControlPolicyResponse.java | 920 +- .../src/com/amazon/s3/GetObjectExtended.java | 4322 +- .../amazon/s3/GetObjectExtendedResponse.java | 920 +- .../src/com/amazon/s3/GetObjectResponse.java | 920 +- awsapi/src/com/amazon/s3/GetObjectResult.java | 1770 +- awsapi/src/com/amazon/s3/Grant.java | 1040 +- awsapi/src/com/amazon/s3/Grantee.java | 786 +- awsapi/src/com/amazon/s3/Group.java | 978 +- .../src/com/amazon/s3/ListAllMyBuckets.java | 1428 +- .../com/amazon/s3/ListAllMyBucketsEntry.java | 1164 +- .../com/amazon/s3/ListAllMyBucketsList.java | 1134 +- .../amazon/s3/ListAllMyBucketsResponse.java | 920 +- .../com/amazon/s3/ListAllMyBucketsResult.java | 1040 +- awsapi/src/com/amazon/s3/ListBucket.java | 2652 +- .../src/com/amazon/s3/ListBucketResponse.java | 920 +- .../src/com/amazon/s3/ListBucketResult.java | 3118 +- awsapi/src/com/amazon/s3/ListEntry.java | 1786 +- .../com/amazon/s3/ListVersionsResponse.java | 920 +- .../src/com/amazon/s3/ListVersionsResult.java | 3500 +- .../s3/ListVersionsResultChoice_type0.java | 980 +- .../src/com/amazon/s3/LocationConstraint.java | 984 +- awsapi/src/com/amazon/s3/LoggingSettings.java | 1312 +- .../src/com/amazon/s3/MetadataDirective.java | 946 +- awsapi/src/com/amazon/s3/MetadataEntry.java | 1164 +- awsapi/src/com/amazon/s3/MfaDeleteStatus.java | 946 +- .../amazon/s3/NotificationConfiguration.java | 1134 +- awsapi/src/com/amazon/s3/Payer.java | 946 +- awsapi/src/com/amazon/s3/Permission.java | 982 +- awsapi/src/com/amazon/s3/PostResponse.java | 1534 +- awsapi/src/com/amazon/s3/PrefixEntry.java | 980 +- awsapi/src/com/amazon/s3/PutObject.java | 2816 +- awsapi/src/com/amazon/s3/PutObjectInline.java | 3024 +- .../amazon/s3/PutObjectInlineResponse.java | 920 +- .../src/com/amazon/s3/PutObjectResponse.java | 920 +- awsapi/src/com/amazon/s3/PutObjectResult.java | 1164 +- .../s3/RequestPaymentConfiguration.java | 918 +- awsapi/src/com/amazon/s3/Result.java | 918 +- .../s3/SetBucketAccessControlPolicy.java | 1970 +- .../SetBucketAccessControlPolicyResponse.java | 798 +- .../com/amazon/s3/SetBucketLoggingStatus.java | 1944 +- .../s3/SetBucketLoggingStatusResponse.java | 798 +- .../s3/SetObjectAccessControlPolicy.java | 2128 +- .../SetObjectAccessControlPolicyResponse.java | 798 +- awsapi/src/com/amazon/s3/Status.java | 1148 +- awsapi/src/com/amazon/s3/StorageClass.java | 946 +- .../src/com/amazon/s3/TopicConfiguration.java | 1346 +- awsapi/src/com/amazon/s3/User.java | 784 +- awsapi/src/com/amazon/s3/VersionEntry.java | 2138 +- .../amazon/s3/VersioningConfiguration.java | 1092 +- .../src/com/amazon/s3/VersioningStatus.java | 946 +- .../s3/client/AmazonS3CallbackHandler.java | 626 +- .../com/amazon/s3/client/AmazonS3Stub.java | 92182 ++++++++-------- .../auth/ec2/AuthenticationHandler.java | 320 +- .../bridge/auth/ec2/AuthenticationModule.java | 128 +- .../src/com/cloud/bridge/auth/ec2/module.xml | 34 +- .../bridge/auth/s3/AuthenticationHandler.java | 16 + .../bridge/auth/s3/AuthenticationModule.java | 132 +- .../src/com/cloud/bridge/auth/s3/module.xml | 34 +- .../bridge/io/DimeDelimitedInputStream.java | 1250 +- .../cloud/bridge/io/FileRangeDataSource.java | 138 +- .../cloud/bridge/io/FileRangeInputStream.java | 208 +- .../io/MTOMAwareResultStreamWriter.java | 16 + .../bridge/io/MultiPartDimeInputStream.java | 358 +- .../bridge/io/S3FileSystemBucketAdapter.java | 512 +- .../lifecycle/ServiceEngineLifecycle.java | 124 +- .../src/com/cloud/bridge/model/MHost.hbm.xml | 74 +- awsapi/src/com/cloud/bridge/model/MHost.java | 242 +- .../com/cloud/bridge/model/MHostMount.hbm.xml | 56 +- .../com/cloud/bridge/model/MHostMount.java | 204 +- .../src/com/cloud/bridge/model/SAcl.hbm.xml | 72 +- awsapi/src/com/cloud/bridge/model/SAcl.java | 494 +- .../com/cloud/bridge/model/SBucket.hbm.xml | 76 +- .../src/com/cloud/bridge/model/SBucket.java | 272 +- .../src/com/cloud/bridge/model/SHost.hbm.xml | 84 +- awsapi/src/com/cloud/bridge/model/SHost.java | 250 +- .../src/com/cloud/bridge/model/SMeta.hbm.xml | 46 +- awsapi/src/com/cloud/bridge/model/SMeta.java | 208 +- .../com/cloud/bridge/model/SObject.hbm.xml | 82 +- .../src/com/cloud/bridge/model/SObject.java | 432 +- .../cloud/bridge/model/SObjectItem.hbm.xml | 88 +- .../com/cloud/bridge/model/SObjectItem.java | 318 +- .../bridge/model/UserCredentials.hbm.xml | 40 +- .../cloud/bridge/model/UserCredentials.java | 204 +- .../com/cloud/bridge/persist/EntityDao.java | 252 +- .../bridge/persist/GMTDateTimeUserType.java | 220 +- .../cloud/bridge/persist/PersistContext.java | 734 +- .../bridge/persist/PersistException.java | 92 +- .../com/cloud/bridge/persist/dao/BaseDao.java | 166 +- .../bridge/persist/dao/BucketPolicyDao.java | 16 + .../persist/dao/CloudStackAccountDao.java | 84 +- .../dao/CloudStackConfigurationDao.java | 98 +- .../persist/dao/CloudStackSvcOfferingDao.java | 98 +- .../cloud/bridge/persist/dao/MHostDao.java | 80 +- .../bridge/persist/dao/MHostMountDao.java | 80 +- .../bridge/persist/dao/MultipartLoadDao.java | 16 + .../cloud/bridge/persist/dao/OfferingDao.java | 16 + .../com/cloud/bridge/persist/dao/SAclDao.java | 172 +- .../cloud/bridge/persist/dao/SBucketDao.java | 94 +- .../cloud/bridge/persist/dao/SHostDao.java | 90 +- .../cloud/bridge/persist/dao/SMetaDao.java | 130 +- .../cloud/bridge/persist/dao/SObjectDao.java | 172 +- .../bridge/persist/dao/SObjectItemDao.java | 80 +- .../persist/dao/UserCredentialsDao.java | 352 +- .../cloud/bridge/service/EC2MainServlet.java | 16 + .../cloud/bridge/service/EC2RestServlet.java | 16 + .../cloud/bridge/service/EC2SoapService.java | 16 + .../bridge/service/EC2SoapServiceImpl.java | 16 + .../com/cloud/bridge/service/S3Constants.java | 70 +- .../cloud/bridge/service/S3RestServlet.java | 16 + .../com/cloud/bridge/service/UserContext.java | 238 +- .../com/cloud/bridge/service/UserInfo.java | 138 +- .../service/controller/s3/S3BucketAction.java | 16 + .../service/controller/s3/S3ObjectAction.java | 16 + .../S3SerializableServiceImplementation.java | 1464 +- .../controller/s3/ServiceProvider.java | 16 + .../service/controller/s3/ServletAction.java | 74 +- .../bridge/service/core/ec2/Account.java | 16 + .../bridge/service/core/ec2/DiskOffer.java | 180 +- .../service/core/ec2/DiskOfferings.java | 86 +- .../bridge/service/core/ec2/EC2Address.java | 16 + .../service/core/ec2/EC2AddressFilterSet.java | 16 + .../service/core/ec2/EC2AssociateAddress.java | 16 + .../ec2/EC2AuthorizeRevokeSecurityGroup.java | 76 +- .../ec2/EC2AvailabilityZonesFilterSet.java | 16 + .../service/core/ec2/EC2CreateImage.java | 122 +- .../core/ec2/EC2CreateImageResponse.java | 82 +- .../service/core/ec2/EC2CreateKeyPair.java | 16 + .../service/core/ec2/EC2CreateVolume.java | 168 +- .../service/core/ec2/EC2DeleteKeyPair.java | 16 + .../core/ec2/EC2DescribeAddresses.java | 16 + .../ec2/EC2DescribeAddressesResponse.java | 16 + .../ec2/EC2DescribeAvailabilityZones.java | 86 +- .../EC2DescribeAvailabilityZonesResponse.java | 114 +- .../core/ec2/EC2DescribeImageAttribute.java | 108 +- .../service/core/ec2/EC2DescribeImages.java | 122 +- .../core/ec2/EC2DescribeImagesResponse.java | 86 +- .../core/ec2/EC2DescribeInstances.java | 104 +- .../ec2/EC2DescribeInstancesResponse.java | 86 +- .../service/core/ec2/EC2DescribeKeyPairs.java | 16 + .../core/ec2/EC2DescribeKeyPairsResponse.java | 16 + .../core/ec2/EC2DescribeSecurityGroups.java | 74 +- .../EC2DescribeSecurityGroupsResponse.java | 56 +- .../core/ec2/EC2DescribeSnapshots.java | 104 +- .../ec2/EC2DescribeSnapshotsResponse.java | 86 +- .../service/core/ec2/EC2DescribeVolumes.java | 104 +- .../core/ec2/EC2DescribeVolumesResponse.java | 94 +- .../core/ec2/EC2DisassociateAddress.java | 16 + .../bridge/service/core/ec2/EC2Engine.java | 16 + .../bridge/service/core/ec2/EC2Filter.java | 16 + .../service/core/ec2/EC2GroupFilterSet.java | 16 + .../bridge/service/core/ec2/EC2Image.java | 230 +- .../service/core/ec2/EC2ImageAttributes.java | 188 +- .../service/core/ec2/EC2ImportKeyPair.java | 16 + .../bridge/service/core/ec2/EC2Instance.java | 416 +- .../core/ec2/EC2InstanceFilterSet.java | 16 + .../service/core/ec2/EC2IpPermission.java | 256 +- .../service/core/ec2/EC2KeyPairFilterSet.java | 16 + .../core/ec2/EC2ModifyImageAttribute.java | 204 +- .../service/core/ec2/EC2PasswordData.java | 16 + .../service/core/ec2/EC2RebootInstances.java | 86 +- .../service/core/ec2/EC2RegisterImage.java | 204 +- .../service/core/ec2/EC2ReleaseAddress.java | 16 + .../service/core/ec2/EC2RunInstances.java | 266 +- .../core/ec2/EC2RunInstancesResponse.java | 90 +- .../service/core/ec2/EC2SSHKeyPair.java | 16 + .../service/core/ec2/EC2SecurityGroup.java | 174 +- .../bridge/service/core/ec2/EC2Snapshot.java | 252 +- .../core/ec2/EC2SnapshotFilterSet.java | 16 + .../service/core/ec2/EC2StartInstances.java | 86 +- .../core/ec2/EC2StartInstancesResponse.java | 88 +- .../service/core/ec2/EC2StopInstances.java | 108 +- .../core/ec2/EC2StopInstancesResponse.java | 86 +- .../bridge/service/core/ec2/EC2Volume.java | 482 +- .../service/core/ec2/EC2VolumeFilterSet.java | 16 + .../core/ec2/IpForwardingRuleResponse.java | 16 + .../service/core/ec2/OfferingBundle.java | 84 +- .../bridge/service/core/ec2/ServiceOffer.java | 190 +- .../service/core/ec2/ServiceOfferings.java | 88 +- .../service/core/s3/S3AccessControlList.java | 100 +- .../core/s3/S3AccessControlPolicy.java | 104 +- .../bridge/service/core/s3/S3AuthParams.java | 100 +- .../service/core/s3/S3BucketAdapter.java | 90 +- .../service/core/s3/S3BucketPolicy.java | 16 + .../service/core/s3/S3CanonicalUser.java | 114 +- .../service/core/s3/S3ConditionFactory.java | 16 + .../service/core/s3/S3ConditionalHeaders.java | 350 +- .../service/core/s3/S3CopyObjectRequest.java | 16 + .../service/core/s3/S3CopyObjectResponse.java | 16 + .../core/s3/S3CreateBucketConfiguration.java | 100 +- .../core/s3/S3CreateBucketRequest.java | 140 +- .../core/s3/S3CreateBucketResponse.java | 86 +- .../core/s3/S3DeleteBucketRequest.java | 86 +- .../core/s3/S3DeleteObjectRequest.java | 124 +- .../bridge/service/core/s3/S3Engine.java | 3774 +- ...S3GetBucketAccessControlPolicyRequest.java | 86 +- ...S3GetObjectAccessControlPolicyRequest.java | 122 +- .../service/core/s3/S3GetObjectRequest.java | 252 +- .../service/core/s3/S3GetObjectResponse.java | 206 +- .../cloud/bridge/service/core/s3/S3Grant.java | 184 +- .../service/core/s3/S3HostCallingFormat.java | 16 + .../core/s3/S3ListAllMyBucketsEntry.java | 132 +- .../core/s3/S3ListAllMyBucketsRequest.java | 66 +- .../core/s3/S3ListAllMyBucketsResponse.java | 108 +- .../core/s3/S3ListBucketObjectEntry.java | 298 +- .../core/s3/S3ListBucketPrefixEntry.java | 94 +- .../service/core/s3/S3ListBucketRequest.java | 176 +- .../service/core/s3/S3ListBucketResponse.java | 264 +- .../service/core/s3/S3MetaDataEntry.java | 102 +- .../service/core/s3/S3MultipartPart.java | 16 + .../service/core/s3/S3MultipartUpload.java | 16 + .../service/core/s3/S3PolicyAction.java | 16 + .../service/core/s3/S3PolicyArnCondition.java | 16 + .../core/s3/S3PolicyBoolCondition.java | 16 + .../service/core/s3/S3PolicyCondition.java | 16 + .../core/s3/S3PolicyConditionBlock.java | 16 + .../service/core/s3/S3PolicyContext.java | 16 + .../core/s3/S3PolicyDateCondition.java | 16 + .../core/s3/S3PolicyIPAddressCondition.java | 16 + .../core/s3/S3PolicyNumericCondition.java | 16 + .../service/core/s3/S3PolicyPrincipal.java | 16 + .../service/core/s3/S3PolicyStatement.java | 16 + .../core/s3/S3PolicyStringCondition.java | 16 + .../core/s3/S3PutObjectInlineRequest.java | 238 +- .../core/s3/S3PutObjectInlineResponse.java | 150 +- .../service/core/s3/S3PutObjectRequest.java | 234 +- .../service/core/s3/S3PutObjectResponse.java | 108 +- .../bridge/service/core/s3/S3Request.java | 124 +- .../bridge/service/core/s3/S3Response.java | 130 +- ...S3SetBucketAccessControlPolicyRequest.java | 104 +- ...S3SetObjectAccessControlPolicyRequest.java | 140 +- .../exception/ConfigurationException.java | 92 +- .../exception/EC2ServiceException.java | 318 +- .../exception/FileNotExistException.java | 92 +- .../exception/HostNotMountedException.java | 92 +- .../exception/InternalErrorException.java | 92 +- .../service/exception/InvalidBucketName.java | 16 + .../InvalidRequestContentException.java | 92 +- .../service/exception/NetworkIOException.java | 92 +- .../exception/NoSuchObjectException.java | 94 +- .../ObjectAlreadyExistsException.java | 92 +- .../exception/OutOfServiceException.java | 92 +- .../exception/OutOfStorageException.java | 92 +- .../exception/PermissionDeniedException.java | 92 +- .../exception/UnsupportedException.java | 56 +- .../com/cloud/bridge/tool/CloudS3CmdTool.java | 666 +- .../bridge/util/AuthenticationUtils.java | 108 +- .../cloud/bridge/util/CalendarDateParam.java | 84 +- .../bridge/util/CloudSessionFactory.java | 232 +- .../bridge/util/CloudStackSessionFactory.java | 234 +- .../bridge/util/ConfigurationHelper.java | 224 +- .../src/com/cloud/bridge/util/Converter.java | 152 +- .../com/cloud/bridge/util/CryptoHelper.java | 60 +- .../bridge/util/DatabindingConverterUtil.java | 16 + .../src/com/cloud/bridge/util/DateHelper.java | 208 +- .../com/cloud/bridge/util/EC2RestAuth.java | 562 +- .../util/EncryptionSecretKeyCheckerUtil.java | 260 +- .../com/cloud/bridge/util/EntityParam.java | 78 +- .../com/cloud/bridge/util/HeaderParam.java | 82 +- .../util/ISO8601SimpleDateTimeFormat.java | 16 + .../com/cloud/bridge/util/IpAddressRange.java | 16 + .../com/cloud/bridge/util/IteratorHelper.java | 128 +- .../com/cloud/bridge/util/JsonAccessor.java | 518 +- .../src/com/cloud/bridge/util/NetHelper.java | 210 +- .../com/cloud/bridge/util/OrderedPair.java | 120 +- .../com/cloud/bridge/util/PolicyParser.java | 16 + .../com/cloud/bridge/util/QueryHelper.java | 190 +- .../src/com/cloud/bridge/util/RestAuth.java | 16 + .../src/com/cloud/bridge/util/S3SoapAuth.java | 162 +- .../bridge/util/ServletRequestDataSource.java | 138 +- .../com/cloud/bridge/util/StringHelper.java | 238 +- .../src/com/cloud/bridge/util/TextParam.java | 78 +- .../src/com/cloud/bridge/util/TimeParam.java | 82 +- .../com/cloud/bridge/util/TimestampParam.java | 82 +- awsapi/src/com/cloud/bridge/util/Triple.java | 16 + .../src/com/cloud/bridge/util/XElement.java | 82 +- .../src/com/cloud/bridge/util/XFlatten.java | 76 +- .../src/com/cloud/bridge/util/XOmitNull.java | 76 +- .../com/cloud/bridge/util/XSerializable.java | 72 +- .../com/cloud/bridge/util/XSerializer.java | 1012 +- .../cloud/bridge/util/XSerializerAdapter.java | 80 +- .../bridge/util/XSerializerJsonAdapter.java | 346 +- .../bridge/util/XSerializerXmlAdapter.java | 362 +- .../src/com/cloud/bridge/util/XmlHelper.java | 366 +- awsapi/src/com/cloud/stack/CloudStackApi.java | 16 + .../src/com/cloud/stack/CloudStackClient.java | 410 +- .../com/cloud/stack/CloudStackCommand.java | 314 +- .../com/cloud/stack/models/ApiConstants.java | 1028 +- .../stack/models/CloudStackAccount.hbm.xml | 32 +- .../cloud/stack/models/CloudStackAccount.java | 16 + .../stack/models/CloudStackCapabilities.java | 16 + .../models/CloudStackConfiguration.hbm.xml | 38 +- .../stack/models/CloudStackConfiguration.java | 128 +- .../stack/models/CloudStackDiskOffering.java | 16 + .../cloud/stack/models/CloudStackEvent.java | 16 + .../stack/models/CloudStackEventType.java | 16 + .../models/CloudStackExtractTemplate.java | 16 + .../stack/models/CloudStackIdentifier.java | 16 + .../stack/models/CloudStackInfoResponse.java | 132 +- .../stack/models/CloudStackIngressRule.java | 190 +- .../stack/models/CloudStackInstanceGroup.java | 16 + .../stack/models/CloudStackIpAddress.java | 318 +- .../cloud/stack/models/CloudStackKeyPair.java | 16 + .../stack/models/CloudStackKeyValue.java | 16 + .../models/CloudStackLoadBalancerRule.java | 16 + .../cloud/stack/models/CloudStackNetwork.java | 16 + .../models/CloudStackNetworkOffering.java | 16 + .../models/CloudStackNetworkService.java | 16 + .../CloudStackNetworkServiceCapability.java | 16 + .../com/cloud/stack/models/CloudStackNic.java | 224 +- .../stack/models/CloudStackOsCategory.java | 16 + .../cloud/stack/models/CloudStackOsType.java | 16 + .../stack/models/CloudStackPasswordData.java | 16 + .../models/CloudStackPortForwardingRule.java | 16 + .../stack/models/CloudStackResourceLimit.java | 126 +- .../stack/models/CloudStackSecurityGroup.java | 178 +- .../CloudStackSecurityGroupIngress.java | 16 + .../models/CloudStackServiceOffering.hbm.xml | 32 +- .../models/CloudStackServiceOffering.java | 16 + .../stack/models/CloudStackSnapshot.java | 232 +- .../models/CloudStackSnapshotPolicy.java | 16 + .../stack/models/CloudStackTemplate.java | 16 + .../models/CloudStackTemplatePermission.java | 16 + .../cloud/stack/models/CloudStackUser.java | 16 + .../cloud/stack/models/CloudStackUserVm.java | 810 +- .../cloud/stack/models/CloudStackVolume.java | 688 +- .../cloud/stack/models/CloudStackZone.java | 370 +- .../com/cloud/gate/model/ModelTestCase.java | 720 +- .../cloud/gate/persist/PersitTestCase.java | 130 +- .../cloud/gate/service/ServiceTestCase.java | 140 +- .../com/cloud/gate/testcase/BaseTestCase.java | 100 +- .../gate/util/CloudStackClientTestCase.java | 124 +- .../cloud/gate/util/JsonAccessorTestCase.java | 118 +- .../com/cloud/gate/util/UtilTestCase.java | 362 +- .../com/cloud/gate/util/Xml2JavaTestData.xml | 72 +- 964 files changed, 134127 insertions(+), 118945 deletions(-) diff --git a/awsapi/deploy-cloud-bridge.sh b/awsapi/deploy-cloud-bridge.sh index 42743604fcf..d36c0225b87 100644 --- a/awsapi/deploy-cloud-bridge.sh +++ b/awsapi/deploy-cloud-bridge.sh @@ -1,6 +1,20 @@ #!/usr/bin/env bash -# deploy.sh -- deploys a cloud-bridge -# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. usage() { printf "Usage: %s: -d [tomcat directory to deploy to] -z [zip file to use]\n" $(basename $0) >&2 diff --git a/awsapi/install.sh b/awsapi/install.sh index fc0aa0265b0..5362f41ec92 100644 --- a/awsapi/install.sh +++ b/awsapi/install.sh @@ -1,4 +1,20 @@ #!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. # install.sh -- deploys cloud-bridge and the corresponding DB diff --git a/awsapi/scripts/run.sh b/awsapi/scripts/run.sh index 82f810b9b48..cc7c84a79e9 100644 --- a/awsapi/scripts/run.sh +++ b/awsapi/scripts/run.sh @@ -1,3 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. CP=. for file in lib/*.jar do diff --git a/awsapi/src/com/amazon/ec2/ActivateLicense.java b/awsapi/src/com/amazon/ec2/ActivateLicense.java index 133e3706944..14f2caadb47 100644 --- a/awsapi/src/com/amazon/ec2/ActivateLicense.java +++ b/awsapi/src/com/amazon/ec2/ActivateLicense.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ActivateLicense.java diff --git a/awsapi/src/com/amazon/ec2/ActivateLicenseResponse.java b/awsapi/src/com/amazon/ec2/ActivateLicenseResponse.java index b682352560f..5c0af5f1a26 100644 --- a/awsapi/src/com/amazon/ec2/ActivateLicenseResponse.java +++ b/awsapi/src/com/amazon/ec2/ActivateLicenseResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ActivateLicenseResponse.java diff --git a/awsapi/src/com/amazon/ec2/ActivateLicenseResponseType.java b/awsapi/src/com/amazon/ec2/ActivateLicenseResponseType.java index c5c2018f97e..e534e9a06e9 100644 --- a/awsapi/src/com/amazon/ec2/ActivateLicenseResponseType.java +++ b/awsapi/src/com/amazon/ec2/ActivateLicenseResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ActivateLicenseResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ActivateLicenseType.java b/awsapi/src/com/amazon/ec2/ActivateLicenseType.java index beae7bc11e6..9965457248d 100644 --- a/awsapi/src/com/amazon/ec2/ActivateLicenseType.java +++ b/awsapi/src/com/amazon/ec2/ActivateLicenseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ActivateLicenseType.java diff --git a/awsapi/src/com/amazon/ec2/AllocateAddress.java b/awsapi/src/com/amazon/ec2/AllocateAddress.java index 7c4b6326c7b..318b5cc7dee 100644 --- a/awsapi/src/com/amazon/ec2/AllocateAddress.java +++ b/awsapi/src/com/amazon/ec2/AllocateAddress.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AllocateAddress.java diff --git a/awsapi/src/com/amazon/ec2/AllocateAddressResponse.java b/awsapi/src/com/amazon/ec2/AllocateAddressResponse.java index 6e637ec6ce2..0452850f46e 100644 --- a/awsapi/src/com/amazon/ec2/AllocateAddressResponse.java +++ b/awsapi/src/com/amazon/ec2/AllocateAddressResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AllocateAddressResponse.java diff --git a/awsapi/src/com/amazon/ec2/AllocateAddressResponseType.java b/awsapi/src/com/amazon/ec2/AllocateAddressResponseType.java index 898d39e45d5..5218e08d29b 100644 --- a/awsapi/src/com/amazon/ec2/AllocateAddressResponseType.java +++ b/awsapi/src/com/amazon/ec2/AllocateAddressResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AllocateAddressResponseType.java diff --git a/awsapi/src/com/amazon/ec2/AllocateAddressType.java b/awsapi/src/com/amazon/ec2/AllocateAddressType.java index 931483617c9..2fb4fd91706 100644 --- a/awsapi/src/com/amazon/ec2/AllocateAddressType.java +++ b/awsapi/src/com/amazon/ec2/AllocateAddressType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AllocateAddressType.java diff --git a/awsapi/src/com/amazon/ec2/AmazonEC2MessageReceiverInOut.java b/awsapi/src/com/amazon/ec2/AmazonEC2MessageReceiverInOut.java index 4cfd80647cc..f552780751f 100644 --- a/awsapi/src/com/amazon/ec2/AmazonEC2MessageReceiverInOut.java +++ b/awsapi/src/com/amazon/ec2/AmazonEC2MessageReceiverInOut.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AmazonEC2MessageReceiverInOut.java diff --git a/awsapi/src/com/amazon/ec2/AmazonEC2Skeleton.java b/awsapi/src/com/amazon/ec2/AmazonEC2Skeleton.java index 20032724ffb..6b116f0909f 100644 --- a/awsapi/src/com/amazon/ec2/AmazonEC2Skeleton.java +++ b/awsapi/src/com/amazon/ec2/AmazonEC2Skeleton.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AmazonEC2Skeleton.java diff --git a/awsapi/src/com/amazon/ec2/AmazonEC2SkeletonInterface.java b/awsapi/src/com/amazon/ec2/AmazonEC2SkeletonInterface.java index d0eb4aed86d..f8700887d8a 100644 --- a/awsapi/src/com/amazon/ec2/AmazonEC2SkeletonInterface.java +++ b/awsapi/src/com/amazon/ec2/AmazonEC2SkeletonInterface.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AmazonEC2SkeletonInterface.java diff --git a/awsapi/src/com/amazon/ec2/AssociateAddress.java b/awsapi/src/com/amazon/ec2/AssociateAddress.java index 3e993ea8b75..912f0a61f75 100644 --- a/awsapi/src/com/amazon/ec2/AssociateAddress.java +++ b/awsapi/src/com/amazon/ec2/AssociateAddress.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AssociateAddress.java diff --git a/awsapi/src/com/amazon/ec2/AssociateAddressResponse.java b/awsapi/src/com/amazon/ec2/AssociateAddressResponse.java index 27488f52c19..583b405e502 100644 --- a/awsapi/src/com/amazon/ec2/AssociateAddressResponse.java +++ b/awsapi/src/com/amazon/ec2/AssociateAddressResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AssociateAddressResponse.java diff --git a/awsapi/src/com/amazon/ec2/AssociateAddressResponseType.java b/awsapi/src/com/amazon/ec2/AssociateAddressResponseType.java index 62c02c40472..6cce69b734b 100644 --- a/awsapi/src/com/amazon/ec2/AssociateAddressResponseType.java +++ b/awsapi/src/com/amazon/ec2/AssociateAddressResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AssociateAddressResponseType.java diff --git a/awsapi/src/com/amazon/ec2/AssociateAddressType.java b/awsapi/src/com/amazon/ec2/AssociateAddressType.java index 6bc6fe9cdbe..973776d3ab0 100644 --- a/awsapi/src/com/amazon/ec2/AssociateAddressType.java +++ b/awsapi/src/com/amazon/ec2/AssociateAddressType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AssociateAddressType.java diff --git a/awsapi/src/com/amazon/ec2/AssociateDhcpOptions.java b/awsapi/src/com/amazon/ec2/AssociateDhcpOptions.java index 184d538cac9..117aa2e10ad 100644 --- a/awsapi/src/com/amazon/ec2/AssociateDhcpOptions.java +++ b/awsapi/src/com/amazon/ec2/AssociateDhcpOptions.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AssociateDhcpOptions.java diff --git a/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsResponse.java b/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsResponse.java index 54969e74d42..7bdb35c4b01 100644 --- a/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsResponse.java +++ b/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AssociateDhcpOptionsResponse.java diff --git a/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsResponseType.java b/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsResponseType.java index 4c6f9989ee3..a2d95d06133 100644 --- a/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsResponseType.java +++ b/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AssociateDhcpOptionsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsType.java b/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsType.java index 6530ecb6b4e..4fa96ab21bc 100644 --- a/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsType.java +++ b/awsapi/src/com/amazon/ec2/AssociateDhcpOptionsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AssociateDhcpOptionsType.java diff --git a/awsapi/src/com/amazon/ec2/AttachVolume.java b/awsapi/src/com/amazon/ec2/AttachVolume.java index 0124b13e728..b94f37bdf2c 100644 --- a/awsapi/src/com/amazon/ec2/AttachVolume.java +++ b/awsapi/src/com/amazon/ec2/AttachVolume.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachVolume.java diff --git a/awsapi/src/com/amazon/ec2/AttachVolumeResponse.java b/awsapi/src/com/amazon/ec2/AttachVolumeResponse.java index c7e1fc6de74..00be7f26c30 100644 --- a/awsapi/src/com/amazon/ec2/AttachVolumeResponse.java +++ b/awsapi/src/com/amazon/ec2/AttachVolumeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachVolumeResponse.java diff --git a/awsapi/src/com/amazon/ec2/AttachVolumeResponseType.java b/awsapi/src/com/amazon/ec2/AttachVolumeResponseType.java index 592b7da6d8f..4fd99e2666f 100644 --- a/awsapi/src/com/amazon/ec2/AttachVolumeResponseType.java +++ b/awsapi/src/com/amazon/ec2/AttachVolumeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachVolumeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/AttachVolumeType.java b/awsapi/src/com/amazon/ec2/AttachVolumeType.java index cb43e5fc546..4d2b3d8d13d 100644 --- a/awsapi/src/com/amazon/ec2/AttachVolumeType.java +++ b/awsapi/src/com/amazon/ec2/AttachVolumeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachVolumeType.java diff --git a/awsapi/src/com/amazon/ec2/AttachVpnGateway.java b/awsapi/src/com/amazon/ec2/AttachVpnGateway.java index aa933f35e80..61df233eccb 100644 --- a/awsapi/src/com/amazon/ec2/AttachVpnGateway.java +++ b/awsapi/src/com/amazon/ec2/AttachVpnGateway.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachVpnGateway.java diff --git a/awsapi/src/com/amazon/ec2/AttachVpnGatewayResponse.java b/awsapi/src/com/amazon/ec2/AttachVpnGatewayResponse.java index d09c34d0b58..6977363f828 100644 --- a/awsapi/src/com/amazon/ec2/AttachVpnGatewayResponse.java +++ b/awsapi/src/com/amazon/ec2/AttachVpnGatewayResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachVpnGatewayResponse.java diff --git a/awsapi/src/com/amazon/ec2/AttachVpnGatewayResponseType.java b/awsapi/src/com/amazon/ec2/AttachVpnGatewayResponseType.java index 0ddf03996dd..878c75237ca 100644 --- a/awsapi/src/com/amazon/ec2/AttachVpnGatewayResponseType.java +++ b/awsapi/src/com/amazon/ec2/AttachVpnGatewayResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachVpnGatewayResponseType.java diff --git a/awsapi/src/com/amazon/ec2/AttachVpnGatewayType.java b/awsapi/src/com/amazon/ec2/AttachVpnGatewayType.java index a02b663e494..768644ea426 100644 --- a/awsapi/src/com/amazon/ec2/AttachVpnGatewayType.java +++ b/awsapi/src/com/amazon/ec2/AttachVpnGatewayType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachVpnGatewayType.java diff --git a/awsapi/src/com/amazon/ec2/AttachmentSetItemResponseType.java b/awsapi/src/com/amazon/ec2/AttachmentSetItemResponseType.java index 63ec24127af..d1f258fd79d 100644 --- a/awsapi/src/com/amazon/ec2/AttachmentSetItemResponseType.java +++ b/awsapi/src/com/amazon/ec2/AttachmentSetItemResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachmentSetItemResponseType.java diff --git a/awsapi/src/com/amazon/ec2/AttachmentSetResponseType.java b/awsapi/src/com/amazon/ec2/AttachmentSetResponseType.java index 28efca8e066..b0a5148a9b9 100644 --- a/awsapi/src/com/amazon/ec2/AttachmentSetResponseType.java +++ b/awsapi/src/com/amazon/ec2/AttachmentSetResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachmentSetResponseType.java diff --git a/awsapi/src/com/amazon/ec2/AttachmentSetType.java b/awsapi/src/com/amazon/ec2/AttachmentSetType.java index 945ffa15052..d8a593a3d2c 100644 --- a/awsapi/src/com/amazon/ec2/AttachmentSetType.java +++ b/awsapi/src/com/amazon/ec2/AttachmentSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachmentSetType.java diff --git a/awsapi/src/com/amazon/ec2/AttachmentType.java b/awsapi/src/com/amazon/ec2/AttachmentType.java index 3c4d5e493b3..68380a9ae9b 100644 --- a/awsapi/src/com/amazon/ec2/AttachmentType.java +++ b/awsapi/src/com/amazon/ec2/AttachmentType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttachmentType.java diff --git a/awsapi/src/com/amazon/ec2/AttributeBooleanValueType.java b/awsapi/src/com/amazon/ec2/AttributeBooleanValueType.java index cb04774d5e1..2def712db77 100644 --- a/awsapi/src/com/amazon/ec2/AttributeBooleanValueType.java +++ b/awsapi/src/com/amazon/ec2/AttributeBooleanValueType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttributeBooleanValueType.java diff --git a/awsapi/src/com/amazon/ec2/AttributeValueType.java b/awsapi/src/com/amazon/ec2/AttributeValueType.java index ee5802486be..5f1d5b18d2e 100644 --- a/awsapi/src/com/amazon/ec2/AttributeValueType.java +++ b/awsapi/src/com/amazon/ec2/AttributeValueType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AttributeValueType.java diff --git a/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngress.java b/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngress.java index 7f37d1d5860..94bc33385cd 100644 --- a/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngress.java +++ b/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngress.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AuthorizeSecurityGroupIngress.java diff --git a/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressResponse.java b/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressResponse.java index b983e3c845c..e76ba0c9719 100644 --- a/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressResponse.java +++ b/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AuthorizeSecurityGroupIngressResponse.java diff --git a/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressResponseType.java b/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressResponseType.java index 29dc228afce..8964fd16a24 100644 --- a/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressResponseType.java +++ b/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AuthorizeSecurityGroupIngressResponseType.java diff --git a/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressType.java b/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressType.java index 8b39127b684..7ed7e5e430f 100644 --- a/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressType.java +++ b/awsapi/src/com/amazon/ec2/AuthorizeSecurityGroupIngressType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AuthorizeSecurityGroupIngressType.java diff --git a/awsapi/src/com/amazon/ec2/AvailabilityZoneItemType.java b/awsapi/src/com/amazon/ec2/AvailabilityZoneItemType.java index 0fa826127ca..8f6ed870685 100644 --- a/awsapi/src/com/amazon/ec2/AvailabilityZoneItemType.java +++ b/awsapi/src/com/amazon/ec2/AvailabilityZoneItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AvailabilityZoneItemType.java diff --git a/awsapi/src/com/amazon/ec2/AvailabilityZoneMessageSetType.java b/awsapi/src/com/amazon/ec2/AvailabilityZoneMessageSetType.java index 6d759f13ef9..ebe77ff73b6 100644 --- a/awsapi/src/com/amazon/ec2/AvailabilityZoneMessageSetType.java +++ b/awsapi/src/com/amazon/ec2/AvailabilityZoneMessageSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AvailabilityZoneMessageSetType.java diff --git a/awsapi/src/com/amazon/ec2/AvailabilityZoneMessageType.java b/awsapi/src/com/amazon/ec2/AvailabilityZoneMessageType.java index 150adecff5b..eb6a4684474 100644 --- a/awsapi/src/com/amazon/ec2/AvailabilityZoneMessageType.java +++ b/awsapi/src/com/amazon/ec2/AvailabilityZoneMessageType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AvailabilityZoneMessageType.java diff --git a/awsapi/src/com/amazon/ec2/AvailabilityZoneSetType.java b/awsapi/src/com/amazon/ec2/AvailabilityZoneSetType.java index 61af511d259..520ccd93ee0 100644 --- a/awsapi/src/com/amazon/ec2/AvailabilityZoneSetType.java +++ b/awsapi/src/com/amazon/ec2/AvailabilityZoneSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AvailabilityZoneSetType.java diff --git a/awsapi/src/com/amazon/ec2/BlockDeviceMappingItemType.java b/awsapi/src/com/amazon/ec2/BlockDeviceMappingItemType.java index 8afad66538d..1fecf0b8485 100644 --- a/awsapi/src/com/amazon/ec2/BlockDeviceMappingItemType.java +++ b/awsapi/src/com/amazon/ec2/BlockDeviceMappingItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BlockDeviceMappingItemType.java diff --git a/awsapi/src/com/amazon/ec2/BlockDeviceMappingItemTypeChoice_type0.java b/awsapi/src/com/amazon/ec2/BlockDeviceMappingItemTypeChoice_type0.java index f955eaf32f9..0cf664e6367 100644 --- a/awsapi/src/com/amazon/ec2/BlockDeviceMappingItemTypeChoice_type0.java +++ b/awsapi/src/com/amazon/ec2/BlockDeviceMappingItemTypeChoice_type0.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BlockDeviceMappingItemTypeChoice_type0.java diff --git a/awsapi/src/com/amazon/ec2/BlockDeviceMappingType.java b/awsapi/src/com/amazon/ec2/BlockDeviceMappingType.java index a3071c3c8cb..c7cc8a81285 100644 --- a/awsapi/src/com/amazon/ec2/BlockDeviceMappingType.java +++ b/awsapi/src/com/amazon/ec2/BlockDeviceMappingType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BlockDeviceMappingType.java diff --git a/awsapi/src/com/amazon/ec2/BundleInstance.java b/awsapi/src/com/amazon/ec2/BundleInstance.java index b34d8028aec..703ac0d41e4 100644 --- a/awsapi/src/com/amazon/ec2/BundleInstance.java +++ b/awsapi/src/com/amazon/ec2/BundleInstance.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BundleInstance.java diff --git a/awsapi/src/com/amazon/ec2/BundleInstanceResponse.java b/awsapi/src/com/amazon/ec2/BundleInstanceResponse.java index dc73834a254..348f8dd5212 100644 --- a/awsapi/src/com/amazon/ec2/BundleInstanceResponse.java +++ b/awsapi/src/com/amazon/ec2/BundleInstanceResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BundleInstanceResponse.java diff --git a/awsapi/src/com/amazon/ec2/BundleInstanceResponseType.java b/awsapi/src/com/amazon/ec2/BundleInstanceResponseType.java index 22dd98a24c4..8348c00827b 100644 --- a/awsapi/src/com/amazon/ec2/BundleInstanceResponseType.java +++ b/awsapi/src/com/amazon/ec2/BundleInstanceResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BundleInstanceResponseType.java diff --git a/awsapi/src/com/amazon/ec2/BundleInstanceS3StorageType.java b/awsapi/src/com/amazon/ec2/BundleInstanceS3StorageType.java index 8b34f995723..32164889746 100644 --- a/awsapi/src/com/amazon/ec2/BundleInstanceS3StorageType.java +++ b/awsapi/src/com/amazon/ec2/BundleInstanceS3StorageType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BundleInstanceS3StorageType.java diff --git a/awsapi/src/com/amazon/ec2/BundleInstanceTaskErrorType.java b/awsapi/src/com/amazon/ec2/BundleInstanceTaskErrorType.java index b6a21753ec3..5402ee8e4fd 100644 --- a/awsapi/src/com/amazon/ec2/BundleInstanceTaskErrorType.java +++ b/awsapi/src/com/amazon/ec2/BundleInstanceTaskErrorType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BundleInstanceTaskErrorType.java diff --git a/awsapi/src/com/amazon/ec2/BundleInstanceTaskStorageType.java b/awsapi/src/com/amazon/ec2/BundleInstanceTaskStorageType.java index 780c99a41a9..0e9b7b54aab 100644 --- a/awsapi/src/com/amazon/ec2/BundleInstanceTaskStorageType.java +++ b/awsapi/src/com/amazon/ec2/BundleInstanceTaskStorageType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BundleInstanceTaskStorageType.java diff --git a/awsapi/src/com/amazon/ec2/BundleInstanceTaskType.java b/awsapi/src/com/amazon/ec2/BundleInstanceTaskType.java index be37c43684d..c6bbb586246 100644 --- a/awsapi/src/com/amazon/ec2/BundleInstanceTaskType.java +++ b/awsapi/src/com/amazon/ec2/BundleInstanceTaskType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BundleInstanceTaskType.java diff --git a/awsapi/src/com/amazon/ec2/BundleInstanceTasksSetType.java b/awsapi/src/com/amazon/ec2/BundleInstanceTasksSetType.java index c1cb6e67fc2..b6277f2ad1b 100644 --- a/awsapi/src/com/amazon/ec2/BundleInstanceTasksSetType.java +++ b/awsapi/src/com/amazon/ec2/BundleInstanceTasksSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BundleInstanceTasksSetType.java diff --git a/awsapi/src/com/amazon/ec2/BundleInstanceType.java b/awsapi/src/com/amazon/ec2/BundleInstanceType.java index a07c89db85c..c766b1e0bfc 100644 --- a/awsapi/src/com/amazon/ec2/BundleInstanceType.java +++ b/awsapi/src/com/amazon/ec2/BundleInstanceType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * BundleInstanceType.java diff --git a/awsapi/src/com/amazon/ec2/CancelBundleTask.java b/awsapi/src/com/amazon/ec2/CancelBundleTask.java index bf484a7a87d..12dd5869ea7 100644 --- a/awsapi/src/com/amazon/ec2/CancelBundleTask.java +++ b/awsapi/src/com/amazon/ec2/CancelBundleTask.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelBundleTask.java diff --git a/awsapi/src/com/amazon/ec2/CancelBundleTaskResponse.java b/awsapi/src/com/amazon/ec2/CancelBundleTaskResponse.java index 751bf1a44ce..7f7307acd9f 100644 --- a/awsapi/src/com/amazon/ec2/CancelBundleTaskResponse.java +++ b/awsapi/src/com/amazon/ec2/CancelBundleTaskResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelBundleTaskResponse.java diff --git a/awsapi/src/com/amazon/ec2/CancelBundleTaskResponseType.java b/awsapi/src/com/amazon/ec2/CancelBundleTaskResponseType.java index d7d55a1add1..408cf0dfd90 100644 --- a/awsapi/src/com/amazon/ec2/CancelBundleTaskResponseType.java +++ b/awsapi/src/com/amazon/ec2/CancelBundleTaskResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelBundleTaskResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CancelBundleTaskType.java b/awsapi/src/com/amazon/ec2/CancelBundleTaskType.java index 2e5ef8bfa10..303b2b5a0e6 100644 --- a/awsapi/src/com/amazon/ec2/CancelBundleTaskType.java +++ b/awsapi/src/com/amazon/ec2/CancelBundleTaskType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelBundleTaskType.java diff --git a/awsapi/src/com/amazon/ec2/CancelConversionTask.java b/awsapi/src/com/amazon/ec2/CancelConversionTask.java index 94f3faccfc5..41ef6f9ad03 100644 --- a/awsapi/src/com/amazon/ec2/CancelConversionTask.java +++ b/awsapi/src/com/amazon/ec2/CancelConversionTask.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelConversionTask.java diff --git a/awsapi/src/com/amazon/ec2/CancelConversionTaskResponse.java b/awsapi/src/com/amazon/ec2/CancelConversionTaskResponse.java index 549dba47545..8b6f06213d0 100644 --- a/awsapi/src/com/amazon/ec2/CancelConversionTaskResponse.java +++ b/awsapi/src/com/amazon/ec2/CancelConversionTaskResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelConversionTaskResponse.java diff --git a/awsapi/src/com/amazon/ec2/CancelConversionTaskResponseType.java b/awsapi/src/com/amazon/ec2/CancelConversionTaskResponseType.java index db7ff2eab53..b1986efc04b 100644 --- a/awsapi/src/com/amazon/ec2/CancelConversionTaskResponseType.java +++ b/awsapi/src/com/amazon/ec2/CancelConversionTaskResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelConversionTaskResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CancelConversionTaskType.java b/awsapi/src/com/amazon/ec2/CancelConversionTaskType.java index 68eb9151a7e..dce1b8fc514 100644 --- a/awsapi/src/com/amazon/ec2/CancelConversionTaskType.java +++ b/awsapi/src/com/amazon/ec2/CancelConversionTaskType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelConversionTaskType.java diff --git a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequests.java b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequests.java index 8390a1df532..6d390014a9d 100644 --- a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequests.java +++ b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequests.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelSpotInstanceRequests.java diff --git a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponse.java b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponse.java index d3a7fce092b..7dcc2d434eb 100644 --- a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponse.java +++ b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelSpotInstanceRequestsResponse.java diff --git a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseSetItemType.java b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseSetItemType.java index b219897ce00..93efbf8d8bb 100644 --- a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseSetItemType.java +++ b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelSpotInstanceRequestsResponseSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseSetType.java b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseSetType.java index 5de6d1ad8c7..73318560c9b 100644 --- a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseSetType.java +++ b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelSpotInstanceRequestsResponseSetType.java diff --git a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseType.java b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseType.java index b669d582778..37e99a3bc81 100644 --- a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseType.java +++ b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelSpotInstanceRequestsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsType.java b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsType.java index e318e5f021e..6cc7c93053f 100644 --- a/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsType.java +++ b/awsapi/src/com/amazon/ec2/CancelSpotInstanceRequestsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CancelSpotInstanceRequestsType.java diff --git a/awsapi/src/com/amazon/ec2/ConfirmProductInstance.java b/awsapi/src/com/amazon/ec2/ConfirmProductInstance.java index 931d8684072..5288dea74ad 100644 --- a/awsapi/src/com/amazon/ec2/ConfirmProductInstance.java +++ b/awsapi/src/com/amazon/ec2/ConfirmProductInstance.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ConfirmProductInstance.java diff --git a/awsapi/src/com/amazon/ec2/ConfirmProductInstanceResponse.java b/awsapi/src/com/amazon/ec2/ConfirmProductInstanceResponse.java index 3c4c25b5163..56bde3d7bc8 100644 --- a/awsapi/src/com/amazon/ec2/ConfirmProductInstanceResponse.java +++ b/awsapi/src/com/amazon/ec2/ConfirmProductInstanceResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ConfirmProductInstanceResponse.java diff --git a/awsapi/src/com/amazon/ec2/ConfirmProductInstanceResponseType.java b/awsapi/src/com/amazon/ec2/ConfirmProductInstanceResponseType.java index 9f6f738a08d..ddbfd00c7c6 100644 --- a/awsapi/src/com/amazon/ec2/ConfirmProductInstanceResponseType.java +++ b/awsapi/src/com/amazon/ec2/ConfirmProductInstanceResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ConfirmProductInstanceResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ConfirmProductInstanceType.java b/awsapi/src/com/amazon/ec2/ConfirmProductInstanceType.java index 6dfaf42a5a8..51cd3d2e436 100644 --- a/awsapi/src/com/amazon/ec2/ConfirmProductInstanceType.java +++ b/awsapi/src/com/amazon/ec2/ConfirmProductInstanceType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ConfirmProductInstanceType.java diff --git a/awsapi/src/com/amazon/ec2/ConversionTaskIdItemType.java b/awsapi/src/com/amazon/ec2/ConversionTaskIdItemType.java index f11f8742c8f..0540340fd59 100644 --- a/awsapi/src/com/amazon/ec2/ConversionTaskIdItemType.java +++ b/awsapi/src/com/amazon/ec2/ConversionTaskIdItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ConversionTaskIdItemType.java diff --git a/awsapi/src/com/amazon/ec2/ConversionTaskIdSetType.java b/awsapi/src/com/amazon/ec2/ConversionTaskIdSetType.java index b3b5c34bd04..4c673ca52f5 100644 --- a/awsapi/src/com/amazon/ec2/ConversionTaskIdSetType.java +++ b/awsapi/src/com/amazon/ec2/ConversionTaskIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ConversionTaskIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/ConversionTaskSetType.java b/awsapi/src/com/amazon/ec2/ConversionTaskSetType.java index 7fb9d268693..de63f548d5c 100644 --- a/awsapi/src/com/amazon/ec2/ConversionTaskSetType.java +++ b/awsapi/src/com/amazon/ec2/ConversionTaskSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ConversionTaskSetType.java diff --git a/awsapi/src/com/amazon/ec2/ConversionTaskType.java b/awsapi/src/com/amazon/ec2/ConversionTaskType.java index a4e5d2a4edd..750261b23be 100644 --- a/awsapi/src/com/amazon/ec2/ConversionTaskType.java +++ b/awsapi/src/com/amazon/ec2/ConversionTaskType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ConversionTaskType.java diff --git a/awsapi/src/com/amazon/ec2/ConversionTaskTypeChoice_type0.java b/awsapi/src/com/amazon/ec2/ConversionTaskTypeChoice_type0.java index 9a2c9f9144c..1334e036f29 100644 --- a/awsapi/src/com/amazon/ec2/ConversionTaskTypeChoice_type0.java +++ b/awsapi/src/com/amazon/ec2/ConversionTaskTypeChoice_type0.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ConversionTaskTypeChoice_type0.java diff --git a/awsapi/src/com/amazon/ec2/CreateCustomerGateway.java b/awsapi/src/com/amazon/ec2/CreateCustomerGateway.java index 20ddf3c1170..3f3feade6df 100644 --- a/awsapi/src/com/amazon/ec2/CreateCustomerGateway.java +++ b/awsapi/src/com/amazon/ec2/CreateCustomerGateway.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateCustomerGateway.java diff --git a/awsapi/src/com/amazon/ec2/CreateCustomerGatewayResponse.java b/awsapi/src/com/amazon/ec2/CreateCustomerGatewayResponse.java index da090172561..7db1f8b6f0d 100644 --- a/awsapi/src/com/amazon/ec2/CreateCustomerGatewayResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateCustomerGatewayResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateCustomerGatewayResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateCustomerGatewayResponseType.java b/awsapi/src/com/amazon/ec2/CreateCustomerGatewayResponseType.java index 05a89669c00..29956dbe0f2 100644 --- a/awsapi/src/com/amazon/ec2/CreateCustomerGatewayResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateCustomerGatewayResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateCustomerGatewayResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateCustomerGatewayType.java b/awsapi/src/com/amazon/ec2/CreateCustomerGatewayType.java index 19ec6a8a963..f183a6129ee 100644 --- a/awsapi/src/com/amazon/ec2/CreateCustomerGatewayType.java +++ b/awsapi/src/com/amazon/ec2/CreateCustomerGatewayType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateCustomerGatewayType.java diff --git a/awsapi/src/com/amazon/ec2/CreateDhcpOptions.java b/awsapi/src/com/amazon/ec2/CreateDhcpOptions.java index a854990fec3..5ffeb591230 100644 --- a/awsapi/src/com/amazon/ec2/CreateDhcpOptions.java +++ b/awsapi/src/com/amazon/ec2/CreateDhcpOptions.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateDhcpOptions.java diff --git a/awsapi/src/com/amazon/ec2/CreateDhcpOptionsResponse.java b/awsapi/src/com/amazon/ec2/CreateDhcpOptionsResponse.java index 488f3129990..ac7fe08cfa9 100644 --- a/awsapi/src/com/amazon/ec2/CreateDhcpOptionsResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateDhcpOptionsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateDhcpOptionsResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateDhcpOptionsResponseType.java b/awsapi/src/com/amazon/ec2/CreateDhcpOptionsResponseType.java index f799300f963..d63ca78c2d2 100644 --- a/awsapi/src/com/amazon/ec2/CreateDhcpOptionsResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateDhcpOptionsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateDhcpOptionsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateDhcpOptionsType.java b/awsapi/src/com/amazon/ec2/CreateDhcpOptionsType.java index 6bd04d9b66e..7462820573c 100644 --- a/awsapi/src/com/amazon/ec2/CreateDhcpOptionsType.java +++ b/awsapi/src/com/amazon/ec2/CreateDhcpOptionsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateDhcpOptionsType.java diff --git a/awsapi/src/com/amazon/ec2/CreateImage.java b/awsapi/src/com/amazon/ec2/CreateImage.java index d8ed827a253..efdbdc23399 100644 --- a/awsapi/src/com/amazon/ec2/CreateImage.java +++ b/awsapi/src/com/amazon/ec2/CreateImage.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateImage.java diff --git a/awsapi/src/com/amazon/ec2/CreateImageResponse.java b/awsapi/src/com/amazon/ec2/CreateImageResponse.java index eb8fc127193..c90e1e4401f 100644 --- a/awsapi/src/com/amazon/ec2/CreateImageResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateImageResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateImageResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateImageResponseType.java b/awsapi/src/com/amazon/ec2/CreateImageResponseType.java index a534dc22456..dbcaca07008 100644 --- a/awsapi/src/com/amazon/ec2/CreateImageResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateImageResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateImageResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateImageType.java b/awsapi/src/com/amazon/ec2/CreateImageType.java index c0e20e12de5..7add5f622ae 100644 --- a/awsapi/src/com/amazon/ec2/CreateImageType.java +++ b/awsapi/src/com/amazon/ec2/CreateImageType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateImageType.java diff --git a/awsapi/src/com/amazon/ec2/CreateKeyPair.java b/awsapi/src/com/amazon/ec2/CreateKeyPair.java index d44d4429158..caa2e2d8256 100644 --- a/awsapi/src/com/amazon/ec2/CreateKeyPair.java +++ b/awsapi/src/com/amazon/ec2/CreateKeyPair.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateKeyPair.java diff --git a/awsapi/src/com/amazon/ec2/CreateKeyPairResponse.java b/awsapi/src/com/amazon/ec2/CreateKeyPairResponse.java index 9e46dfd2790..67abefe0a75 100644 --- a/awsapi/src/com/amazon/ec2/CreateKeyPairResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateKeyPairResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateKeyPairResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateKeyPairResponseType.java b/awsapi/src/com/amazon/ec2/CreateKeyPairResponseType.java index ca3d3aa45b2..05186ebea5a 100644 --- a/awsapi/src/com/amazon/ec2/CreateKeyPairResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateKeyPairResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateKeyPairResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateKeyPairType.java b/awsapi/src/com/amazon/ec2/CreateKeyPairType.java index eeeea71c09b..6aec6218459 100644 --- a/awsapi/src/com/amazon/ec2/CreateKeyPairType.java +++ b/awsapi/src/com/amazon/ec2/CreateKeyPairType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateKeyPairType.java diff --git a/awsapi/src/com/amazon/ec2/CreatePlacementGroup.java b/awsapi/src/com/amazon/ec2/CreatePlacementGroup.java index debd105f799..d94f990206f 100644 --- a/awsapi/src/com/amazon/ec2/CreatePlacementGroup.java +++ b/awsapi/src/com/amazon/ec2/CreatePlacementGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreatePlacementGroup.java diff --git a/awsapi/src/com/amazon/ec2/CreatePlacementGroupResponse.java b/awsapi/src/com/amazon/ec2/CreatePlacementGroupResponse.java index c3ff9c78f3b..9c89cdf6966 100644 --- a/awsapi/src/com/amazon/ec2/CreatePlacementGroupResponse.java +++ b/awsapi/src/com/amazon/ec2/CreatePlacementGroupResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreatePlacementGroupResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreatePlacementGroupResponseType.java b/awsapi/src/com/amazon/ec2/CreatePlacementGroupResponseType.java index 49c3bbb002c..3e47359531e 100644 --- a/awsapi/src/com/amazon/ec2/CreatePlacementGroupResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreatePlacementGroupResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreatePlacementGroupResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreatePlacementGroupType.java b/awsapi/src/com/amazon/ec2/CreatePlacementGroupType.java index b8cda1431b4..dac247c134a 100644 --- a/awsapi/src/com/amazon/ec2/CreatePlacementGroupType.java +++ b/awsapi/src/com/amazon/ec2/CreatePlacementGroupType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreatePlacementGroupType.java diff --git a/awsapi/src/com/amazon/ec2/CreateSecurityGroup.java b/awsapi/src/com/amazon/ec2/CreateSecurityGroup.java index 5eb53157263..61c56fb63bb 100644 --- a/awsapi/src/com/amazon/ec2/CreateSecurityGroup.java +++ b/awsapi/src/com/amazon/ec2/CreateSecurityGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSecurityGroup.java diff --git a/awsapi/src/com/amazon/ec2/CreateSecurityGroupResponse.java b/awsapi/src/com/amazon/ec2/CreateSecurityGroupResponse.java index 6b072f48066..4f614e16534 100644 --- a/awsapi/src/com/amazon/ec2/CreateSecurityGroupResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateSecurityGroupResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSecurityGroupResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateSecurityGroupResponseType.java b/awsapi/src/com/amazon/ec2/CreateSecurityGroupResponseType.java index 40c263bc6d3..b90f253747d 100644 --- a/awsapi/src/com/amazon/ec2/CreateSecurityGroupResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateSecurityGroupResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSecurityGroupResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateSecurityGroupType.java b/awsapi/src/com/amazon/ec2/CreateSecurityGroupType.java index 1976fb368f1..699b48328d5 100644 --- a/awsapi/src/com/amazon/ec2/CreateSecurityGroupType.java +++ b/awsapi/src/com/amazon/ec2/CreateSecurityGroupType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSecurityGroupType.java diff --git a/awsapi/src/com/amazon/ec2/CreateSnapshot.java b/awsapi/src/com/amazon/ec2/CreateSnapshot.java index 70ed2241434..addfd50d2c5 100644 --- a/awsapi/src/com/amazon/ec2/CreateSnapshot.java +++ b/awsapi/src/com/amazon/ec2/CreateSnapshot.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSnapshot.java diff --git a/awsapi/src/com/amazon/ec2/CreateSnapshotResponse.java b/awsapi/src/com/amazon/ec2/CreateSnapshotResponse.java index b9ab7d914f2..33c1c7027b0 100644 --- a/awsapi/src/com/amazon/ec2/CreateSnapshotResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateSnapshotResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSnapshotResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateSnapshotResponseType.java b/awsapi/src/com/amazon/ec2/CreateSnapshotResponseType.java index dee949fbfd9..8e053aab6bc 100644 --- a/awsapi/src/com/amazon/ec2/CreateSnapshotResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateSnapshotResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSnapshotResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateSnapshotType.java b/awsapi/src/com/amazon/ec2/CreateSnapshotType.java index be401571536..531d77310f9 100644 --- a/awsapi/src/com/amazon/ec2/CreateSnapshotType.java +++ b/awsapi/src/com/amazon/ec2/CreateSnapshotType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSnapshotType.java diff --git a/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscription.java b/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscription.java index a3eb744b268..5f8f51c867f 100644 --- a/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscription.java +++ b/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscription.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSpotDatafeedSubscription.java diff --git a/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionResponse.java b/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionResponse.java index 6ff28329ae1..94050e7b7f3 100644 --- a/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSpotDatafeedSubscriptionResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionResponseType.java b/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionResponseType.java index ab6e3c4a92b..dfe67d21809 100644 --- a/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSpotDatafeedSubscriptionResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionType.java b/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionType.java index cc06adc7bf9..700b2eed18d 100644 --- a/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionType.java +++ b/awsapi/src/com/amazon/ec2/CreateSpotDatafeedSubscriptionType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSpotDatafeedSubscriptionType.java diff --git a/awsapi/src/com/amazon/ec2/CreateSubnet.java b/awsapi/src/com/amazon/ec2/CreateSubnet.java index e53326f27ec..0cafab00050 100644 --- a/awsapi/src/com/amazon/ec2/CreateSubnet.java +++ b/awsapi/src/com/amazon/ec2/CreateSubnet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSubnet.java diff --git a/awsapi/src/com/amazon/ec2/CreateSubnetResponse.java b/awsapi/src/com/amazon/ec2/CreateSubnetResponse.java index 2566d28b263..e5935ea87f1 100644 --- a/awsapi/src/com/amazon/ec2/CreateSubnetResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateSubnetResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSubnetResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateSubnetResponseType.java b/awsapi/src/com/amazon/ec2/CreateSubnetResponseType.java index 1195ee2a2c1..cb8f04409a2 100644 --- a/awsapi/src/com/amazon/ec2/CreateSubnetResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateSubnetResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSubnetResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateSubnetType.java b/awsapi/src/com/amazon/ec2/CreateSubnetType.java index 2fa67c5ebdf..f0fb291382c 100644 --- a/awsapi/src/com/amazon/ec2/CreateSubnetType.java +++ b/awsapi/src/com/amazon/ec2/CreateSubnetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateSubnetType.java diff --git a/awsapi/src/com/amazon/ec2/CreateTags.java b/awsapi/src/com/amazon/ec2/CreateTags.java index 96670bd081c..397c0d49c5b 100644 --- a/awsapi/src/com/amazon/ec2/CreateTags.java +++ b/awsapi/src/com/amazon/ec2/CreateTags.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateTags.java diff --git a/awsapi/src/com/amazon/ec2/CreateTagsResponse.java b/awsapi/src/com/amazon/ec2/CreateTagsResponse.java index 37df20d87c0..ad0ff5d9459 100644 --- a/awsapi/src/com/amazon/ec2/CreateTagsResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateTagsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateTagsResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateTagsResponseType.java b/awsapi/src/com/amazon/ec2/CreateTagsResponseType.java index 725736781a6..b8b0584a3ff 100644 --- a/awsapi/src/com/amazon/ec2/CreateTagsResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateTagsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateTagsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateTagsType.java b/awsapi/src/com/amazon/ec2/CreateTagsType.java index cd2bab4dc1c..c57e34b2169 100644 --- a/awsapi/src/com/amazon/ec2/CreateTagsType.java +++ b/awsapi/src/com/amazon/ec2/CreateTagsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateTagsType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVolume.java b/awsapi/src/com/amazon/ec2/CreateVolume.java index e1d3a2cd036..74db8211fed 100644 --- a/awsapi/src/com/amazon/ec2/CreateVolume.java +++ b/awsapi/src/com/amazon/ec2/CreateVolume.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVolume.java diff --git a/awsapi/src/com/amazon/ec2/CreateVolumePermissionItemType.java b/awsapi/src/com/amazon/ec2/CreateVolumePermissionItemType.java index 0b643710526..80e69d5956b 100644 --- a/awsapi/src/com/amazon/ec2/CreateVolumePermissionItemType.java +++ b/awsapi/src/com/amazon/ec2/CreateVolumePermissionItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVolumePermissionItemType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVolumePermissionListType.java b/awsapi/src/com/amazon/ec2/CreateVolumePermissionListType.java index cf3afd0d1f2..58f9e01c314 100644 --- a/awsapi/src/com/amazon/ec2/CreateVolumePermissionListType.java +++ b/awsapi/src/com/amazon/ec2/CreateVolumePermissionListType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVolumePermissionListType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVolumePermissionOperationType.java b/awsapi/src/com/amazon/ec2/CreateVolumePermissionOperationType.java index 645497c844e..2d6ecfb340b 100644 --- a/awsapi/src/com/amazon/ec2/CreateVolumePermissionOperationType.java +++ b/awsapi/src/com/amazon/ec2/CreateVolumePermissionOperationType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVolumePermissionOperationType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVolumeResponse.java b/awsapi/src/com/amazon/ec2/CreateVolumeResponse.java index 143685b2141..3cdf95c97b9 100644 --- a/awsapi/src/com/amazon/ec2/CreateVolumeResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateVolumeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVolumeResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateVolumeResponseType.java b/awsapi/src/com/amazon/ec2/CreateVolumeResponseType.java index cb686c9c18b..861122fd314 100644 --- a/awsapi/src/com/amazon/ec2/CreateVolumeResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateVolumeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVolumeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVolumeType.java b/awsapi/src/com/amazon/ec2/CreateVolumeType.java index b9d70b2e4a8..ddae53d3291 100644 --- a/awsapi/src/com/amazon/ec2/CreateVolumeType.java +++ b/awsapi/src/com/amazon/ec2/CreateVolumeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVolumeType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpc.java b/awsapi/src/com/amazon/ec2/CreateVpc.java index 61885c00a84..d1d6975900d 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpc.java +++ b/awsapi/src/com/amazon/ec2/CreateVpc.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpc.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpcResponse.java b/awsapi/src/com/amazon/ec2/CreateVpcResponse.java index 8172f28e0c8..55bee1d3a77 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpcResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateVpcResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpcResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpcResponseType.java b/awsapi/src/com/amazon/ec2/CreateVpcResponseType.java index 3a9f0bb94c4..d6d0b197509 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpcResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateVpcResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpcResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpcType.java b/awsapi/src/com/amazon/ec2/CreateVpcType.java index c86f6fc1cf1..7677508b176 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpcType.java +++ b/awsapi/src/com/amazon/ec2/CreateVpcType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpcType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpnConnection.java b/awsapi/src/com/amazon/ec2/CreateVpnConnection.java index 49cbc696492..ef0919c8304 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpnConnection.java +++ b/awsapi/src/com/amazon/ec2/CreateVpnConnection.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpnConnection.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpnConnectionResponse.java b/awsapi/src/com/amazon/ec2/CreateVpnConnectionResponse.java index f1c0b4cb918..caef804173a 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpnConnectionResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateVpnConnectionResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpnConnectionResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpnConnectionResponseType.java b/awsapi/src/com/amazon/ec2/CreateVpnConnectionResponseType.java index 49e70b570ce..54157e3b01d 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpnConnectionResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateVpnConnectionResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpnConnectionResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpnConnectionType.java b/awsapi/src/com/amazon/ec2/CreateVpnConnectionType.java index 2ccc84631f8..53e9fb9e807 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpnConnectionType.java +++ b/awsapi/src/com/amazon/ec2/CreateVpnConnectionType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpnConnectionType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpnGateway.java b/awsapi/src/com/amazon/ec2/CreateVpnGateway.java index 1c61df6a826..5e59c294582 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpnGateway.java +++ b/awsapi/src/com/amazon/ec2/CreateVpnGateway.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpnGateway.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpnGatewayResponse.java b/awsapi/src/com/amazon/ec2/CreateVpnGatewayResponse.java index 1541d8f2c03..0d3e40e1360 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpnGatewayResponse.java +++ b/awsapi/src/com/amazon/ec2/CreateVpnGatewayResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpnGatewayResponse.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpnGatewayResponseType.java b/awsapi/src/com/amazon/ec2/CreateVpnGatewayResponseType.java index c0e352c2a98..290aff4cfa9 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpnGatewayResponseType.java +++ b/awsapi/src/com/amazon/ec2/CreateVpnGatewayResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpnGatewayResponseType.java diff --git a/awsapi/src/com/amazon/ec2/CreateVpnGatewayType.java b/awsapi/src/com/amazon/ec2/CreateVpnGatewayType.java index 627ae0694f4..e9988d2e52a 100644 --- a/awsapi/src/com/amazon/ec2/CreateVpnGatewayType.java +++ b/awsapi/src/com/amazon/ec2/CreateVpnGatewayType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CreateVpnGatewayType.java diff --git a/awsapi/src/com/amazon/ec2/CustomerGatewayIdSetItemType.java b/awsapi/src/com/amazon/ec2/CustomerGatewayIdSetItemType.java index b441d9a983e..ac3c015655e 100644 --- a/awsapi/src/com/amazon/ec2/CustomerGatewayIdSetItemType.java +++ b/awsapi/src/com/amazon/ec2/CustomerGatewayIdSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CustomerGatewayIdSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/CustomerGatewayIdSetType.java b/awsapi/src/com/amazon/ec2/CustomerGatewayIdSetType.java index 1f78811c947..e8ea4fc7d9e 100644 --- a/awsapi/src/com/amazon/ec2/CustomerGatewayIdSetType.java +++ b/awsapi/src/com/amazon/ec2/CustomerGatewayIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CustomerGatewayIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/CustomerGatewaySetType.java b/awsapi/src/com/amazon/ec2/CustomerGatewaySetType.java index 3bd051f000d..a3dfef5c538 100644 --- a/awsapi/src/com/amazon/ec2/CustomerGatewaySetType.java +++ b/awsapi/src/com/amazon/ec2/CustomerGatewaySetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CustomerGatewaySetType.java diff --git a/awsapi/src/com/amazon/ec2/CustomerGatewayType.java b/awsapi/src/com/amazon/ec2/CustomerGatewayType.java index 688e2c062a7..45de1727ba2 100644 --- a/awsapi/src/com/amazon/ec2/CustomerGatewayType.java +++ b/awsapi/src/com/amazon/ec2/CustomerGatewayType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * CustomerGatewayType.java diff --git a/awsapi/src/com/amazon/ec2/DeactivateLicense.java b/awsapi/src/com/amazon/ec2/DeactivateLicense.java index eaeaa0e1075..89c967f188d 100644 --- a/awsapi/src/com/amazon/ec2/DeactivateLicense.java +++ b/awsapi/src/com/amazon/ec2/DeactivateLicense.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeactivateLicense.java diff --git a/awsapi/src/com/amazon/ec2/DeactivateLicenseResponse.java b/awsapi/src/com/amazon/ec2/DeactivateLicenseResponse.java index 0c26e91797e..8df5b4ce0f0 100644 --- a/awsapi/src/com/amazon/ec2/DeactivateLicenseResponse.java +++ b/awsapi/src/com/amazon/ec2/DeactivateLicenseResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeactivateLicenseResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeactivateLicenseResponseType.java b/awsapi/src/com/amazon/ec2/DeactivateLicenseResponseType.java index cb2d22dd152..f2ffa680ce7 100644 --- a/awsapi/src/com/amazon/ec2/DeactivateLicenseResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeactivateLicenseResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeactivateLicenseResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeactivateLicenseType.java b/awsapi/src/com/amazon/ec2/DeactivateLicenseType.java index 3b6cad22e69..8b58bc01836 100644 --- a/awsapi/src/com/amazon/ec2/DeactivateLicenseType.java +++ b/awsapi/src/com/amazon/ec2/DeactivateLicenseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeactivateLicenseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteCustomerGateway.java b/awsapi/src/com/amazon/ec2/DeleteCustomerGateway.java index 831b32676b0..b84e098bd1d 100644 --- a/awsapi/src/com/amazon/ec2/DeleteCustomerGateway.java +++ b/awsapi/src/com/amazon/ec2/DeleteCustomerGateway.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteCustomerGateway.java diff --git a/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayResponse.java b/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayResponse.java index 8993fb90ad7..790c4907c1c 100644 --- a/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteCustomerGatewayResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayResponseType.java b/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayResponseType.java index 4462ccd7397..0d0c89357f6 100644 --- a/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteCustomerGatewayResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayType.java b/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayType.java index 4245faa1b7a..5e1fec861e0 100644 --- a/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayType.java +++ b/awsapi/src/com/amazon/ec2/DeleteCustomerGatewayType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteCustomerGatewayType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteDhcpOptions.java b/awsapi/src/com/amazon/ec2/DeleteDhcpOptions.java index aaf3bb11ca3..7c5f1207d59 100644 --- a/awsapi/src/com/amazon/ec2/DeleteDhcpOptions.java +++ b/awsapi/src/com/amazon/ec2/DeleteDhcpOptions.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteDhcpOptions.java diff --git a/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsResponse.java b/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsResponse.java index 82a5eb0079a..ea981c4d6bd 100644 --- a/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteDhcpOptionsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsResponseType.java b/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsResponseType.java index 2cbee07e3de..2a5b1000fc1 100644 --- a/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteDhcpOptionsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsType.java b/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsType.java index 5f2cd2942f5..4659d05d964 100644 --- a/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsType.java +++ b/awsapi/src/com/amazon/ec2/DeleteDhcpOptionsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteDhcpOptionsType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteKeyPair.java b/awsapi/src/com/amazon/ec2/DeleteKeyPair.java index 42e20500c10..f5da3d668f6 100644 --- a/awsapi/src/com/amazon/ec2/DeleteKeyPair.java +++ b/awsapi/src/com/amazon/ec2/DeleteKeyPair.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteKeyPair.java diff --git a/awsapi/src/com/amazon/ec2/DeleteKeyPairResponse.java b/awsapi/src/com/amazon/ec2/DeleteKeyPairResponse.java index a27ad61d9b7..814f98e98f5 100644 --- a/awsapi/src/com/amazon/ec2/DeleteKeyPairResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteKeyPairResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteKeyPairResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteKeyPairResponseType.java b/awsapi/src/com/amazon/ec2/DeleteKeyPairResponseType.java index 9e17843df22..d0f57e1d20e 100644 --- a/awsapi/src/com/amazon/ec2/DeleteKeyPairResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteKeyPairResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteKeyPairResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteKeyPairType.java b/awsapi/src/com/amazon/ec2/DeleteKeyPairType.java index 401c95bce03..2e8dd704ea1 100644 --- a/awsapi/src/com/amazon/ec2/DeleteKeyPairType.java +++ b/awsapi/src/com/amazon/ec2/DeleteKeyPairType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteKeyPairType.java diff --git a/awsapi/src/com/amazon/ec2/DeletePlacementGroup.java b/awsapi/src/com/amazon/ec2/DeletePlacementGroup.java index d8dfbefbe34..6bf3aab2f81 100644 --- a/awsapi/src/com/amazon/ec2/DeletePlacementGroup.java +++ b/awsapi/src/com/amazon/ec2/DeletePlacementGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeletePlacementGroup.java diff --git a/awsapi/src/com/amazon/ec2/DeletePlacementGroupResponse.java b/awsapi/src/com/amazon/ec2/DeletePlacementGroupResponse.java index e5209118170..43cc6f6a27d 100644 --- a/awsapi/src/com/amazon/ec2/DeletePlacementGroupResponse.java +++ b/awsapi/src/com/amazon/ec2/DeletePlacementGroupResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeletePlacementGroupResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeletePlacementGroupResponseType.java b/awsapi/src/com/amazon/ec2/DeletePlacementGroupResponseType.java index 51689bf2fec..e966f403ab4 100644 --- a/awsapi/src/com/amazon/ec2/DeletePlacementGroupResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeletePlacementGroupResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeletePlacementGroupResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeletePlacementGroupType.java b/awsapi/src/com/amazon/ec2/DeletePlacementGroupType.java index 188ad5808f2..212555d0d87 100644 --- a/awsapi/src/com/amazon/ec2/DeletePlacementGroupType.java +++ b/awsapi/src/com/amazon/ec2/DeletePlacementGroupType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeletePlacementGroupType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSecurityGroup.java b/awsapi/src/com/amazon/ec2/DeleteSecurityGroup.java index 0acea6f420e..c38210083d1 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSecurityGroup.java +++ b/awsapi/src/com/amazon/ec2/DeleteSecurityGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSecurityGroup.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSecurityGroupResponse.java b/awsapi/src/com/amazon/ec2/DeleteSecurityGroupResponse.java index 04170fe0126..4e8852b5763 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSecurityGroupResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteSecurityGroupResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSecurityGroupResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSecurityGroupResponseType.java b/awsapi/src/com/amazon/ec2/DeleteSecurityGroupResponseType.java index b75c23fe955..3bd3d0c8ba4 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSecurityGroupResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteSecurityGroupResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSecurityGroupResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSecurityGroupType.java b/awsapi/src/com/amazon/ec2/DeleteSecurityGroupType.java index b0f9cd2e213..a0f3ca3385f 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSecurityGroupType.java +++ b/awsapi/src/com/amazon/ec2/DeleteSecurityGroupType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSecurityGroupType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSnapshot.java b/awsapi/src/com/amazon/ec2/DeleteSnapshot.java index b468a608f63..0d95f1f76b9 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSnapshot.java +++ b/awsapi/src/com/amazon/ec2/DeleteSnapshot.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSnapshot.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSnapshotResponse.java b/awsapi/src/com/amazon/ec2/DeleteSnapshotResponse.java index e4d9fea41cd..801fe84479e 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSnapshotResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteSnapshotResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSnapshotResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSnapshotResponseType.java b/awsapi/src/com/amazon/ec2/DeleteSnapshotResponseType.java index 46565d96296..1292ea31efa 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSnapshotResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteSnapshotResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSnapshotResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSnapshotType.java b/awsapi/src/com/amazon/ec2/DeleteSnapshotType.java index f7b393ba803..7489573833a 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSnapshotType.java +++ b/awsapi/src/com/amazon/ec2/DeleteSnapshotType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSnapshotType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscription.java b/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscription.java index df9f823441c..3a0e2185b69 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscription.java +++ b/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscription.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSpotDatafeedSubscription.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionResponse.java b/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionResponse.java index 3c05224487d..fb6bdd21065 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSpotDatafeedSubscriptionResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionResponseType.java b/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionResponseType.java index 98f02590ded..d5fbea1e8cc 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSpotDatafeedSubscriptionResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionType.java b/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionType.java index 3eb45c1d51c..9938169b473 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionType.java +++ b/awsapi/src/com/amazon/ec2/DeleteSpotDatafeedSubscriptionType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSpotDatafeedSubscriptionType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSubnet.java b/awsapi/src/com/amazon/ec2/DeleteSubnet.java index abf2dd76ebb..7055f1a3b83 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSubnet.java +++ b/awsapi/src/com/amazon/ec2/DeleteSubnet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSubnet.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSubnetResponse.java b/awsapi/src/com/amazon/ec2/DeleteSubnetResponse.java index fbd689452e5..6cabcac3601 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSubnetResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteSubnetResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSubnetResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSubnetResponseType.java b/awsapi/src/com/amazon/ec2/DeleteSubnetResponseType.java index a8c14dc345c..5d6bc3e26c0 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSubnetResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteSubnetResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSubnetResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteSubnetType.java b/awsapi/src/com/amazon/ec2/DeleteSubnetType.java index e303a794a0b..2d677929845 100644 --- a/awsapi/src/com/amazon/ec2/DeleteSubnetType.java +++ b/awsapi/src/com/amazon/ec2/DeleteSubnetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteSubnetType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteTags.java b/awsapi/src/com/amazon/ec2/DeleteTags.java index 91fe4b7be74..b16bb67357c 100644 --- a/awsapi/src/com/amazon/ec2/DeleteTags.java +++ b/awsapi/src/com/amazon/ec2/DeleteTags.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteTags.java diff --git a/awsapi/src/com/amazon/ec2/DeleteTagsResponse.java b/awsapi/src/com/amazon/ec2/DeleteTagsResponse.java index 30ff8a702e4..f9ac42e89f4 100644 --- a/awsapi/src/com/amazon/ec2/DeleteTagsResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteTagsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteTagsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteTagsResponseType.java b/awsapi/src/com/amazon/ec2/DeleteTagsResponseType.java index 65c8f61b595..99a8ac47605 100644 --- a/awsapi/src/com/amazon/ec2/DeleteTagsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteTagsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteTagsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteTagsSetItemType.java b/awsapi/src/com/amazon/ec2/DeleteTagsSetItemType.java index df2614b156b..2e59fb771e5 100644 --- a/awsapi/src/com/amazon/ec2/DeleteTagsSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DeleteTagsSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteTagsSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteTagsSetType.java b/awsapi/src/com/amazon/ec2/DeleteTagsSetType.java index a9578f51574..5283dbad6df 100644 --- a/awsapi/src/com/amazon/ec2/DeleteTagsSetType.java +++ b/awsapi/src/com/amazon/ec2/DeleteTagsSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteTagsSetType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteTagsType.java b/awsapi/src/com/amazon/ec2/DeleteTagsType.java index a4065ab2316..1ccd3b0e699 100644 --- a/awsapi/src/com/amazon/ec2/DeleteTagsType.java +++ b/awsapi/src/com/amazon/ec2/DeleteTagsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteTagsType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVolume.java b/awsapi/src/com/amazon/ec2/DeleteVolume.java index e6ab147c59d..1b6a7e49730 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVolume.java +++ b/awsapi/src/com/amazon/ec2/DeleteVolume.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVolume.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVolumeResponse.java b/awsapi/src/com/amazon/ec2/DeleteVolumeResponse.java index 2db971661bc..e9e847f72b2 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVolumeResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteVolumeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVolumeResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVolumeResponseType.java b/awsapi/src/com/amazon/ec2/DeleteVolumeResponseType.java index 457a562a6b5..dfeb92fdcd3 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVolumeResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteVolumeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVolumeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVolumeType.java b/awsapi/src/com/amazon/ec2/DeleteVolumeType.java index 3429e099776..8b93d856b8c 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVolumeType.java +++ b/awsapi/src/com/amazon/ec2/DeleteVolumeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVolumeType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpc.java b/awsapi/src/com/amazon/ec2/DeleteVpc.java index daae8ce04c4..508e7040ab1 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpc.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpc.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpc.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpcResponse.java b/awsapi/src/com/amazon/ec2/DeleteVpcResponse.java index 8e3254538de..a8617e33701 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpcResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpcResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpcResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpcResponseType.java b/awsapi/src/com/amazon/ec2/DeleteVpcResponseType.java index 7a2b52b2ed2..f1cd2ef2252 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpcResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpcResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpcResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpcType.java b/awsapi/src/com/amazon/ec2/DeleteVpcType.java index 9c3b9016124..aa66ac0ba11 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpcType.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpcType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpcType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpnConnection.java b/awsapi/src/com/amazon/ec2/DeleteVpnConnection.java index eab954db9bf..a187aeeea5c 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpnConnection.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpnConnection.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpnConnection.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpnConnectionResponse.java b/awsapi/src/com/amazon/ec2/DeleteVpnConnectionResponse.java index 166ff4d3216..63c47738ae6 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpnConnectionResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpnConnectionResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpnConnectionResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpnConnectionResponseType.java b/awsapi/src/com/amazon/ec2/DeleteVpnConnectionResponseType.java index 70cd9e3daae..7b1007244fc 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpnConnectionResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpnConnectionResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpnConnectionResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpnConnectionType.java b/awsapi/src/com/amazon/ec2/DeleteVpnConnectionType.java index f3875c476b0..30de03b4593 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpnConnectionType.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpnConnectionType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpnConnectionType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpnGateway.java b/awsapi/src/com/amazon/ec2/DeleteVpnGateway.java index 0cd4ddbf47a..caaeb3893e4 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpnGateway.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpnGateway.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpnGateway.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpnGatewayResponse.java b/awsapi/src/com/amazon/ec2/DeleteVpnGatewayResponse.java index 234a252455b..f772b412d3c 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpnGatewayResponse.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpnGatewayResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpnGatewayResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpnGatewayResponseType.java b/awsapi/src/com/amazon/ec2/DeleteVpnGatewayResponseType.java index e46e767416d..31d469f9892 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpnGatewayResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpnGatewayResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpnGatewayResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeleteVpnGatewayType.java b/awsapi/src/com/amazon/ec2/DeleteVpnGatewayType.java index 4e798e66c2d..9c34ef3d80e 100644 --- a/awsapi/src/com/amazon/ec2/DeleteVpnGatewayType.java +++ b/awsapi/src/com/amazon/ec2/DeleteVpnGatewayType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeleteVpnGatewayType.java diff --git a/awsapi/src/com/amazon/ec2/DeregisterImage.java b/awsapi/src/com/amazon/ec2/DeregisterImage.java index f2654bc45df..8fe503abbae 100644 --- a/awsapi/src/com/amazon/ec2/DeregisterImage.java +++ b/awsapi/src/com/amazon/ec2/DeregisterImage.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeregisterImage.java diff --git a/awsapi/src/com/amazon/ec2/DeregisterImageResponse.java b/awsapi/src/com/amazon/ec2/DeregisterImageResponse.java index 209bcab0ad4..e2685345287 100644 --- a/awsapi/src/com/amazon/ec2/DeregisterImageResponse.java +++ b/awsapi/src/com/amazon/ec2/DeregisterImageResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeregisterImageResponse.java diff --git a/awsapi/src/com/amazon/ec2/DeregisterImageResponseType.java b/awsapi/src/com/amazon/ec2/DeregisterImageResponseType.java index 42381eadee9..aa0dc223569 100644 --- a/awsapi/src/com/amazon/ec2/DeregisterImageResponseType.java +++ b/awsapi/src/com/amazon/ec2/DeregisterImageResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeregisterImageResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DeregisterImageType.java b/awsapi/src/com/amazon/ec2/DeregisterImageType.java index 76f699199ff..65c446c30c5 100644 --- a/awsapi/src/com/amazon/ec2/DeregisterImageType.java +++ b/awsapi/src/com/amazon/ec2/DeregisterImageType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DeregisterImageType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAddresses.java b/awsapi/src/com/amazon/ec2/DescribeAddresses.java index 33fa3ff2025..129a510eca2 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAddresses.java +++ b/awsapi/src/com/amazon/ec2/DescribeAddresses.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAddresses.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAddressesInfoType.java b/awsapi/src/com/amazon/ec2/DescribeAddressesInfoType.java index 523c852fb0e..f55282795d8 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAddressesInfoType.java +++ b/awsapi/src/com/amazon/ec2/DescribeAddressesInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAddressesInfoType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAddressesItemType.java b/awsapi/src/com/amazon/ec2/DescribeAddressesItemType.java index 5c8bc464c3e..474c28ec3e6 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAddressesItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeAddressesItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAddressesItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAddressesResponse.java b/awsapi/src/com/amazon/ec2/DescribeAddressesResponse.java index c489f08c11d..a135aba9ac8 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAddressesResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeAddressesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAddressesResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAddressesResponseInfoType.java b/awsapi/src/com/amazon/ec2/DescribeAddressesResponseInfoType.java index 134dc1c8be5..2ab759bf4ed 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAddressesResponseInfoType.java +++ b/awsapi/src/com/amazon/ec2/DescribeAddressesResponseInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAddressesResponseInfoType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAddressesResponseItemType.java b/awsapi/src/com/amazon/ec2/DescribeAddressesResponseItemType.java index 1df346850c6..74ef8507832 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAddressesResponseItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeAddressesResponseItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAddressesResponseItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAddressesResponseType.java b/awsapi/src/com/amazon/ec2/DescribeAddressesResponseType.java index 61399f4b655..f2202e79c63 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAddressesResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeAddressesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAddressesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAddressesType.java b/awsapi/src/com/amazon/ec2/DescribeAddressesType.java index 68b9b812452..bedeb2913e0 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAddressesType.java +++ b/awsapi/src/com/amazon/ec2/DescribeAddressesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAddressesType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZones.java b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZones.java index d2b885ff6b3..afee44478cb 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZones.java +++ b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZones.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAvailabilityZones.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesResponse.java b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesResponse.java index 4874653b6d3..8420d0f0088 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAvailabilityZonesResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesResponseType.java b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesResponseType.java index 64b56093fc7..18782b19294 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAvailabilityZonesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesSetItemType.java b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesSetItemType.java index 67b6fd320e2..49cd89fca53 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAvailabilityZonesSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesSetType.java b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesSetType.java index 84fd5096137..79891e5b114 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesSetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAvailabilityZonesSetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesType.java b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesType.java index b1bd1ab4e40..50fd2a8cbd1 100644 --- a/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesType.java +++ b/awsapi/src/com/amazon/ec2/DescribeAvailabilityZonesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeAvailabilityZonesType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeBundleTasks.java b/awsapi/src/com/amazon/ec2/DescribeBundleTasks.java index d321824b43f..69652790fc1 100644 --- a/awsapi/src/com/amazon/ec2/DescribeBundleTasks.java +++ b/awsapi/src/com/amazon/ec2/DescribeBundleTasks.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeBundleTasks.java diff --git a/awsapi/src/com/amazon/ec2/DescribeBundleTasksInfoType.java b/awsapi/src/com/amazon/ec2/DescribeBundleTasksInfoType.java index 4305e3c428e..3d017a8b022 100644 --- a/awsapi/src/com/amazon/ec2/DescribeBundleTasksInfoType.java +++ b/awsapi/src/com/amazon/ec2/DescribeBundleTasksInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeBundleTasksInfoType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeBundleTasksItemType.java b/awsapi/src/com/amazon/ec2/DescribeBundleTasksItemType.java index 597868539ec..c85065df4e3 100644 --- a/awsapi/src/com/amazon/ec2/DescribeBundleTasksItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeBundleTasksItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeBundleTasksItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeBundleTasksResponse.java b/awsapi/src/com/amazon/ec2/DescribeBundleTasksResponse.java index 6607d237072..7769cdc65d0 100644 --- a/awsapi/src/com/amazon/ec2/DescribeBundleTasksResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeBundleTasksResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeBundleTasksResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeBundleTasksResponseType.java b/awsapi/src/com/amazon/ec2/DescribeBundleTasksResponseType.java index 0775658d5d6..d989138abd6 100644 --- a/awsapi/src/com/amazon/ec2/DescribeBundleTasksResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeBundleTasksResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeBundleTasksResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeBundleTasksType.java b/awsapi/src/com/amazon/ec2/DescribeBundleTasksType.java index 253eeb7e57d..33e993c23f2 100644 --- a/awsapi/src/com/amazon/ec2/DescribeBundleTasksType.java +++ b/awsapi/src/com/amazon/ec2/DescribeBundleTasksType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeBundleTasksType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeConversionTasks.java b/awsapi/src/com/amazon/ec2/DescribeConversionTasks.java index dd69ca7b126..13aded06bc4 100644 --- a/awsapi/src/com/amazon/ec2/DescribeConversionTasks.java +++ b/awsapi/src/com/amazon/ec2/DescribeConversionTasks.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeConversionTasks.java diff --git a/awsapi/src/com/amazon/ec2/DescribeConversionTasksResponse.java b/awsapi/src/com/amazon/ec2/DescribeConversionTasksResponse.java index 35f7a1f91b6..1e44de111d1 100644 --- a/awsapi/src/com/amazon/ec2/DescribeConversionTasksResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeConversionTasksResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeConversionTasksResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeConversionTasksResponseType.java b/awsapi/src/com/amazon/ec2/DescribeConversionTasksResponseType.java index b76dee0e804..7a82336ed84 100644 --- a/awsapi/src/com/amazon/ec2/DescribeConversionTasksResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeConversionTasksResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeConversionTasksResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeConversionTasksType.java b/awsapi/src/com/amazon/ec2/DescribeConversionTasksType.java index 0d471c52d90..9886e4efa81 100644 --- a/awsapi/src/com/amazon/ec2/DescribeConversionTasksType.java +++ b/awsapi/src/com/amazon/ec2/DescribeConversionTasksType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeConversionTasksType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeCustomerGateways.java b/awsapi/src/com/amazon/ec2/DescribeCustomerGateways.java index c1be6702377..c2bf7fecead 100644 --- a/awsapi/src/com/amazon/ec2/DescribeCustomerGateways.java +++ b/awsapi/src/com/amazon/ec2/DescribeCustomerGateways.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeCustomerGateways.java diff --git a/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysResponse.java b/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysResponse.java index 90742f91997..2d4a54184d2 100644 --- a/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeCustomerGatewaysResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysResponseType.java b/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysResponseType.java index 7c2fa11f202..6b80b7af875 100644 --- a/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeCustomerGatewaysResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysType.java b/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysType.java index 1d3e4d35b05..58acda923e6 100644 --- a/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysType.java +++ b/awsapi/src/com/amazon/ec2/DescribeCustomerGatewaysType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeCustomerGatewaysType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeDhcpOptions.java b/awsapi/src/com/amazon/ec2/DescribeDhcpOptions.java index 6042c715b16..361c4203b05 100644 --- a/awsapi/src/com/amazon/ec2/DescribeDhcpOptions.java +++ b/awsapi/src/com/amazon/ec2/DescribeDhcpOptions.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeDhcpOptions.java diff --git a/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsResponse.java b/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsResponse.java index d2e01f0070c..8d1949d2190 100644 --- a/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeDhcpOptionsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsResponseType.java index 5e3cb929567..c1ef5441a97 100644 --- a/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeDhcpOptionsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsType.java b/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsType.java index d30c2278303..79a033fb54a 100644 --- a/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeDhcpOptionsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeDhcpOptionsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImageAttribute.java b/awsapi/src/com/amazon/ec2/DescribeImageAttribute.java index 5e788ab3677..13e632d4b0e 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImageAttribute.java +++ b/awsapi/src/com/amazon/ec2/DescribeImageAttribute.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImageAttribute.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponse.java b/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponse.java index 1f4eb151a4a..6a31aa1687b 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImageAttributeResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponseType.java b/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponseType.java index 531dc7eebec..d27960256b5 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImageAttributeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponseTypeChoice_type0.java b/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponseTypeChoice_type0.java index 90eab658b9c..b583cf3ccf6 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponseTypeChoice_type0.java +++ b/awsapi/src/com/amazon/ec2/DescribeImageAttributeResponseTypeChoice_type0.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImageAttributeResponseTypeChoice_type0.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImageAttributeType.java b/awsapi/src/com/amazon/ec2/DescribeImageAttributeType.java index 90ff0e08484..c3d7d52af38 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImageAttributeType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImageAttributeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImageAttributeType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImageAttributesGroup.java b/awsapi/src/com/amazon/ec2/DescribeImageAttributesGroup.java index c905fdc94f1..fa3581b5f98 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImageAttributesGroup.java +++ b/awsapi/src/com/amazon/ec2/DescribeImageAttributesGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImageAttributesGroup.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImages.java b/awsapi/src/com/amazon/ec2/DescribeImages.java index adaefed293c..ffa134b81d6 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImages.java +++ b/awsapi/src/com/amazon/ec2/DescribeImages.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImages.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesExecutableBySetType.java b/awsapi/src/com/amazon/ec2/DescribeImagesExecutableBySetType.java index 779787c3160..5e91d807aae 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesExecutableBySetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesExecutableBySetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesExecutableBySetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesExecutableByType.java b/awsapi/src/com/amazon/ec2/DescribeImagesExecutableByType.java index db518b1c81b..b1a9c34e20e 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesExecutableByType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesExecutableByType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesExecutableByType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesInfoType.java b/awsapi/src/com/amazon/ec2/DescribeImagesInfoType.java index aca689c8354..b276a5692c7 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesInfoType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesInfoType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesItemType.java b/awsapi/src/com/amazon/ec2/DescribeImagesItemType.java index 71e0512b4b5..a0817dd7b1c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesOwnerType.java b/awsapi/src/com/amazon/ec2/DescribeImagesOwnerType.java index cdf31cc69cd..4697634820d 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesOwnerType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesOwnerType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesOwnerType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesOwnersType.java b/awsapi/src/com/amazon/ec2/DescribeImagesOwnersType.java index 156924504d3..25a9292bbf7 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesOwnersType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesOwnersType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesOwnersType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesResponse.java b/awsapi/src/com/amazon/ec2/DescribeImagesResponse.java index 60bf86035b9..ed8794a31bb 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesResponseInfoType.java b/awsapi/src/com/amazon/ec2/DescribeImagesResponseInfoType.java index 90319a7106c..77f3f025450 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesResponseInfoType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesResponseInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesResponseInfoType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesResponseItemType.java b/awsapi/src/com/amazon/ec2/DescribeImagesResponseItemType.java index b71e548ee2d..ce5f9a0462c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesResponseItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesResponseItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesResponseItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesResponseType.java b/awsapi/src/com/amazon/ec2/DescribeImagesResponseType.java index 349d962c6a5..fea3d8c4306 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeImagesType.java b/awsapi/src/com/amazon/ec2/DescribeImagesType.java index 27c21db558f..09f4952d82b 100644 --- a/awsapi/src/com/amazon/ec2/DescribeImagesType.java +++ b/awsapi/src/com/amazon/ec2/DescribeImagesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeImagesType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstanceAttribute.java b/awsapi/src/com/amazon/ec2/DescribeInstanceAttribute.java index 43a489f7f73..dfe0d60427d 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstanceAttribute.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstanceAttribute.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstanceAttribute.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponse.java b/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponse.java index 426e75b30c5..dffbda10ee8 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstanceAttributeResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponseType.java b/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponseType.java index 117701d607e..93da882e288 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstanceAttributeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponseTypeChoice_type0.java b/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponseTypeChoice_type0.java index 418a4548c1d..6940c814858 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponseTypeChoice_type0.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeResponseTypeChoice_type0.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstanceAttributeResponseTypeChoice_type0.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeType.java b/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeType.java index eac5c015f67..8dede0a369a 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeType.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstanceAttributeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstanceAttributeType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstanceAttributesGroup.java b/awsapi/src/com/amazon/ec2/DescribeInstanceAttributesGroup.java index 442525033ff..f0eff552a76 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstanceAttributesGroup.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstanceAttributesGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstanceAttributesGroup.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstances.java b/awsapi/src/com/amazon/ec2/DescribeInstances.java index 759bc38e758..2bc80d34ffb 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstances.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstances.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstances.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstancesInfoType.java b/awsapi/src/com/amazon/ec2/DescribeInstancesInfoType.java index 982282f48f6..47450b911cd 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstancesInfoType.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstancesInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstancesInfoType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstancesItemType.java b/awsapi/src/com/amazon/ec2/DescribeInstancesItemType.java index db48ada0f41..e30606b95f2 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstancesItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstancesItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstancesItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstancesResponse.java b/awsapi/src/com/amazon/ec2/DescribeInstancesResponse.java index a2ecfbcb696..9e9e1a19c9c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstancesResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstancesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstancesResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstancesResponseType.java b/awsapi/src/com/amazon/ec2/DescribeInstancesResponseType.java index 18821728fac..2601626cf93 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstancesResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstancesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstancesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeInstancesType.java b/awsapi/src/com/amazon/ec2/DescribeInstancesType.java index a18c1e52071..e904374d6fe 100644 --- a/awsapi/src/com/amazon/ec2/DescribeInstancesType.java +++ b/awsapi/src/com/amazon/ec2/DescribeInstancesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeInstancesType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeKeyPairs.java b/awsapi/src/com/amazon/ec2/DescribeKeyPairs.java index 07fa15eb591..9220e5663c9 100644 --- a/awsapi/src/com/amazon/ec2/DescribeKeyPairs.java +++ b/awsapi/src/com/amazon/ec2/DescribeKeyPairs.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeKeyPairs.java diff --git a/awsapi/src/com/amazon/ec2/DescribeKeyPairsInfoType.java b/awsapi/src/com/amazon/ec2/DescribeKeyPairsInfoType.java index d280367d853..c8664b29eb6 100644 --- a/awsapi/src/com/amazon/ec2/DescribeKeyPairsInfoType.java +++ b/awsapi/src/com/amazon/ec2/DescribeKeyPairsInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeKeyPairsInfoType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeKeyPairsItemType.java b/awsapi/src/com/amazon/ec2/DescribeKeyPairsItemType.java index 0a9910ba27d..6326406e998 100644 --- a/awsapi/src/com/amazon/ec2/DescribeKeyPairsItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeKeyPairsItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeKeyPairsItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponse.java b/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponse.java index 30f13adecf3..1cb7d9ad9a1 100644 --- a/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeKeyPairsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseInfoType.java b/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseInfoType.java index b6be68b2d39..bb7237e7c9d 100644 --- a/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseInfoType.java +++ b/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeKeyPairsResponseInfoType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseItemType.java b/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseItemType.java index c88add2a5ae..a2dae465408 100644 --- a/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeKeyPairsResponseItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseType.java index ad4512de81c..23d37929a09 100644 --- a/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeKeyPairsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeKeyPairsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeKeyPairsType.java b/awsapi/src/com/amazon/ec2/DescribeKeyPairsType.java index 7b01220c2c2..ee7d97d0073 100644 --- a/awsapi/src/com/amazon/ec2/DescribeKeyPairsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeKeyPairsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeKeyPairsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeLicenses.java b/awsapi/src/com/amazon/ec2/DescribeLicenses.java index 4b190bdf3d3..3e68f490a2a 100644 --- a/awsapi/src/com/amazon/ec2/DescribeLicenses.java +++ b/awsapi/src/com/amazon/ec2/DescribeLicenses.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeLicenses.java diff --git a/awsapi/src/com/amazon/ec2/DescribeLicensesResponse.java b/awsapi/src/com/amazon/ec2/DescribeLicensesResponse.java index 2f84e8f46c2..0e213f84cfe 100644 --- a/awsapi/src/com/amazon/ec2/DescribeLicensesResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeLicensesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeLicensesResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeLicensesResponseType.java b/awsapi/src/com/amazon/ec2/DescribeLicensesResponseType.java index c172b6cf951..5c6901caa9d 100644 --- a/awsapi/src/com/amazon/ec2/DescribeLicensesResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeLicensesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeLicensesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeLicensesType.java b/awsapi/src/com/amazon/ec2/DescribeLicensesType.java index 4f49cd05efc..ef1a9867e78 100644 --- a/awsapi/src/com/amazon/ec2/DescribeLicensesType.java +++ b/awsapi/src/com/amazon/ec2/DescribeLicensesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeLicensesType.java diff --git a/awsapi/src/com/amazon/ec2/DescribePlacementGroupItemType.java b/awsapi/src/com/amazon/ec2/DescribePlacementGroupItemType.java index 14bf52dbbbf..a5013875dd0 100644 --- a/awsapi/src/com/amazon/ec2/DescribePlacementGroupItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribePlacementGroupItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribePlacementGroupItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribePlacementGroups.java b/awsapi/src/com/amazon/ec2/DescribePlacementGroups.java index 7098671bd01..3ca8a0b09a7 100644 --- a/awsapi/src/com/amazon/ec2/DescribePlacementGroups.java +++ b/awsapi/src/com/amazon/ec2/DescribePlacementGroups.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribePlacementGroups.java diff --git a/awsapi/src/com/amazon/ec2/DescribePlacementGroupsInfoType.java b/awsapi/src/com/amazon/ec2/DescribePlacementGroupsInfoType.java index e631dc144c7..c74693f66d8 100644 --- a/awsapi/src/com/amazon/ec2/DescribePlacementGroupsInfoType.java +++ b/awsapi/src/com/amazon/ec2/DescribePlacementGroupsInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribePlacementGroupsInfoType.java diff --git a/awsapi/src/com/amazon/ec2/DescribePlacementGroupsResponse.java b/awsapi/src/com/amazon/ec2/DescribePlacementGroupsResponse.java index 39b4929c73c..3c46e0c4f0f 100644 --- a/awsapi/src/com/amazon/ec2/DescribePlacementGroupsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribePlacementGroupsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribePlacementGroupsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribePlacementGroupsResponseType.java b/awsapi/src/com/amazon/ec2/DescribePlacementGroupsResponseType.java index d3aa6f91489..bf5aa2aec49 100644 --- a/awsapi/src/com/amazon/ec2/DescribePlacementGroupsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribePlacementGroupsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribePlacementGroupsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribePlacementGroupsType.java b/awsapi/src/com/amazon/ec2/DescribePlacementGroupsType.java index 52a4ff9baf1..8e19ab72cb6 100644 --- a/awsapi/src/com/amazon/ec2/DescribePlacementGroupsType.java +++ b/awsapi/src/com/amazon/ec2/DescribePlacementGroupsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribePlacementGroupsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeRegions.java b/awsapi/src/com/amazon/ec2/DescribeRegions.java index 289397deb90..2b9c1236028 100644 --- a/awsapi/src/com/amazon/ec2/DescribeRegions.java +++ b/awsapi/src/com/amazon/ec2/DescribeRegions.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeRegions.java diff --git a/awsapi/src/com/amazon/ec2/DescribeRegionsResponse.java b/awsapi/src/com/amazon/ec2/DescribeRegionsResponse.java index 15bac8f911b..10f87396325 100644 --- a/awsapi/src/com/amazon/ec2/DescribeRegionsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeRegionsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeRegionsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeRegionsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeRegionsResponseType.java index 98d5c2bb04a..6db1510527c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeRegionsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeRegionsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeRegionsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeRegionsSetItemType.java b/awsapi/src/com/amazon/ec2/DescribeRegionsSetItemType.java index a8576617797..1d096a5c35c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeRegionsSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeRegionsSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeRegionsSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeRegionsSetType.java b/awsapi/src/com/amazon/ec2/DescribeRegionsSetType.java index 41cb08d0925..913a76269e9 100644 --- a/awsapi/src/com/amazon/ec2/DescribeRegionsSetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeRegionsSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeRegionsSetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeRegionsType.java b/awsapi/src/com/amazon/ec2/DescribeRegionsType.java index 17be1b37ab7..bf0fffb99ff 100644 --- a/awsapi/src/com/amazon/ec2/DescribeRegionsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeRegionsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeRegionsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstances.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstances.java index f7a6e67e7a8..cf12ec0c6e4 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstances.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstances.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstances.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferings.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferings.java index cfe19f635da..4354125cfb9 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferings.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferings.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesOfferings.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponse.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponse.java index ea6deeeb109..f66474c3bf7 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesOfferingsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseSetItemType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseSetItemType.java index 1f1ba5f161a..bef0847a337 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesOfferingsResponseSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseSetType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseSetType.java index 2c54683097e..08de73a5274 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseSetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesOfferingsResponseSetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseType.java index 0e380ac8dfb..5aaa61b6cb6 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesOfferingsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsSetItemType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsSetItemType.java index f9022d73568..51d2742e784 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesOfferingsSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsSetType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsSetType.java index ee1b451b6de..3d5dc4b9a42 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsSetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesOfferingsSetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsType.java index 75e4ddd3c31..77fec9d2873 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesOfferingsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesOfferingsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponse.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponse.java index 233b89c5bba..23f51192d82 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseSetItemType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseSetItemType.java index ae419e91bed..6fa1bfd932c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesResponseSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseSetType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseSetType.java index 0f3c20cb555..7391092690b 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseSetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesResponseSetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseType.java index 04aa6fb9445..c3d47c1cd26 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesSetItemType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesSetItemType.java index 2f465d0a315..c522918c84c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesSetType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesSetType.java index 26ffca9aaed..14ade5e76c7 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesSetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesSetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesType.java b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesType.java index 0ea43c7fb42..8f185fd7757 100644 --- a/awsapi/src/com/amazon/ec2/DescribeReservedInstancesType.java +++ b/awsapi/src/com/amazon/ec2/DescribeReservedInstancesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeReservedInstancesType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSecurityGroups.java b/awsapi/src/com/amazon/ec2/DescribeSecurityGroups.java index 336b6b43835..c0a415b022d 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSecurityGroups.java +++ b/awsapi/src/com/amazon/ec2/DescribeSecurityGroups.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSecurityGroups.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsResponse.java b/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsResponse.java index 48a0f46837d..ddabe8a0bca 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSecurityGroupsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsResponseType.java index 455e54ec572..aa58d5e1096 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSecurityGroupsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsSetItemType.java b/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsSetItemType.java index 05973288a0a..f4597a4aaa9 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSecurityGroupsSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsSetType.java b/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsSetType.java index 5356724e20c..97dd45d8364 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsSetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSecurityGroupsSetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsType.java b/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsType.java index 974fbe9753b..1b4fbbc5c08 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSecurityGroupsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSecurityGroupsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotAttribute.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotAttribute.java index 01a798c337c..f3f1b39e017 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotAttribute.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotAttribute.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotAttribute.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeResponse.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeResponse.java index 780c3369939..adc88e09e96 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotAttributeResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeResponseType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeResponseType.java index 2d45d732773..6bcc62108f5 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotAttributeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeType.java index 7c0f5b1d29f..0a69cabd363 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotAttributeType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributesGroup.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributesGroup.java index f2f2718e580..d61c436a5c6 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributesGroup.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotAttributesGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotAttributesGroup.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshots.java b/awsapi/src/com/amazon/ec2/DescribeSnapshots.java index 73f217bfcf1..2ba3e12ae31 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshots.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshots.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshots.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsOwnerType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsOwnerType.java index b381f1f008b..fffaff6bde2 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsOwnerType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsOwnerType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsOwnerType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsOwnersType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsOwnersType.java index adf75b23767..de3da58751b 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsOwnersType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsOwnersType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsOwnersType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsResponse.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsResponse.java index 6965dfdd788..e5dcf07877b 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsResponseType.java index 2e9fae1ab15..5830d31c834 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsRestorableBySetType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsRestorableBySetType.java index 31387a1163e..48ad4471493 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsRestorableBySetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsRestorableBySetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsRestorableBySetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsRestorableByType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsRestorableByType.java index 0762db5eb98..8b316709d65 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsRestorableByType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsRestorableByType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsRestorableByType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetItemResponseType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetItemResponseType.java index 54d2e233683..3e3ce602328 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetItemResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetItemResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsSetItemResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetItemType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetItemType.java index c15cb28ef5f..88785034de8 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetResponseType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetResponseType.java index c9e4917459b..e4df9c709f4 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsSetResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetType.java index e146fd2ce96..750985bd8db 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsSetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSnapshotsType.java b/awsapi/src/com/amazon/ec2/DescribeSnapshotsType.java index cba8703965b..e96ba70f2e0 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSnapshotsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSnapshotsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSnapshotsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscription.java b/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscription.java index 31f52be45e4..e52d84bab4a 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscription.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscription.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotDatafeedSubscription.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionResponse.java b/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionResponse.java index f5fa6206e1e..a085cef5603 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotDatafeedSubscriptionResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionResponseType.java b/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionResponseType.java index e12389276b5..f5c815d993a 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotDatafeedSubscriptionResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionType.java b/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionType.java index 18a561be705..bcd6823fb13 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotDatafeedSubscriptionType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotDatafeedSubscriptionType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequests.java b/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequests.java index 3c554014833..008d2d916a4 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequests.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequests.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotInstanceRequests.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsResponse.java b/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsResponse.java index 37a12ece809..621ddbb8dd2 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotInstanceRequestsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsResponseType.java index d943f941474..a762049ad03 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotInstanceRequestsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsType.java b/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsType.java index fd1bac6492a..96ac2ca78a4 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotInstanceRequestsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotInstanceRequestsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistory.java b/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistory.java index bc7eb5ee0c0..27aaf21c824 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistory.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistory.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotPriceHistory.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryResponse.java b/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryResponse.java index 6048118b1f9..b91e7de908f 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotPriceHistoryResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryResponseType.java b/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryResponseType.java index ef8eead6d0d..c420411693c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotPriceHistoryResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryType.java b/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryType.java index a42dc8e0135..2f5f257f133 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSpotPriceHistoryType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSpotPriceHistoryType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSubnets.java b/awsapi/src/com/amazon/ec2/DescribeSubnets.java index a085d88771e..8d051286554 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSubnets.java +++ b/awsapi/src/com/amazon/ec2/DescribeSubnets.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSubnets.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSubnetsResponse.java b/awsapi/src/com/amazon/ec2/DescribeSubnetsResponse.java index 7cfde563bcf..24fba39c2f9 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSubnetsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeSubnetsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSubnetsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSubnetsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeSubnetsResponseType.java index 4332e2a5d97..d5cc7d74588 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSubnetsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSubnetsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSubnetsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeSubnetsType.java b/awsapi/src/com/amazon/ec2/DescribeSubnetsType.java index 4fa28cbecd2..4f028b9ee0e 100644 --- a/awsapi/src/com/amazon/ec2/DescribeSubnetsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeSubnetsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeSubnetsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeTags.java b/awsapi/src/com/amazon/ec2/DescribeTags.java index 8105aa6bd3a..9ba7ebe4f05 100644 --- a/awsapi/src/com/amazon/ec2/DescribeTags.java +++ b/awsapi/src/com/amazon/ec2/DescribeTags.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeTags.java diff --git a/awsapi/src/com/amazon/ec2/DescribeTagsResponse.java b/awsapi/src/com/amazon/ec2/DescribeTagsResponse.java index 4ebf92262ac..90d4a23c4ae 100644 --- a/awsapi/src/com/amazon/ec2/DescribeTagsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeTagsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeTagsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeTagsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeTagsResponseType.java index d9d5d1639c2..a825f7af57b 100644 --- a/awsapi/src/com/amazon/ec2/DescribeTagsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeTagsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeTagsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeTagsType.java b/awsapi/src/com/amazon/ec2/DescribeTagsType.java index 42fddad5d78..c500d6634b1 100644 --- a/awsapi/src/com/amazon/ec2/DescribeTagsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeTagsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeTagsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVolumes.java b/awsapi/src/com/amazon/ec2/DescribeVolumes.java index 4026befb2d9..c4ae1d9d492 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVolumes.java +++ b/awsapi/src/com/amazon/ec2/DescribeVolumes.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVolumes.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVolumesResponse.java b/awsapi/src/com/amazon/ec2/DescribeVolumesResponse.java index f86d5ae04d9..5ede2155e9d 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVolumesResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeVolumesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVolumesResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVolumesResponseType.java b/awsapi/src/com/amazon/ec2/DescribeVolumesResponseType.java index f63aa4e681c..c9640811248 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVolumesResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVolumesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVolumesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVolumesSetItemResponseType.java b/awsapi/src/com/amazon/ec2/DescribeVolumesSetItemResponseType.java index 3cfb069b90f..015171eff63 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVolumesSetItemResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVolumesSetItemResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVolumesSetItemResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVolumesSetItemType.java b/awsapi/src/com/amazon/ec2/DescribeVolumesSetItemType.java index 70779b820a5..f5d869d654e 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVolumesSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVolumesSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVolumesSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVolumesSetResponseType.java b/awsapi/src/com/amazon/ec2/DescribeVolumesSetResponseType.java index 7cd834fa203..85c8bb67ed8 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVolumesSetResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVolumesSetResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVolumesSetResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVolumesSetType.java b/awsapi/src/com/amazon/ec2/DescribeVolumesSetType.java index c73fd447df5..6b9321ecda6 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVolumesSetType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVolumesSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVolumesSetType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVolumesType.java b/awsapi/src/com/amazon/ec2/DescribeVolumesType.java index 6a15354f4af..8b2ea069f4c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVolumesType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVolumesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVolumesType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpcs.java b/awsapi/src/com/amazon/ec2/DescribeVpcs.java index dab6bd878d5..58e31fdc17d 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpcs.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpcs.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpcs.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpcsResponse.java b/awsapi/src/com/amazon/ec2/DescribeVpcsResponse.java index 586a2615535..4a6b0049eed 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpcsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpcsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpcsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpcsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeVpcsResponseType.java index 66ba9d9f2af..6a2ad9cc52b 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpcsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpcsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpcsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpcsType.java b/awsapi/src/com/amazon/ec2/DescribeVpcsType.java index a2b64c0ac7b..866e2a8e707 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpcsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpcsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpcsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpnConnections.java b/awsapi/src/com/amazon/ec2/DescribeVpnConnections.java index ef8b02919e4..2c53b9f989c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpnConnections.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpnConnections.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpnConnections.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsResponse.java b/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsResponse.java index 4aed4743c2e..e48b205e9d5 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpnConnectionsResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsResponseType.java b/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsResponseType.java index 07d8be9e2c8..fd6ea005aea 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpnConnectionsResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsType.java b/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsType.java index 0875b5494bc..965eacb321c 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpnConnectionsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpnConnectionsType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpnGateways.java b/awsapi/src/com/amazon/ec2/DescribeVpnGateways.java index 56070bc1aef..bd7e812dc90 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpnGateways.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpnGateways.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpnGateways.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysResponse.java b/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysResponse.java index 83c7df2445b..b14e3d84b2a 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysResponse.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpnGatewaysResponse.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysResponseType.java b/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysResponseType.java index f0a270ec366..9c7fc006be4 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysResponseType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpnGatewaysResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysType.java b/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysType.java index 43d8fff791e..bcf6ec34c57 100644 --- a/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysType.java +++ b/awsapi/src/com/amazon/ec2/DescribeVpnGatewaysType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DescribeVpnGatewaysType.java diff --git a/awsapi/src/com/amazon/ec2/DetachVolume.java b/awsapi/src/com/amazon/ec2/DetachVolume.java index 98ec4152c2d..a1c8acff39a 100644 --- a/awsapi/src/com/amazon/ec2/DetachVolume.java +++ b/awsapi/src/com/amazon/ec2/DetachVolume.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DetachVolume.java diff --git a/awsapi/src/com/amazon/ec2/DetachVolumeResponse.java b/awsapi/src/com/amazon/ec2/DetachVolumeResponse.java index dfd75ec22ec..089268f4bea 100644 --- a/awsapi/src/com/amazon/ec2/DetachVolumeResponse.java +++ b/awsapi/src/com/amazon/ec2/DetachVolumeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DetachVolumeResponse.java diff --git a/awsapi/src/com/amazon/ec2/DetachVolumeResponseType.java b/awsapi/src/com/amazon/ec2/DetachVolumeResponseType.java index 79d9ec80260..1d9f0bbf4ec 100644 --- a/awsapi/src/com/amazon/ec2/DetachVolumeResponseType.java +++ b/awsapi/src/com/amazon/ec2/DetachVolumeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DetachVolumeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DetachVolumeType.java b/awsapi/src/com/amazon/ec2/DetachVolumeType.java index 6bcc73fbc97..87f0ccab763 100644 --- a/awsapi/src/com/amazon/ec2/DetachVolumeType.java +++ b/awsapi/src/com/amazon/ec2/DetachVolumeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DetachVolumeType.java diff --git a/awsapi/src/com/amazon/ec2/DetachVpnGateway.java b/awsapi/src/com/amazon/ec2/DetachVpnGateway.java index 9d56da1661d..f09ac67df26 100644 --- a/awsapi/src/com/amazon/ec2/DetachVpnGateway.java +++ b/awsapi/src/com/amazon/ec2/DetachVpnGateway.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DetachVpnGateway.java diff --git a/awsapi/src/com/amazon/ec2/DetachVpnGatewayResponse.java b/awsapi/src/com/amazon/ec2/DetachVpnGatewayResponse.java index 6d2ed80306e..b9da6bc1a84 100644 --- a/awsapi/src/com/amazon/ec2/DetachVpnGatewayResponse.java +++ b/awsapi/src/com/amazon/ec2/DetachVpnGatewayResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DetachVpnGatewayResponse.java diff --git a/awsapi/src/com/amazon/ec2/DetachVpnGatewayResponseType.java b/awsapi/src/com/amazon/ec2/DetachVpnGatewayResponseType.java index 9c0cec5f374..9b0c27d3fa4 100644 --- a/awsapi/src/com/amazon/ec2/DetachVpnGatewayResponseType.java +++ b/awsapi/src/com/amazon/ec2/DetachVpnGatewayResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DetachVpnGatewayResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DetachVpnGatewayType.java b/awsapi/src/com/amazon/ec2/DetachVpnGatewayType.java index 8ba06aaff13..f0a2e622368 100644 --- a/awsapi/src/com/amazon/ec2/DetachVpnGatewayType.java +++ b/awsapi/src/com/amazon/ec2/DetachVpnGatewayType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DetachVpnGatewayType.java diff --git a/awsapi/src/com/amazon/ec2/DhcpConfigurationItemSetType.java b/awsapi/src/com/amazon/ec2/DhcpConfigurationItemSetType.java index 69fbce96c22..c02d4d7e6f7 100644 --- a/awsapi/src/com/amazon/ec2/DhcpConfigurationItemSetType.java +++ b/awsapi/src/com/amazon/ec2/DhcpConfigurationItemSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DhcpConfigurationItemSetType.java diff --git a/awsapi/src/com/amazon/ec2/DhcpConfigurationItemType.java b/awsapi/src/com/amazon/ec2/DhcpConfigurationItemType.java index b646e76a828..ef61f827483 100644 --- a/awsapi/src/com/amazon/ec2/DhcpConfigurationItemType.java +++ b/awsapi/src/com/amazon/ec2/DhcpConfigurationItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DhcpConfigurationItemType.java diff --git a/awsapi/src/com/amazon/ec2/DhcpOptionsIdSetItemType.java b/awsapi/src/com/amazon/ec2/DhcpOptionsIdSetItemType.java index 9d1dc74cfe4..a95dd70e393 100644 --- a/awsapi/src/com/amazon/ec2/DhcpOptionsIdSetItemType.java +++ b/awsapi/src/com/amazon/ec2/DhcpOptionsIdSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DhcpOptionsIdSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/DhcpOptionsIdSetType.java b/awsapi/src/com/amazon/ec2/DhcpOptionsIdSetType.java index 011e049f191..fca080faaba 100644 --- a/awsapi/src/com/amazon/ec2/DhcpOptionsIdSetType.java +++ b/awsapi/src/com/amazon/ec2/DhcpOptionsIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DhcpOptionsIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/DhcpOptionsSetType.java b/awsapi/src/com/amazon/ec2/DhcpOptionsSetType.java index 5d47dfbbe09..b4af49547db 100644 --- a/awsapi/src/com/amazon/ec2/DhcpOptionsSetType.java +++ b/awsapi/src/com/amazon/ec2/DhcpOptionsSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DhcpOptionsSetType.java diff --git a/awsapi/src/com/amazon/ec2/DhcpOptionsType.java b/awsapi/src/com/amazon/ec2/DhcpOptionsType.java index bd9af583925..1a475d0d959 100644 --- a/awsapi/src/com/amazon/ec2/DhcpOptionsType.java +++ b/awsapi/src/com/amazon/ec2/DhcpOptionsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DhcpOptionsType.java diff --git a/awsapi/src/com/amazon/ec2/DhcpValueSetType.java b/awsapi/src/com/amazon/ec2/DhcpValueSetType.java index 82b261f92d1..cdb450ec3af 100644 --- a/awsapi/src/com/amazon/ec2/DhcpValueSetType.java +++ b/awsapi/src/com/amazon/ec2/DhcpValueSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DhcpValueSetType.java diff --git a/awsapi/src/com/amazon/ec2/DhcpValueType.java b/awsapi/src/com/amazon/ec2/DhcpValueType.java index 4421b02a9d6..61b121de94a 100644 --- a/awsapi/src/com/amazon/ec2/DhcpValueType.java +++ b/awsapi/src/com/amazon/ec2/DhcpValueType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DhcpValueType.java diff --git a/awsapi/src/com/amazon/ec2/DisassociateAddress.java b/awsapi/src/com/amazon/ec2/DisassociateAddress.java index 83c7408e3a8..2e097f0c73f 100644 --- a/awsapi/src/com/amazon/ec2/DisassociateAddress.java +++ b/awsapi/src/com/amazon/ec2/DisassociateAddress.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DisassociateAddress.java diff --git a/awsapi/src/com/amazon/ec2/DisassociateAddressResponse.java b/awsapi/src/com/amazon/ec2/DisassociateAddressResponse.java index 9665a294f3b..0bf85e98c4d 100644 --- a/awsapi/src/com/amazon/ec2/DisassociateAddressResponse.java +++ b/awsapi/src/com/amazon/ec2/DisassociateAddressResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DisassociateAddressResponse.java diff --git a/awsapi/src/com/amazon/ec2/DisassociateAddressResponseType.java b/awsapi/src/com/amazon/ec2/DisassociateAddressResponseType.java index abc3a8ff93a..51c0d560a69 100644 --- a/awsapi/src/com/amazon/ec2/DisassociateAddressResponseType.java +++ b/awsapi/src/com/amazon/ec2/DisassociateAddressResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DisassociateAddressResponseType.java diff --git a/awsapi/src/com/amazon/ec2/DisassociateAddressType.java b/awsapi/src/com/amazon/ec2/DisassociateAddressType.java index 8bafb6e5057..acf091df54a 100644 --- a/awsapi/src/com/amazon/ec2/DisassociateAddressType.java +++ b/awsapi/src/com/amazon/ec2/DisassociateAddressType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DisassociateAddressType.java diff --git a/awsapi/src/com/amazon/ec2/DiskImageDescriptionType.java b/awsapi/src/com/amazon/ec2/DiskImageDescriptionType.java index e262e7c740c..f92a4909654 100644 --- a/awsapi/src/com/amazon/ec2/DiskImageDescriptionType.java +++ b/awsapi/src/com/amazon/ec2/DiskImageDescriptionType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DiskImageDescriptionType.java diff --git a/awsapi/src/com/amazon/ec2/DiskImageDetailType.java b/awsapi/src/com/amazon/ec2/DiskImageDetailType.java index ff8b4945f57..eea6f38c252 100644 --- a/awsapi/src/com/amazon/ec2/DiskImageDetailType.java +++ b/awsapi/src/com/amazon/ec2/DiskImageDetailType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DiskImageDetailType.java diff --git a/awsapi/src/com/amazon/ec2/DiskImageSetType.java b/awsapi/src/com/amazon/ec2/DiskImageSetType.java index 5b96d035153..78b0fb6e3a1 100644 --- a/awsapi/src/com/amazon/ec2/DiskImageSetType.java +++ b/awsapi/src/com/amazon/ec2/DiskImageSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DiskImageSetType.java diff --git a/awsapi/src/com/amazon/ec2/DiskImageType.java b/awsapi/src/com/amazon/ec2/DiskImageType.java index b692319296f..d15fd538a7c 100644 --- a/awsapi/src/com/amazon/ec2/DiskImageType.java +++ b/awsapi/src/com/amazon/ec2/DiskImageType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DiskImageType.java diff --git a/awsapi/src/com/amazon/ec2/DiskImageVolumeDescriptionType.java b/awsapi/src/com/amazon/ec2/DiskImageVolumeDescriptionType.java index 2456208fcf0..fa8944fd8ac 100644 --- a/awsapi/src/com/amazon/ec2/DiskImageVolumeDescriptionType.java +++ b/awsapi/src/com/amazon/ec2/DiskImageVolumeDescriptionType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DiskImageVolumeDescriptionType.java diff --git a/awsapi/src/com/amazon/ec2/DiskImageVolumeType.java b/awsapi/src/com/amazon/ec2/DiskImageVolumeType.java index 95f68fccd0c..579c6972204 100644 --- a/awsapi/src/com/amazon/ec2/DiskImageVolumeType.java +++ b/awsapi/src/com/amazon/ec2/DiskImageVolumeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * DiskImageVolumeType.java diff --git a/awsapi/src/com/amazon/ec2/EbsBlockDeviceType.java b/awsapi/src/com/amazon/ec2/EbsBlockDeviceType.java index 53077c602c2..c33813791bd 100644 --- a/awsapi/src/com/amazon/ec2/EbsBlockDeviceType.java +++ b/awsapi/src/com/amazon/ec2/EbsBlockDeviceType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * EbsBlockDeviceType.java diff --git a/awsapi/src/com/amazon/ec2/EbsInstanceBlockDeviceMappingResponseType.java b/awsapi/src/com/amazon/ec2/EbsInstanceBlockDeviceMappingResponseType.java index dac8317e07f..1529399404b 100644 --- a/awsapi/src/com/amazon/ec2/EbsInstanceBlockDeviceMappingResponseType.java +++ b/awsapi/src/com/amazon/ec2/EbsInstanceBlockDeviceMappingResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * EbsInstanceBlockDeviceMappingResponseType.java diff --git a/awsapi/src/com/amazon/ec2/EmptyElementType.java b/awsapi/src/com/amazon/ec2/EmptyElementType.java index 0d1bb17167d..0b41ba784ac 100644 --- a/awsapi/src/com/amazon/ec2/EmptyElementType.java +++ b/awsapi/src/com/amazon/ec2/EmptyElementType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * EmptyElementType.java diff --git a/awsapi/src/com/amazon/ec2/ExtensionMapper.java b/awsapi/src/com/amazon/ec2/ExtensionMapper.java index 13dd7ee2211..0e7b9cac654 100644 --- a/awsapi/src/com/amazon/ec2/ExtensionMapper.java +++ b/awsapi/src/com/amazon/ec2/ExtensionMapper.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ExtensionMapper.java diff --git a/awsapi/src/com/amazon/ec2/FilterSetType.java b/awsapi/src/com/amazon/ec2/FilterSetType.java index cf2b8528fb4..dbd7a809ece 100644 --- a/awsapi/src/com/amazon/ec2/FilterSetType.java +++ b/awsapi/src/com/amazon/ec2/FilterSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * FilterSetType.java diff --git a/awsapi/src/com/amazon/ec2/FilterType.java b/awsapi/src/com/amazon/ec2/FilterType.java index 4c4cef5b36a..b1953b6d3e4 100644 --- a/awsapi/src/com/amazon/ec2/FilterType.java +++ b/awsapi/src/com/amazon/ec2/FilterType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * FilterType.java diff --git a/awsapi/src/com/amazon/ec2/GetConsoleOutput.java b/awsapi/src/com/amazon/ec2/GetConsoleOutput.java index c949b7fb841..a37587583ef 100644 --- a/awsapi/src/com/amazon/ec2/GetConsoleOutput.java +++ b/awsapi/src/com/amazon/ec2/GetConsoleOutput.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * GetConsoleOutput.java diff --git a/awsapi/src/com/amazon/ec2/GetConsoleOutputResponse.java b/awsapi/src/com/amazon/ec2/GetConsoleOutputResponse.java index 5907c806a44..0b486d63d11 100644 --- a/awsapi/src/com/amazon/ec2/GetConsoleOutputResponse.java +++ b/awsapi/src/com/amazon/ec2/GetConsoleOutputResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * GetConsoleOutputResponse.java diff --git a/awsapi/src/com/amazon/ec2/GetConsoleOutputResponseType.java b/awsapi/src/com/amazon/ec2/GetConsoleOutputResponseType.java index 5f680fdce34..1a59b509365 100644 --- a/awsapi/src/com/amazon/ec2/GetConsoleOutputResponseType.java +++ b/awsapi/src/com/amazon/ec2/GetConsoleOutputResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * GetConsoleOutputResponseType.java diff --git a/awsapi/src/com/amazon/ec2/GetConsoleOutputType.java b/awsapi/src/com/amazon/ec2/GetConsoleOutputType.java index 7eb769fe902..9fb68d3b8cc 100644 --- a/awsapi/src/com/amazon/ec2/GetConsoleOutputType.java +++ b/awsapi/src/com/amazon/ec2/GetConsoleOutputType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * GetConsoleOutputType.java diff --git a/awsapi/src/com/amazon/ec2/GetPasswordData.java b/awsapi/src/com/amazon/ec2/GetPasswordData.java index 1759dc1c052..9d192282c16 100644 --- a/awsapi/src/com/amazon/ec2/GetPasswordData.java +++ b/awsapi/src/com/amazon/ec2/GetPasswordData.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * GetPasswordData.java diff --git a/awsapi/src/com/amazon/ec2/GetPasswordDataResponse.java b/awsapi/src/com/amazon/ec2/GetPasswordDataResponse.java index cb26f645a73..ecb4334fb17 100644 --- a/awsapi/src/com/amazon/ec2/GetPasswordDataResponse.java +++ b/awsapi/src/com/amazon/ec2/GetPasswordDataResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * GetPasswordDataResponse.java diff --git a/awsapi/src/com/amazon/ec2/GetPasswordDataResponseType.java b/awsapi/src/com/amazon/ec2/GetPasswordDataResponseType.java index a73d7c2e57a..34dce0f4d0f 100644 --- a/awsapi/src/com/amazon/ec2/GetPasswordDataResponseType.java +++ b/awsapi/src/com/amazon/ec2/GetPasswordDataResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * GetPasswordDataResponseType.java diff --git a/awsapi/src/com/amazon/ec2/GetPasswordDataType.java b/awsapi/src/com/amazon/ec2/GetPasswordDataType.java index 00e5e6b8364..88bc22f446c 100644 --- a/awsapi/src/com/amazon/ec2/GetPasswordDataType.java +++ b/awsapi/src/com/amazon/ec2/GetPasswordDataType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * GetPasswordDataType.java diff --git a/awsapi/src/com/amazon/ec2/GroupItemType.java b/awsapi/src/com/amazon/ec2/GroupItemType.java index e4ca231641f..7b77527f890 100644 --- a/awsapi/src/com/amazon/ec2/GroupItemType.java +++ b/awsapi/src/com/amazon/ec2/GroupItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * GroupItemType.java diff --git a/awsapi/src/com/amazon/ec2/GroupSetType.java b/awsapi/src/com/amazon/ec2/GroupSetType.java index 92d20a5a4c8..f39b13b546f 100644 --- a/awsapi/src/com/amazon/ec2/GroupSetType.java +++ b/awsapi/src/com/amazon/ec2/GroupSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * GroupSetType.java diff --git a/awsapi/src/com/amazon/ec2/ImportInstance.java b/awsapi/src/com/amazon/ec2/ImportInstance.java index 9a908bf37e7..5b3c986a996 100644 --- a/awsapi/src/com/amazon/ec2/ImportInstance.java +++ b/awsapi/src/com/amazon/ec2/ImportInstance.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportInstance.java diff --git a/awsapi/src/com/amazon/ec2/ImportInstanceLaunchSpecificationType.java b/awsapi/src/com/amazon/ec2/ImportInstanceLaunchSpecificationType.java index 21b52b73916..2c6c3c5ca57 100644 --- a/awsapi/src/com/amazon/ec2/ImportInstanceLaunchSpecificationType.java +++ b/awsapi/src/com/amazon/ec2/ImportInstanceLaunchSpecificationType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportInstanceLaunchSpecificationType.java diff --git a/awsapi/src/com/amazon/ec2/ImportInstanceResponse.java b/awsapi/src/com/amazon/ec2/ImportInstanceResponse.java index 3b944eed873..be81e83fb64 100644 --- a/awsapi/src/com/amazon/ec2/ImportInstanceResponse.java +++ b/awsapi/src/com/amazon/ec2/ImportInstanceResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportInstanceResponse.java diff --git a/awsapi/src/com/amazon/ec2/ImportInstanceResponseType.java b/awsapi/src/com/amazon/ec2/ImportInstanceResponseType.java index 072bcd7d94b..ec5480fae69 100644 --- a/awsapi/src/com/amazon/ec2/ImportInstanceResponseType.java +++ b/awsapi/src/com/amazon/ec2/ImportInstanceResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportInstanceResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ImportInstanceTaskDetailsType.java b/awsapi/src/com/amazon/ec2/ImportInstanceTaskDetailsType.java index f35f2e8a373..f5f92eade17 100644 --- a/awsapi/src/com/amazon/ec2/ImportInstanceTaskDetailsType.java +++ b/awsapi/src/com/amazon/ec2/ImportInstanceTaskDetailsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportInstanceTaskDetailsType.java diff --git a/awsapi/src/com/amazon/ec2/ImportInstanceType.java b/awsapi/src/com/amazon/ec2/ImportInstanceType.java index 062b773cd9a..1f49614b600 100644 --- a/awsapi/src/com/amazon/ec2/ImportInstanceType.java +++ b/awsapi/src/com/amazon/ec2/ImportInstanceType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportInstanceType.java diff --git a/awsapi/src/com/amazon/ec2/ImportInstanceVolumeDetailItemType.java b/awsapi/src/com/amazon/ec2/ImportInstanceVolumeDetailItemType.java index f89189d713f..c5f40d0ec0a 100644 --- a/awsapi/src/com/amazon/ec2/ImportInstanceVolumeDetailItemType.java +++ b/awsapi/src/com/amazon/ec2/ImportInstanceVolumeDetailItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportInstanceVolumeDetailItemType.java diff --git a/awsapi/src/com/amazon/ec2/ImportInstanceVolumeDetailSetType.java b/awsapi/src/com/amazon/ec2/ImportInstanceVolumeDetailSetType.java index 31c6ec90127..b6a43b6c6b7 100644 --- a/awsapi/src/com/amazon/ec2/ImportInstanceVolumeDetailSetType.java +++ b/awsapi/src/com/amazon/ec2/ImportInstanceVolumeDetailSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportInstanceVolumeDetailSetType.java diff --git a/awsapi/src/com/amazon/ec2/ImportKeyPair.java b/awsapi/src/com/amazon/ec2/ImportKeyPair.java index 8cb27d8884a..c6ca5fe4b42 100644 --- a/awsapi/src/com/amazon/ec2/ImportKeyPair.java +++ b/awsapi/src/com/amazon/ec2/ImportKeyPair.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportKeyPair.java diff --git a/awsapi/src/com/amazon/ec2/ImportKeyPairResponse.java b/awsapi/src/com/amazon/ec2/ImportKeyPairResponse.java index 091cb255953..5309b21ed86 100644 --- a/awsapi/src/com/amazon/ec2/ImportKeyPairResponse.java +++ b/awsapi/src/com/amazon/ec2/ImportKeyPairResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportKeyPairResponse.java diff --git a/awsapi/src/com/amazon/ec2/ImportKeyPairResponseType.java b/awsapi/src/com/amazon/ec2/ImportKeyPairResponseType.java index efe93e568c9..bfbb459690a 100644 --- a/awsapi/src/com/amazon/ec2/ImportKeyPairResponseType.java +++ b/awsapi/src/com/amazon/ec2/ImportKeyPairResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportKeyPairResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ImportKeyPairType.java b/awsapi/src/com/amazon/ec2/ImportKeyPairType.java index a3478da7c4a..5d515de0377 100644 --- a/awsapi/src/com/amazon/ec2/ImportKeyPairType.java +++ b/awsapi/src/com/amazon/ec2/ImportKeyPairType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportKeyPairType.java diff --git a/awsapi/src/com/amazon/ec2/ImportVolume.java b/awsapi/src/com/amazon/ec2/ImportVolume.java index f27c833c1e1..7a12724b114 100644 --- a/awsapi/src/com/amazon/ec2/ImportVolume.java +++ b/awsapi/src/com/amazon/ec2/ImportVolume.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportVolume.java diff --git a/awsapi/src/com/amazon/ec2/ImportVolumeResponse.java b/awsapi/src/com/amazon/ec2/ImportVolumeResponse.java index dba5b99b473..b0fa49d9d6d 100644 --- a/awsapi/src/com/amazon/ec2/ImportVolumeResponse.java +++ b/awsapi/src/com/amazon/ec2/ImportVolumeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportVolumeResponse.java diff --git a/awsapi/src/com/amazon/ec2/ImportVolumeResponseType.java b/awsapi/src/com/amazon/ec2/ImportVolumeResponseType.java index 7c8d8b82a5f..29fc20f8105 100644 --- a/awsapi/src/com/amazon/ec2/ImportVolumeResponseType.java +++ b/awsapi/src/com/amazon/ec2/ImportVolumeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportVolumeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ImportVolumeTaskDetailsType.java b/awsapi/src/com/amazon/ec2/ImportVolumeTaskDetailsType.java index 96189e4889e..733aa6a02cd 100644 --- a/awsapi/src/com/amazon/ec2/ImportVolumeTaskDetailsType.java +++ b/awsapi/src/com/amazon/ec2/ImportVolumeTaskDetailsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportVolumeTaskDetailsType.java diff --git a/awsapi/src/com/amazon/ec2/ImportVolumeType.java b/awsapi/src/com/amazon/ec2/ImportVolumeType.java index d1d27f105e1..3ae9f20a881 100644 --- a/awsapi/src/com/amazon/ec2/ImportVolumeType.java +++ b/awsapi/src/com/amazon/ec2/ImportVolumeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ImportVolumeType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingItemType.java b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingItemType.java index 992dde05200..9f021e2b8d0 100644 --- a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingItemType.java +++ b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceBlockDeviceMappingItemType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingItemTypeChoice_type0.java b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingItemTypeChoice_type0.java index 4197431c07d..0ec66a07e5b 100644 --- a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingItemTypeChoice_type0.java +++ b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingItemTypeChoice_type0.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceBlockDeviceMappingItemTypeChoice_type0.java diff --git a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseItemType.java b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseItemType.java index ab5b977f642..80903afcdb5 100644 --- a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseItemType.java +++ b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceBlockDeviceMappingResponseItemType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseItemTypeChoice_type0.java b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseItemTypeChoice_type0.java index b585b28499c..d2faa432519 100644 --- a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseItemTypeChoice_type0.java +++ b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseItemTypeChoice_type0.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceBlockDeviceMappingResponseItemTypeChoice_type0.java diff --git a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseType.java b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseType.java index acd7d3949dc..d85afe5fdae 100644 --- a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseType.java +++ b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceBlockDeviceMappingResponseType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingType.java b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingType.java index 5f3e72bd1dc..294896de424 100644 --- a/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingType.java +++ b/awsapi/src/com/amazon/ec2/InstanceBlockDeviceMappingType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceBlockDeviceMappingType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceEbsBlockDeviceType.java b/awsapi/src/com/amazon/ec2/InstanceEbsBlockDeviceType.java index af5daff9f5a..4c234039d49 100644 --- a/awsapi/src/com/amazon/ec2/InstanceEbsBlockDeviceType.java +++ b/awsapi/src/com/amazon/ec2/InstanceEbsBlockDeviceType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceEbsBlockDeviceType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceIdSetType.java b/awsapi/src/com/amazon/ec2/InstanceIdSetType.java index 30dc6a6f480..cd861471f43 100644 --- a/awsapi/src/com/amazon/ec2/InstanceIdSetType.java +++ b/awsapi/src/com/amazon/ec2/InstanceIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceIdType.java b/awsapi/src/com/amazon/ec2/InstanceIdType.java index 3be42e17d2b..3aff3ab5779 100644 --- a/awsapi/src/com/amazon/ec2/InstanceIdType.java +++ b/awsapi/src/com/amazon/ec2/InstanceIdType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceIdType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceLicenseRequestType.java b/awsapi/src/com/amazon/ec2/InstanceLicenseRequestType.java index 6b4b15403f3..c4ce069d64b 100644 --- a/awsapi/src/com/amazon/ec2/InstanceLicenseRequestType.java +++ b/awsapi/src/com/amazon/ec2/InstanceLicenseRequestType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceLicenseRequestType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceLicenseResponseType.java b/awsapi/src/com/amazon/ec2/InstanceLicenseResponseType.java index 1ccdba82a15..b425a0f8e38 100644 --- a/awsapi/src/com/amazon/ec2/InstanceLicenseResponseType.java +++ b/awsapi/src/com/amazon/ec2/InstanceLicenseResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceLicenseResponseType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceMonitoringStateType.java b/awsapi/src/com/amazon/ec2/InstanceMonitoringStateType.java index f3fa8b99754..8a227a53b7d 100644 --- a/awsapi/src/com/amazon/ec2/InstanceMonitoringStateType.java +++ b/awsapi/src/com/amazon/ec2/InstanceMonitoringStateType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceMonitoringStateType.java diff --git a/awsapi/src/com/amazon/ec2/InstancePlacementType.java b/awsapi/src/com/amazon/ec2/InstancePlacementType.java index be134a1febf..3aa07ad471b 100644 --- a/awsapi/src/com/amazon/ec2/InstancePlacementType.java +++ b/awsapi/src/com/amazon/ec2/InstancePlacementType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstancePlacementType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceStateChangeSetType.java b/awsapi/src/com/amazon/ec2/InstanceStateChangeSetType.java index 1ccaa921eb4..9581462a3bd 100644 --- a/awsapi/src/com/amazon/ec2/InstanceStateChangeSetType.java +++ b/awsapi/src/com/amazon/ec2/InstanceStateChangeSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceStateChangeSetType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceStateChangeType.java b/awsapi/src/com/amazon/ec2/InstanceStateChangeType.java index 702ace52f88..c58efddd46a 100644 --- a/awsapi/src/com/amazon/ec2/InstanceStateChangeType.java +++ b/awsapi/src/com/amazon/ec2/InstanceStateChangeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceStateChangeType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceStateType.java b/awsapi/src/com/amazon/ec2/InstanceStateType.java index e4bf7872492..3edd17dcd73 100644 --- a/awsapi/src/com/amazon/ec2/InstanceStateType.java +++ b/awsapi/src/com/amazon/ec2/InstanceStateType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceStateType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceTypeSetItemType.java b/awsapi/src/com/amazon/ec2/InstanceTypeSetItemType.java index 6db8e7a2430..de5238b4e87 100644 --- a/awsapi/src/com/amazon/ec2/InstanceTypeSetItemType.java +++ b/awsapi/src/com/amazon/ec2/InstanceTypeSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceTypeSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/InstanceTypeSetType.java b/awsapi/src/com/amazon/ec2/InstanceTypeSetType.java index d5f8e53309c..a222b5a0da4 100644 --- a/awsapi/src/com/amazon/ec2/InstanceTypeSetType.java +++ b/awsapi/src/com/amazon/ec2/InstanceTypeSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * InstanceTypeSetType.java diff --git a/awsapi/src/com/amazon/ec2/IpPermissionSetType.java b/awsapi/src/com/amazon/ec2/IpPermissionSetType.java index 7b048d1ebe8..f98603a3ef5 100644 --- a/awsapi/src/com/amazon/ec2/IpPermissionSetType.java +++ b/awsapi/src/com/amazon/ec2/IpPermissionSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * IpPermissionSetType.java diff --git a/awsapi/src/com/amazon/ec2/IpPermissionType.java b/awsapi/src/com/amazon/ec2/IpPermissionType.java index 3e9ff69733e..5011d21643b 100644 --- a/awsapi/src/com/amazon/ec2/IpPermissionType.java +++ b/awsapi/src/com/amazon/ec2/IpPermissionType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * IpPermissionType.java diff --git a/awsapi/src/com/amazon/ec2/IpRangeItemType.java b/awsapi/src/com/amazon/ec2/IpRangeItemType.java index f449c36252b..7f4cf659f86 100644 --- a/awsapi/src/com/amazon/ec2/IpRangeItemType.java +++ b/awsapi/src/com/amazon/ec2/IpRangeItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * IpRangeItemType.java diff --git a/awsapi/src/com/amazon/ec2/IpRangeSetType.java b/awsapi/src/com/amazon/ec2/IpRangeSetType.java index 9f12c5fcb70..62a1af19148 100644 --- a/awsapi/src/com/amazon/ec2/IpRangeSetType.java +++ b/awsapi/src/com/amazon/ec2/IpRangeSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * IpRangeSetType.java diff --git a/awsapi/src/com/amazon/ec2/LaunchPermissionItemType.java b/awsapi/src/com/amazon/ec2/LaunchPermissionItemType.java index ef3a451d3af..c0989614855 100644 --- a/awsapi/src/com/amazon/ec2/LaunchPermissionItemType.java +++ b/awsapi/src/com/amazon/ec2/LaunchPermissionItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LaunchPermissionItemType.java diff --git a/awsapi/src/com/amazon/ec2/LaunchPermissionListType.java b/awsapi/src/com/amazon/ec2/LaunchPermissionListType.java index 638f344a7af..7cc946d53d5 100644 --- a/awsapi/src/com/amazon/ec2/LaunchPermissionListType.java +++ b/awsapi/src/com/amazon/ec2/LaunchPermissionListType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LaunchPermissionListType.java diff --git a/awsapi/src/com/amazon/ec2/LaunchPermissionOperationType.java b/awsapi/src/com/amazon/ec2/LaunchPermissionOperationType.java index 99f7a42f955..46bdae0db12 100644 --- a/awsapi/src/com/amazon/ec2/LaunchPermissionOperationType.java +++ b/awsapi/src/com/amazon/ec2/LaunchPermissionOperationType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LaunchPermissionOperationType.java diff --git a/awsapi/src/com/amazon/ec2/LaunchSpecificationRequestType.java b/awsapi/src/com/amazon/ec2/LaunchSpecificationRequestType.java index 8b581724757..3af9a31c9aa 100644 --- a/awsapi/src/com/amazon/ec2/LaunchSpecificationRequestType.java +++ b/awsapi/src/com/amazon/ec2/LaunchSpecificationRequestType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LaunchSpecificationRequestType.java diff --git a/awsapi/src/com/amazon/ec2/LaunchSpecificationResponseType.java b/awsapi/src/com/amazon/ec2/LaunchSpecificationResponseType.java index 00d4c3fc547..badf304bfb0 100644 --- a/awsapi/src/com/amazon/ec2/LaunchSpecificationResponseType.java +++ b/awsapi/src/com/amazon/ec2/LaunchSpecificationResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LaunchSpecificationResponseType.java diff --git a/awsapi/src/com/amazon/ec2/LicenseCapacitySetItemType.java b/awsapi/src/com/amazon/ec2/LicenseCapacitySetItemType.java index b93790897d3..ba52765c04a 100644 --- a/awsapi/src/com/amazon/ec2/LicenseCapacitySetItemType.java +++ b/awsapi/src/com/amazon/ec2/LicenseCapacitySetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LicenseCapacitySetItemType.java diff --git a/awsapi/src/com/amazon/ec2/LicenseCapacitySetType.java b/awsapi/src/com/amazon/ec2/LicenseCapacitySetType.java index ca24240cb43..a6ef4bc66bf 100644 --- a/awsapi/src/com/amazon/ec2/LicenseCapacitySetType.java +++ b/awsapi/src/com/amazon/ec2/LicenseCapacitySetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LicenseCapacitySetType.java diff --git a/awsapi/src/com/amazon/ec2/LicenseIdSetItemType.java b/awsapi/src/com/amazon/ec2/LicenseIdSetItemType.java index f6beee495af..a3136cfd5ab 100644 --- a/awsapi/src/com/amazon/ec2/LicenseIdSetItemType.java +++ b/awsapi/src/com/amazon/ec2/LicenseIdSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LicenseIdSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/LicenseIdSetType.java b/awsapi/src/com/amazon/ec2/LicenseIdSetType.java index 1abf5dec443..c88cbe495c0 100644 --- a/awsapi/src/com/amazon/ec2/LicenseIdSetType.java +++ b/awsapi/src/com/amazon/ec2/LicenseIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LicenseIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/LicenseSetItemType.java b/awsapi/src/com/amazon/ec2/LicenseSetItemType.java index 1666ae21faf..52ede20ec20 100644 --- a/awsapi/src/com/amazon/ec2/LicenseSetItemType.java +++ b/awsapi/src/com/amazon/ec2/LicenseSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LicenseSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/LicenseSetType.java b/awsapi/src/com/amazon/ec2/LicenseSetType.java index 0d453e221cf..b5add03919b 100644 --- a/awsapi/src/com/amazon/ec2/LicenseSetType.java +++ b/awsapi/src/com/amazon/ec2/LicenseSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * LicenseSetType.java diff --git a/awsapi/src/com/amazon/ec2/ModifyImageAttribute.java b/awsapi/src/com/amazon/ec2/ModifyImageAttribute.java index 32eadefa1af..14db8256865 100644 --- a/awsapi/src/com/amazon/ec2/ModifyImageAttribute.java +++ b/awsapi/src/com/amazon/ec2/ModifyImageAttribute.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifyImageAttribute.java diff --git a/awsapi/src/com/amazon/ec2/ModifyImageAttributeResponse.java b/awsapi/src/com/amazon/ec2/ModifyImageAttributeResponse.java index 3769d4d312d..2127ba655e9 100644 --- a/awsapi/src/com/amazon/ec2/ModifyImageAttributeResponse.java +++ b/awsapi/src/com/amazon/ec2/ModifyImageAttributeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifyImageAttributeResponse.java diff --git a/awsapi/src/com/amazon/ec2/ModifyImageAttributeResponseType.java b/awsapi/src/com/amazon/ec2/ModifyImageAttributeResponseType.java index b413a597409..45c959dd2ac 100644 --- a/awsapi/src/com/amazon/ec2/ModifyImageAttributeResponseType.java +++ b/awsapi/src/com/amazon/ec2/ModifyImageAttributeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifyImageAttributeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ModifyImageAttributeType.java b/awsapi/src/com/amazon/ec2/ModifyImageAttributeType.java index e3f028916d8..970f7e58ef7 100644 --- a/awsapi/src/com/amazon/ec2/ModifyImageAttributeType.java +++ b/awsapi/src/com/amazon/ec2/ModifyImageAttributeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifyImageAttributeType.java diff --git a/awsapi/src/com/amazon/ec2/ModifyImageAttributeTypeChoice_type0.java b/awsapi/src/com/amazon/ec2/ModifyImageAttributeTypeChoice_type0.java index a0431b565d8..6cd3ab7b541 100644 --- a/awsapi/src/com/amazon/ec2/ModifyImageAttributeTypeChoice_type0.java +++ b/awsapi/src/com/amazon/ec2/ModifyImageAttributeTypeChoice_type0.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifyImageAttributeTypeChoice_type0.java diff --git a/awsapi/src/com/amazon/ec2/ModifyInstanceAttribute.java b/awsapi/src/com/amazon/ec2/ModifyInstanceAttribute.java index 4debe21594e..b7b504cfdb7 100644 --- a/awsapi/src/com/amazon/ec2/ModifyInstanceAttribute.java +++ b/awsapi/src/com/amazon/ec2/ModifyInstanceAttribute.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifyInstanceAttribute.java diff --git a/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeResponse.java b/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeResponse.java index 8f202577851..ea7bd5d7803 100644 --- a/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeResponse.java +++ b/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifyInstanceAttributeResponse.java diff --git a/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeResponseType.java b/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeResponseType.java index e55c0206a13..f76476aaf0d 100644 --- a/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeResponseType.java +++ b/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifyInstanceAttributeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeType.java b/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeType.java index 6099b988137..85d76a01788 100644 --- a/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeType.java +++ b/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifyInstanceAttributeType.java diff --git a/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeTypeChoice_type0.java b/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeTypeChoice_type0.java index c892f1af685..23f80890e0f 100644 --- a/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeTypeChoice_type0.java +++ b/awsapi/src/com/amazon/ec2/ModifyInstanceAttributeTypeChoice_type0.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifyInstanceAttributeTypeChoice_type0.java diff --git a/awsapi/src/com/amazon/ec2/ModifySnapshotAttribute.java b/awsapi/src/com/amazon/ec2/ModifySnapshotAttribute.java index c644e699b33..1dc63d14d87 100644 --- a/awsapi/src/com/amazon/ec2/ModifySnapshotAttribute.java +++ b/awsapi/src/com/amazon/ec2/ModifySnapshotAttribute.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifySnapshotAttribute.java diff --git a/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeResponse.java b/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeResponse.java index 1874f54eaa9..44290a0e73f 100644 --- a/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeResponse.java +++ b/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifySnapshotAttributeResponse.java diff --git a/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeResponseType.java b/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeResponseType.java index 02c6f05b82f..b03460781f2 100644 --- a/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeResponseType.java +++ b/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifySnapshotAttributeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeType.java b/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeType.java index 18dfad3ee21..6ec05f25c1c 100644 --- a/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeType.java +++ b/awsapi/src/com/amazon/ec2/ModifySnapshotAttributeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ModifySnapshotAttributeType.java diff --git a/awsapi/src/com/amazon/ec2/MonitorInstances.java b/awsapi/src/com/amazon/ec2/MonitorInstances.java index 45b8bc64284..a668d775c47 100644 --- a/awsapi/src/com/amazon/ec2/MonitorInstances.java +++ b/awsapi/src/com/amazon/ec2/MonitorInstances.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * MonitorInstances.java diff --git a/awsapi/src/com/amazon/ec2/MonitorInstancesResponse.java b/awsapi/src/com/amazon/ec2/MonitorInstancesResponse.java index 98d6ab8e98b..818e7193a1d 100644 --- a/awsapi/src/com/amazon/ec2/MonitorInstancesResponse.java +++ b/awsapi/src/com/amazon/ec2/MonitorInstancesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * MonitorInstancesResponse.java diff --git a/awsapi/src/com/amazon/ec2/MonitorInstancesResponseSetItemType.java b/awsapi/src/com/amazon/ec2/MonitorInstancesResponseSetItemType.java index bee0e6d3c6b..379d31ba65b 100644 --- a/awsapi/src/com/amazon/ec2/MonitorInstancesResponseSetItemType.java +++ b/awsapi/src/com/amazon/ec2/MonitorInstancesResponseSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * MonitorInstancesResponseSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/MonitorInstancesResponseSetType.java b/awsapi/src/com/amazon/ec2/MonitorInstancesResponseSetType.java index bcccdac7294..3ca08b97068 100644 --- a/awsapi/src/com/amazon/ec2/MonitorInstancesResponseSetType.java +++ b/awsapi/src/com/amazon/ec2/MonitorInstancesResponseSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * MonitorInstancesResponseSetType.java diff --git a/awsapi/src/com/amazon/ec2/MonitorInstancesResponseType.java b/awsapi/src/com/amazon/ec2/MonitorInstancesResponseType.java index 785302522f3..aa92bf5ce00 100644 --- a/awsapi/src/com/amazon/ec2/MonitorInstancesResponseType.java +++ b/awsapi/src/com/amazon/ec2/MonitorInstancesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * MonitorInstancesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/MonitorInstancesSetItemType.java b/awsapi/src/com/amazon/ec2/MonitorInstancesSetItemType.java index 41cf94141cb..bc6a531d34e 100644 --- a/awsapi/src/com/amazon/ec2/MonitorInstancesSetItemType.java +++ b/awsapi/src/com/amazon/ec2/MonitorInstancesSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * MonitorInstancesSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/MonitorInstancesSetType.java b/awsapi/src/com/amazon/ec2/MonitorInstancesSetType.java index 1f09928c223..8699dd248a6 100644 --- a/awsapi/src/com/amazon/ec2/MonitorInstancesSetType.java +++ b/awsapi/src/com/amazon/ec2/MonitorInstancesSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * MonitorInstancesSetType.java diff --git a/awsapi/src/com/amazon/ec2/MonitorInstancesType.java b/awsapi/src/com/amazon/ec2/MonitorInstancesType.java index a3905e50c74..f7b941252b5 100644 --- a/awsapi/src/com/amazon/ec2/MonitorInstancesType.java +++ b/awsapi/src/com/amazon/ec2/MonitorInstancesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * MonitorInstancesType.java diff --git a/awsapi/src/com/amazon/ec2/MonitoringInstanceType.java b/awsapi/src/com/amazon/ec2/MonitoringInstanceType.java index d1763a6cc14..9311adc3fcf 100644 --- a/awsapi/src/com/amazon/ec2/MonitoringInstanceType.java +++ b/awsapi/src/com/amazon/ec2/MonitoringInstanceType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * MonitoringInstanceType.java diff --git a/awsapi/src/com/amazon/ec2/NullableAttributeBooleanValueType.java b/awsapi/src/com/amazon/ec2/NullableAttributeBooleanValueType.java index afa6906fd8b..dd9f620d604 100644 --- a/awsapi/src/com/amazon/ec2/NullableAttributeBooleanValueType.java +++ b/awsapi/src/com/amazon/ec2/NullableAttributeBooleanValueType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * NullableAttributeBooleanValueType.java diff --git a/awsapi/src/com/amazon/ec2/NullableAttributeValueType.java b/awsapi/src/com/amazon/ec2/NullableAttributeValueType.java index 7b9924e257a..3222ff21873 100644 --- a/awsapi/src/com/amazon/ec2/NullableAttributeValueType.java +++ b/awsapi/src/com/amazon/ec2/NullableAttributeValueType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * NullableAttributeValueType.java diff --git a/awsapi/src/com/amazon/ec2/PlacementGroupInfoType.java b/awsapi/src/com/amazon/ec2/PlacementGroupInfoType.java index 6730ab955b0..6754221522d 100644 --- a/awsapi/src/com/amazon/ec2/PlacementGroupInfoType.java +++ b/awsapi/src/com/amazon/ec2/PlacementGroupInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * PlacementGroupInfoType.java diff --git a/awsapi/src/com/amazon/ec2/PlacementGroupSetType.java b/awsapi/src/com/amazon/ec2/PlacementGroupSetType.java index 2aeffce2f38..759c0f1c799 100644 --- a/awsapi/src/com/amazon/ec2/PlacementGroupSetType.java +++ b/awsapi/src/com/amazon/ec2/PlacementGroupSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * PlacementGroupSetType.java diff --git a/awsapi/src/com/amazon/ec2/PlacementRequestType.java b/awsapi/src/com/amazon/ec2/PlacementRequestType.java index 45b99f08eb7..6a7da9ca3ac 100644 --- a/awsapi/src/com/amazon/ec2/PlacementRequestType.java +++ b/awsapi/src/com/amazon/ec2/PlacementRequestType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * PlacementRequestType.java diff --git a/awsapi/src/com/amazon/ec2/PlacementResponseType.java b/awsapi/src/com/amazon/ec2/PlacementResponseType.java index 481fc74c067..d711209f962 100644 --- a/awsapi/src/com/amazon/ec2/PlacementResponseType.java +++ b/awsapi/src/com/amazon/ec2/PlacementResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * PlacementResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ProductCodeItemType.java b/awsapi/src/com/amazon/ec2/ProductCodeItemType.java index a41204a771c..f8416ad6aff 100644 --- a/awsapi/src/com/amazon/ec2/ProductCodeItemType.java +++ b/awsapi/src/com/amazon/ec2/ProductCodeItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ProductCodeItemType.java diff --git a/awsapi/src/com/amazon/ec2/ProductCodeListType.java b/awsapi/src/com/amazon/ec2/ProductCodeListType.java index 0966c8cac29..bc0236b65f2 100644 --- a/awsapi/src/com/amazon/ec2/ProductCodeListType.java +++ b/awsapi/src/com/amazon/ec2/ProductCodeListType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ProductCodeListType.java diff --git a/awsapi/src/com/amazon/ec2/ProductCodeSetType.java b/awsapi/src/com/amazon/ec2/ProductCodeSetType.java index d3bc7c7ab8a..6fa6eed1b1a 100644 --- a/awsapi/src/com/amazon/ec2/ProductCodeSetType.java +++ b/awsapi/src/com/amazon/ec2/ProductCodeSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ProductCodeSetType.java diff --git a/awsapi/src/com/amazon/ec2/ProductCodeType.java b/awsapi/src/com/amazon/ec2/ProductCodeType.java index f7c2a69e627..b3a95b3e914 100644 --- a/awsapi/src/com/amazon/ec2/ProductCodeType.java +++ b/awsapi/src/com/amazon/ec2/ProductCodeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ProductCodeType.java diff --git a/awsapi/src/com/amazon/ec2/ProductCodesSetItemType.java b/awsapi/src/com/amazon/ec2/ProductCodesSetItemType.java index 37deebbea7f..30226248215 100644 --- a/awsapi/src/com/amazon/ec2/ProductCodesSetItemType.java +++ b/awsapi/src/com/amazon/ec2/ProductCodesSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ProductCodesSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/ProductCodesSetType.java b/awsapi/src/com/amazon/ec2/ProductCodesSetType.java index a63ff8ffc78..6b53b17351e 100644 --- a/awsapi/src/com/amazon/ec2/ProductCodesSetType.java +++ b/awsapi/src/com/amazon/ec2/ProductCodesSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ProductCodesSetType.java diff --git a/awsapi/src/com/amazon/ec2/ProductDescriptionSetItemType.java b/awsapi/src/com/amazon/ec2/ProductDescriptionSetItemType.java index f739fd20ff0..7697ffa964d 100644 --- a/awsapi/src/com/amazon/ec2/ProductDescriptionSetItemType.java +++ b/awsapi/src/com/amazon/ec2/ProductDescriptionSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ProductDescriptionSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/ProductDescriptionSetType.java b/awsapi/src/com/amazon/ec2/ProductDescriptionSetType.java index 6573f1ffd0d..fd5b501c63e 100644 --- a/awsapi/src/com/amazon/ec2/ProductDescriptionSetType.java +++ b/awsapi/src/com/amazon/ec2/ProductDescriptionSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ProductDescriptionSetType.java diff --git a/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOffering.java b/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOffering.java index 955812d30c5..cea191ad93e 100644 --- a/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOffering.java +++ b/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOffering.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * PurchaseReservedInstancesOffering.java diff --git a/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingResponse.java b/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingResponse.java index 56b3fbf60a4..4e8c8567659 100644 --- a/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingResponse.java +++ b/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * PurchaseReservedInstancesOfferingResponse.java diff --git a/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingResponseType.java b/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingResponseType.java index 8e22ccdc196..bfb29be875a 100644 --- a/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingResponseType.java +++ b/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * PurchaseReservedInstancesOfferingResponseType.java diff --git a/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingType.java b/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingType.java index f51aa52d3ba..e9a3ad5cc88 100644 --- a/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingType.java +++ b/awsapi/src/com/amazon/ec2/PurchaseReservedInstancesOfferingType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * PurchaseReservedInstancesOfferingType.java diff --git a/awsapi/src/com/amazon/ec2/RebootInstances.java b/awsapi/src/com/amazon/ec2/RebootInstances.java index f27574ed59f..d73e0d26011 100644 --- a/awsapi/src/com/amazon/ec2/RebootInstances.java +++ b/awsapi/src/com/amazon/ec2/RebootInstances.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RebootInstances.java diff --git a/awsapi/src/com/amazon/ec2/RebootInstancesInfoType.java b/awsapi/src/com/amazon/ec2/RebootInstancesInfoType.java index 1af93369e1e..ab3652ce2bc 100644 --- a/awsapi/src/com/amazon/ec2/RebootInstancesInfoType.java +++ b/awsapi/src/com/amazon/ec2/RebootInstancesInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RebootInstancesInfoType.java diff --git a/awsapi/src/com/amazon/ec2/RebootInstancesItemType.java b/awsapi/src/com/amazon/ec2/RebootInstancesItemType.java index 5af351055bb..3cbfd76ce1c 100644 --- a/awsapi/src/com/amazon/ec2/RebootInstancesItemType.java +++ b/awsapi/src/com/amazon/ec2/RebootInstancesItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RebootInstancesItemType.java diff --git a/awsapi/src/com/amazon/ec2/RebootInstancesResponse.java b/awsapi/src/com/amazon/ec2/RebootInstancesResponse.java index 4308380aa5a..e6bb6f8e8fe 100644 --- a/awsapi/src/com/amazon/ec2/RebootInstancesResponse.java +++ b/awsapi/src/com/amazon/ec2/RebootInstancesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RebootInstancesResponse.java diff --git a/awsapi/src/com/amazon/ec2/RebootInstancesResponseType.java b/awsapi/src/com/amazon/ec2/RebootInstancesResponseType.java index 9431ec67b07..1dd6c58445f 100644 --- a/awsapi/src/com/amazon/ec2/RebootInstancesResponseType.java +++ b/awsapi/src/com/amazon/ec2/RebootInstancesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RebootInstancesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/RebootInstancesType.java b/awsapi/src/com/amazon/ec2/RebootInstancesType.java index b8a0f82e516..9eada489420 100644 --- a/awsapi/src/com/amazon/ec2/RebootInstancesType.java +++ b/awsapi/src/com/amazon/ec2/RebootInstancesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RebootInstancesType.java diff --git a/awsapi/src/com/amazon/ec2/RegionItemType.java b/awsapi/src/com/amazon/ec2/RegionItemType.java index cebbc54245d..ea7648d6c66 100644 --- a/awsapi/src/com/amazon/ec2/RegionItemType.java +++ b/awsapi/src/com/amazon/ec2/RegionItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RegionItemType.java diff --git a/awsapi/src/com/amazon/ec2/RegionSetType.java b/awsapi/src/com/amazon/ec2/RegionSetType.java index 6f2e190ecc6..f66f83d50be 100644 --- a/awsapi/src/com/amazon/ec2/RegionSetType.java +++ b/awsapi/src/com/amazon/ec2/RegionSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RegionSetType.java diff --git a/awsapi/src/com/amazon/ec2/RegisterImage.java b/awsapi/src/com/amazon/ec2/RegisterImage.java index fce8860df0b..25ce00d8c54 100644 --- a/awsapi/src/com/amazon/ec2/RegisterImage.java +++ b/awsapi/src/com/amazon/ec2/RegisterImage.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RegisterImage.java diff --git a/awsapi/src/com/amazon/ec2/RegisterImageResponse.java b/awsapi/src/com/amazon/ec2/RegisterImageResponse.java index 6cc67b1bbf4..8e33d08c996 100644 --- a/awsapi/src/com/amazon/ec2/RegisterImageResponse.java +++ b/awsapi/src/com/amazon/ec2/RegisterImageResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RegisterImageResponse.java diff --git a/awsapi/src/com/amazon/ec2/RegisterImageResponseType.java b/awsapi/src/com/amazon/ec2/RegisterImageResponseType.java index e3b093b9d3d..db5d35604a1 100644 --- a/awsapi/src/com/amazon/ec2/RegisterImageResponseType.java +++ b/awsapi/src/com/amazon/ec2/RegisterImageResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RegisterImageResponseType.java diff --git a/awsapi/src/com/amazon/ec2/RegisterImageType.java b/awsapi/src/com/amazon/ec2/RegisterImageType.java index 85f32a97881..e86684c75bc 100644 --- a/awsapi/src/com/amazon/ec2/RegisterImageType.java +++ b/awsapi/src/com/amazon/ec2/RegisterImageType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RegisterImageType.java diff --git a/awsapi/src/com/amazon/ec2/ReleaseAddress.java b/awsapi/src/com/amazon/ec2/ReleaseAddress.java index 123167b92af..ce0ca3f13ca 100644 --- a/awsapi/src/com/amazon/ec2/ReleaseAddress.java +++ b/awsapi/src/com/amazon/ec2/ReleaseAddress.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ReleaseAddress.java diff --git a/awsapi/src/com/amazon/ec2/ReleaseAddressResponse.java b/awsapi/src/com/amazon/ec2/ReleaseAddressResponse.java index 4c385ea5f7f..5c19edfa0f7 100644 --- a/awsapi/src/com/amazon/ec2/ReleaseAddressResponse.java +++ b/awsapi/src/com/amazon/ec2/ReleaseAddressResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ReleaseAddressResponse.java diff --git a/awsapi/src/com/amazon/ec2/ReleaseAddressResponseType.java b/awsapi/src/com/amazon/ec2/ReleaseAddressResponseType.java index d797e9eebfe..69ebd738c9e 100644 --- a/awsapi/src/com/amazon/ec2/ReleaseAddressResponseType.java +++ b/awsapi/src/com/amazon/ec2/ReleaseAddressResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ReleaseAddressResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ReleaseAddressType.java b/awsapi/src/com/amazon/ec2/ReleaseAddressType.java index a04d21fa748..59c38d1da74 100644 --- a/awsapi/src/com/amazon/ec2/ReleaseAddressType.java +++ b/awsapi/src/com/amazon/ec2/ReleaseAddressType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ReleaseAddressType.java diff --git a/awsapi/src/com/amazon/ec2/RequestSpotInstances.java b/awsapi/src/com/amazon/ec2/RequestSpotInstances.java index 56f3877488e..659cc02dc2c 100644 --- a/awsapi/src/com/amazon/ec2/RequestSpotInstances.java +++ b/awsapi/src/com/amazon/ec2/RequestSpotInstances.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RequestSpotInstances.java diff --git a/awsapi/src/com/amazon/ec2/RequestSpotInstancesResponse.java b/awsapi/src/com/amazon/ec2/RequestSpotInstancesResponse.java index eb7c736c3c8..7eedeb1a1bc 100644 --- a/awsapi/src/com/amazon/ec2/RequestSpotInstancesResponse.java +++ b/awsapi/src/com/amazon/ec2/RequestSpotInstancesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RequestSpotInstancesResponse.java diff --git a/awsapi/src/com/amazon/ec2/RequestSpotInstancesResponseType.java b/awsapi/src/com/amazon/ec2/RequestSpotInstancesResponseType.java index c810d62bbff..87b49e3929f 100644 --- a/awsapi/src/com/amazon/ec2/RequestSpotInstancesResponseType.java +++ b/awsapi/src/com/amazon/ec2/RequestSpotInstancesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RequestSpotInstancesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/RequestSpotInstancesType.java b/awsapi/src/com/amazon/ec2/RequestSpotInstancesType.java index f928ce27e79..d509151697b 100644 --- a/awsapi/src/com/amazon/ec2/RequestSpotInstancesType.java +++ b/awsapi/src/com/amazon/ec2/RequestSpotInstancesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RequestSpotInstancesType.java diff --git a/awsapi/src/com/amazon/ec2/ReservationInfoType.java b/awsapi/src/com/amazon/ec2/ReservationInfoType.java index 3c30a42cfb0..63d8cacc0ef 100644 --- a/awsapi/src/com/amazon/ec2/ReservationInfoType.java +++ b/awsapi/src/com/amazon/ec2/ReservationInfoType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ReservationInfoType.java diff --git a/awsapi/src/com/amazon/ec2/ReservationSetType.java b/awsapi/src/com/amazon/ec2/ReservationSetType.java index bdb312c801c..a1b34725663 100644 --- a/awsapi/src/com/amazon/ec2/ReservationSetType.java +++ b/awsapi/src/com/amazon/ec2/ReservationSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ReservationSetType.java diff --git a/awsapi/src/com/amazon/ec2/ResetImageAttribute.java b/awsapi/src/com/amazon/ec2/ResetImageAttribute.java index f832e30c32d..13d7fc5242d 100644 --- a/awsapi/src/com/amazon/ec2/ResetImageAttribute.java +++ b/awsapi/src/com/amazon/ec2/ResetImageAttribute.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetImageAttribute.java diff --git a/awsapi/src/com/amazon/ec2/ResetImageAttributeResponse.java b/awsapi/src/com/amazon/ec2/ResetImageAttributeResponse.java index baf2a39f78c..dba0350e3ae 100644 --- a/awsapi/src/com/amazon/ec2/ResetImageAttributeResponse.java +++ b/awsapi/src/com/amazon/ec2/ResetImageAttributeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetImageAttributeResponse.java diff --git a/awsapi/src/com/amazon/ec2/ResetImageAttributeResponseType.java b/awsapi/src/com/amazon/ec2/ResetImageAttributeResponseType.java index 07c4f4cf387..e46e8ccdd8b 100644 --- a/awsapi/src/com/amazon/ec2/ResetImageAttributeResponseType.java +++ b/awsapi/src/com/amazon/ec2/ResetImageAttributeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetImageAttributeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ResetImageAttributeType.java b/awsapi/src/com/amazon/ec2/ResetImageAttributeType.java index 50efdaf50ee..69a0ba40df4 100644 --- a/awsapi/src/com/amazon/ec2/ResetImageAttributeType.java +++ b/awsapi/src/com/amazon/ec2/ResetImageAttributeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetImageAttributeType.java diff --git a/awsapi/src/com/amazon/ec2/ResetImageAttributesGroup.java b/awsapi/src/com/amazon/ec2/ResetImageAttributesGroup.java index 046462707a8..672bcc50545 100644 --- a/awsapi/src/com/amazon/ec2/ResetImageAttributesGroup.java +++ b/awsapi/src/com/amazon/ec2/ResetImageAttributesGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetImageAttributesGroup.java diff --git a/awsapi/src/com/amazon/ec2/ResetInstanceAttribute.java b/awsapi/src/com/amazon/ec2/ResetInstanceAttribute.java index 0f6b5225bee..631ae22b22c 100644 --- a/awsapi/src/com/amazon/ec2/ResetInstanceAttribute.java +++ b/awsapi/src/com/amazon/ec2/ResetInstanceAttribute.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetInstanceAttribute.java diff --git a/awsapi/src/com/amazon/ec2/ResetInstanceAttributeResponse.java b/awsapi/src/com/amazon/ec2/ResetInstanceAttributeResponse.java index c85bb85b973..2b7064d3824 100644 --- a/awsapi/src/com/amazon/ec2/ResetInstanceAttributeResponse.java +++ b/awsapi/src/com/amazon/ec2/ResetInstanceAttributeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetInstanceAttributeResponse.java diff --git a/awsapi/src/com/amazon/ec2/ResetInstanceAttributeResponseType.java b/awsapi/src/com/amazon/ec2/ResetInstanceAttributeResponseType.java index ae9b268d921..5acdc85817b 100644 --- a/awsapi/src/com/amazon/ec2/ResetInstanceAttributeResponseType.java +++ b/awsapi/src/com/amazon/ec2/ResetInstanceAttributeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetInstanceAttributeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ResetInstanceAttributeType.java b/awsapi/src/com/amazon/ec2/ResetInstanceAttributeType.java index f05d07d5d5f..197065daf18 100644 --- a/awsapi/src/com/amazon/ec2/ResetInstanceAttributeType.java +++ b/awsapi/src/com/amazon/ec2/ResetInstanceAttributeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetInstanceAttributeType.java diff --git a/awsapi/src/com/amazon/ec2/ResetInstanceAttributesGroup.java b/awsapi/src/com/amazon/ec2/ResetInstanceAttributesGroup.java index b7ce6ab1b03..169e692626c 100644 --- a/awsapi/src/com/amazon/ec2/ResetInstanceAttributesGroup.java +++ b/awsapi/src/com/amazon/ec2/ResetInstanceAttributesGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetInstanceAttributesGroup.java diff --git a/awsapi/src/com/amazon/ec2/ResetSnapshotAttribute.java b/awsapi/src/com/amazon/ec2/ResetSnapshotAttribute.java index 27217aff819..238e1e2d95a 100644 --- a/awsapi/src/com/amazon/ec2/ResetSnapshotAttribute.java +++ b/awsapi/src/com/amazon/ec2/ResetSnapshotAttribute.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetSnapshotAttribute.java diff --git a/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeResponse.java b/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeResponse.java index 5c8ab9dc1f5..2e467c190de 100644 --- a/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeResponse.java +++ b/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetSnapshotAttributeResponse.java diff --git a/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeResponseType.java b/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeResponseType.java index f8d95668e2c..4016549dde9 100644 --- a/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeResponseType.java +++ b/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetSnapshotAttributeResponseType.java diff --git a/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeType.java b/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeType.java index 83dd67b2c10..4c808e05601 100644 --- a/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeType.java +++ b/awsapi/src/com/amazon/ec2/ResetSnapshotAttributeType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetSnapshotAttributeType.java diff --git a/awsapi/src/com/amazon/ec2/ResetSnapshotAttributesGroup.java b/awsapi/src/com/amazon/ec2/ResetSnapshotAttributesGroup.java index c71983b7e19..d49fe2abff8 100644 --- a/awsapi/src/com/amazon/ec2/ResetSnapshotAttributesGroup.java +++ b/awsapi/src/com/amazon/ec2/ResetSnapshotAttributesGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResetSnapshotAttributesGroup.java diff --git a/awsapi/src/com/amazon/ec2/ResourceIdSetItemType.java b/awsapi/src/com/amazon/ec2/ResourceIdSetItemType.java index aee3d4a511c..73c7af47934 100644 --- a/awsapi/src/com/amazon/ec2/ResourceIdSetItemType.java +++ b/awsapi/src/com/amazon/ec2/ResourceIdSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResourceIdSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/ResourceIdSetType.java b/awsapi/src/com/amazon/ec2/ResourceIdSetType.java index 9dacdab5ff5..d6120c194be 100644 --- a/awsapi/src/com/amazon/ec2/ResourceIdSetType.java +++ b/awsapi/src/com/amazon/ec2/ResourceIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResourceIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/ResourceTagSetItemType.java b/awsapi/src/com/amazon/ec2/ResourceTagSetItemType.java index 98ee2f06988..8513f545af5 100644 --- a/awsapi/src/com/amazon/ec2/ResourceTagSetItemType.java +++ b/awsapi/src/com/amazon/ec2/ResourceTagSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResourceTagSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/ResourceTagSetType.java b/awsapi/src/com/amazon/ec2/ResourceTagSetType.java index 5b54c4855da..67ae9091e17 100644 --- a/awsapi/src/com/amazon/ec2/ResourceTagSetType.java +++ b/awsapi/src/com/amazon/ec2/ResourceTagSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ResourceTagSetType.java diff --git a/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngress.java b/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngress.java index 9b94b7acc37..b1a5d554b8d 100644 --- a/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngress.java +++ b/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngress.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RevokeSecurityGroupIngress.java diff --git a/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressResponse.java b/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressResponse.java index 1cd6ddaf1f6..a9ff378ac82 100644 --- a/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressResponse.java +++ b/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RevokeSecurityGroupIngressResponse.java diff --git a/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressResponseType.java b/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressResponseType.java index a99cb76ea9c..73cb48458f5 100644 --- a/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressResponseType.java +++ b/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RevokeSecurityGroupIngressResponseType.java diff --git a/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressType.java b/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressType.java index beed48526b9..ec161a2f2b5 100644 --- a/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressType.java +++ b/awsapi/src/com/amazon/ec2/RevokeSecurityGroupIngressType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RevokeSecurityGroupIngressType.java diff --git a/awsapi/src/com/amazon/ec2/RunInstances.java b/awsapi/src/com/amazon/ec2/RunInstances.java index 6445b984767..41fae058e1e 100644 --- a/awsapi/src/com/amazon/ec2/RunInstances.java +++ b/awsapi/src/com/amazon/ec2/RunInstances.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RunInstances.java diff --git a/awsapi/src/com/amazon/ec2/RunInstancesResponse.java b/awsapi/src/com/amazon/ec2/RunInstancesResponse.java index 09a23bb2e88..8a4fcd2bc71 100644 --- a/awsapi/src/com/amazon/ec2/RunInstancesResponse.java +++ b/awsapi/src/com/amazon/ec2/RunInstancesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RunInstancesResponse.java diff --git a/awsapi/src/com/amazon/ec2/RunInstancesResponseType.java b/awsapi/src/com/amazon/ec2/RunInstancesResponseType.java index a93d56cbcb8..9aaf87b3453 100644 --- a/awsapi/src/com/amazon/ec2/RunInstancesResponseType.java +++ b/awsapi/src/com/amazon/ec2/RunInstancesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RunInstancesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/RunInstancesType.java b/awsapi/src/com/amazon/ec2/RunInstancesType.java index 1884100bdab..52be051191d 100644 --- a/awsapi/src/com/amazon/ec2/RunInstancesType.java +++ b/awsapi/src/com/amazon/ec2/RunInstancesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RunInstancesType.java diff --git a/awsapi/src/com/amazon/ec2/RunningInstancesItemType.java b/awsapi/src/com/amazon/ec2/RunningInstancesItemType.java index b19925cea35..43ded4a4fce 100644 --- a/awsapi/src/com/amazon/ec2/RunningInstancesItemType.java +++ b/awsapi/src/com/amazon/ec2/RunningInstancesItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RunningInstancesItemType.java diff --git a/awsapi/src/com/amazon/ec2/RunningInstancesSetType.java b/awsapi/src/com/amazon/ec2/RunningInstancesSetType.java index 0a487c4add2..b980ba046eb 100644 --- a/awsapi/src/com/amazon/ec2/RunningInstancesSetType.java +++ b/awsapi/src/com/amazon/ec2/RunningInstancesSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * RunningInstancesSetType.java diff --git a/awsapi/src/com/amazon/ec2/SecurityGroupItemType.java b/awsapi/src/com/amazon/ec2/SecurityGroupItemType.java index b6baa46281a..6b52d7495d4 100644 --- a/awsapi/src/com/amazon/ec2/SecurityGroupItemType.java +++ b/awsapi/src/com/amazon/ec2/SecurityGroupItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SecurityGroupItemType.java diff --git a/awsapi/src/com/amazon/ec2/SecurityGroupSetType.java b/awsapi/src/com/amazon/ec2/SecurityGroupSetType.java index 2dfad954330..08080dbcbc4 100644 --- a/awsapi/src/com/amazon/ec2/SecurityGroupSetType.java +++ b/awsapi/src/com/amazon/ec2/SecurityGroupSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SecurityGroupSetType.java diff --git a/awsapi/src/com/amazon/ec2/SpotDatafeedSubscriptionType.java b/awsapi/src/com/amazon/ec2/SpotDatafeedSubscriptionType.java index ed7b8a7d17e..8b60fc1fb49 100644 --- a/awsapi/src/com/amazon/ec2/SpotDatafeedSubscriptionType.java +++ b/awsapi/src/com/amazon/ec2/SpotDatafeedSubscriptionType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SpotDatafeedSubscriptionType.java diff --git a/awsapi/src/com/amazon/ec2/SpotInstanceRequestIdSetItemType.java b/awsapi/src/com/amazon/ec2/SpotInstanceRequestIdSetItemType.java index ce7ca62e796..72516d389bf 100644 --- a/awsapi/src/com/amazon/ec2/SpotInstanceRequestIdSetItemType.java +++ b/awsapi/src/com/amazon/ec2/SpotInstanceRequestIdSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SpotInstanceRequestIdSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/SpotInstanceRequestIdSetType.java b/awsapi/src/com/amazon/ec2/SpotInstanceRequestIdSetType.java index 77baa9b164d..4ef4e6d442b 100644 --- a/awsapi/src/com/amazon/ec2/SpotInstanceRequestIdSetType.java +++ b/awsapi/src/com/amazon/ec2/SpotInstanceRequestIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SpotInstanceRequestIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/SpotInstanceRequestSetItemType.java b/awsapi/src/com/amazon/ec2/SpotInstanceRequestSetItemType.java index 413f1dd550c..d5cad689f7a 100644 --- a/awsapi/src/com/amazon/ec2/SpotInstanceRequestSetItemType.java +++ b/awsapi/src/com/amazon/ec2/SpotInstanceRequestSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SpotInstanceRequestSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/SpotInstanceRequestSetType.java b/awsapi/src/com/amazon/ec2/SpotInstanceRequestSetType.java index 0e87bce3f90..d7e100fe96f 100644 --- a/awsapi/src/com/amazon/ec2/SpotInstanceRequestSetType.java +++ b/awsapi/src/com/amazon/ec2/SpotInstanceRequestSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SpotInstanceRequestSetType.java diff --git a/awsapi/src/com/amazon/ec2/SpotInstanceStateFaultType.java b/awsapi/src/com/amazon/ec2/SpotInstanceStateFaultType.java index aaed6177046..a289eef27d8 100644 --- a/awsapi/src/com/amazon/ec2/SpotInstanceStateFaultType.java +++ b/awsapi/src/com/amazon/ec2/SpotInstanceStateFaultType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SpotInstanceStateFaultType.java diff --git a/awsapi/src/com/amazon/ec2/SpotPriceHistorySetItemType.java b/awsapi/src/com/amazon/ec2/SpotPriceHistorySetItemType.java index 82813e032d9..bc1cd30f5e5 100644 --- a/awsapi/src/com/amazon/ec2/SpotPriceHistorySetItemType.java +++ b/awsapi/src/com/amazon/ec2/SpotPriceHistorySetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SpotPriceHistorySetItemType.java diff --git a/awsapi/src/com/amazon/ec2/SpotPriceHistorySetType.java b/awsapi/src/com/amazon/ec2/SpotPriceHistorySetType.java index 1ee9b163138..d217f1199e7 100644 --- a/awsapi/src/com/amazon/ec2/SpotPriceHistorySetType.java +++ b/awsapi/src/com/amazon/ec2/SpotPriceHistorySetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SpotPriceHistorySetType.java diff --git a/awsapi/src/com/amazon/ec2/StartInstances.java b/awsapi/src/com/amazon/ec2/StartInstances.java index 58ee2424639..d232e32d76d 100644 --- a/awsapi/src/com/amazon/ec2/StartInstances.java +++ b/awsapi/src/com/amazon/ec2/StartInstances.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * StartInstances.java diff --git a/awsapi/src/com/amazon/ec2/StartInstancesResponse.java b/awsapi/src/com/amazon/ec2/StartInstancesResponse.java index d60da9cf13e..540bba7c76b 100644 --- a/awsapi/src/com/amazon/ec2/StartInstancesResponse.java +++ b/awsapi/src/com/amazon/ec2/StartInstancesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * StartInstancesResponse.java diff --git a/awsapi/src/com/amazon/ec2/StartInstancesResponseType.java b/awsapi/src/com/amazon/ec2/StartInstancesResponseType.java index 53b9594476e..72ed38de44c 100644 --- a/awsapi/src/com/amazon/ec2/StartInstancesResponseType.java +++ b/awsapi/src/com/amazon/ec2/StartInstancesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * StartInstancesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/StartInstancesType.java b/awsapi/src/com/amazon/ec2/StartInstancesType.java index 48d69561f49..865fd2354d9 100644 --- a/awsapi/src/com/amazon/ec2/StartInstancesType.java +++ b/awsapi/src/com/amazon/ec2/StartInstancesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * StartInstancesType.java diff --git a/awsapi/src/com/amazon/ec2/StateReasonType.java b/awsapi/src/com/amazon/ec2/StateReasonType.java index 53210fd0fc9..902ab07a8df 100644 --- a/awsapi/src/com/amazon/ec2/StateReasonType.java +++ b/awsapi/src/com/amazon/ec2/StateReasonType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * StateReasonType.java diff --git a/awsapi/src/com/amazon/ec2/StopInstances.java b/awsapi/src/com/amazon/ec2/StopInstances.java index 57be1f71c1d..a0557ca4d0a 100644 --- a/awsapi/src/com/amazon/ec2/StopInstances.java +++ b/awsapi/src/com/amazon/ec2/StopInstances.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * StopInstances.java diff --git a/awsapi/src/com/amazon/ec2/StopInstancesResponse.java b/awsapi/src/com/amazon/ec2/StopInstancesResponse.java index eba71716fb5..1adc7a94a34 100644 --- a/awsapi/src/com/amazon/ec2/StopInstancesResponse.java +++ b/awsapi/src/com/amazon/ec2/StopInstancesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * StopInstancesResponse.java diff --git a/awsapi/src/com/amazon/ec2/StopInstancesResponseType.java b/awsapi/src/com/amazon/ec2/StopInstancesResponseType.java index 35b93209c06..7d65c8dbbbb 100644 --- a/awsapi/src/com/amazon/ec2/StopInstancesResponseType.java +++ b/awsapi/src/com/amazon/ec2/StopInstancesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * StopInstancesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/StopInstancesType.java b/awsapi/src/com/amazon/ec2/StopInstancesType.java index 0f6182cbabc..ba4831d571e 100644 --- a/awsapi/src/com/amazon/ec2/StopInstancesType.java +++ b/awsapi/src/com/amazon/ec2/StopInstancesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * StopInstancesType.java diff --git a/awsapi/src/com/amazon/ec2/SubnetIdSetItemType.java b/awsapi/src/com/amazon/ec2/SubnetIdSetItemType.java index 22afe7def69..b53e9dbd841 100644 --- a/awsapi/src/com/amazon/ec2/SubnetIdSetItemType.java +++ b/awsapi/src/com/amazon/ec2/SubnetIdSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SubnetIdSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/SubnetIdSetType.java b/awsapi/src/com/amazon/ec2/SubnetIdSetType.java index f9b54a07a4b..2901e3d79b0 100644 --- a/awsapi/src/com/amazon/ec2/SubnetIdSetType.java +++ b/awsapi/src/com/amazon/ec2/SubnetIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SubnetIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/SubnetSetType.java b/awsapi/src/com/amazon/ec2/SubnetSetType.java index 516f5ad5b8d..f940006a606 100644 --- a/awsapi/src/com/amazon/ec2/SubnetSetType.java +++ b/awsapi/src/com/amazon/ec2/SubnetSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SubnetSetType.java diff --git a/awsapi/src/com/amazon/ec2/SubnetType.java b/awsapi/src/com/amazon/ec2/SubnetType.java index 03e69e45427..dbf632ab2ab 100644 --- a/awsapi/src/com/amazon/ec2/SubnetType.java +++ b/awsapi/src/com/amazon/ec2/SubnetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * SubnetType.java diff --git a/awsapi/src/com/amazon/ec2/TagSetItemType.java b/awsapi/src/com/amazon/ec2/TagSetItemType.java index b992375e9d6..946fe58118c 100644 --- a/awsapi/src/com/amazon/ec2/TagSetItemType.java +++ b/awsapi/src/com/amazon/ec2/TagSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * TagSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/TagSetType.java b/awsapi/src/com/amazon/ec2/TagSetType.java index 5e9675423a7..b9e606082df 100644 --- a/awsapi/src/com/amazon/ec2/TagSetType.java +++ b/awsapi/src/com/amazon/ec2/TagSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * TagSetType.java diff --git a/awsapi/src/com/amazon/ec2/TerminateInstances.java b/awsapi/src/com/amazon/ec2/TerminateInstances.java index 59752138959..8d8df25de58 100644 --- a/awsapi/src/com/amazon/ec2/TerminateInstances.java +++ b/awsapi/src/com/amazon/ec2/TerminateInstances.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * TerminateInstances.java diff --git a/awsapi/src/com/amazon/ec2/TerminateInstancesResponse.java b/awsapi/src/com/amazon/ec2/TerminateInstancesResponse.java index 30b2f2d4db3..252c38c549e 100644 --- a/awsapi/src/com/amazon/ec2/TerminateInstancesResponse.java +++ b/awsapi/src/com/amazon/ec2/TerminateInstancesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * TerminateInstancesResponse.java diff --git a/awsapi/src/com/amazon/ec2/TerminateInstancesResponseType.java b/awsapi/src/com/amazon/ec2/TerminateInstancesResponseType.java index 6e17078aa23..2bf4c2fbabb 100644 --- a/awsapi/src/com/amazon/ec2/TerminateInstancesResponseType.java +++ b/awsapi/src/com/amazon/ec2/TerminateInstancesResponseType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * TerminateInstancesResponseType.java diff --git a/awsapi/src/com/amazon/ec2/TerminateInstancesType.java b/awsapi/src/com/amazon/ec2/TerminateInstancesType.java index 677c1b027a8..143f665a732 100644 --- a/awsapi/src/com/amazon/ec2/TerminateInstancesType.java +++ b/awsapi/src/com/amazon/ec2/TerminateInstancesType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * TerminateInstancesType.java diff --git a/awsapi/src/com/amazon/ec2/UnmonitorInstances.java b/awsapi/src/com/amazon/ec2/UnmonitorInstances.java index c5228661bfa..a60c94d89de 100644 --- a/awsapi/src/com/amazon/ec2/UnmonitorInstances.java +++ b/awsapi/src/com/amazon/ec2/UnmonitorInstances.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * UnmonitorInstances.java diff --git a/awsapi/src/com/amazon/ec2/UnmonitorInstancesResponse.java b/awsapi/src/com/amazon/ec2/UnmonitorInstancesResponse.java index 5965fc5bd57..2e0532dfdac 100644 --- a/awsapi/src/com/amazon/ec2/UnmonitorInstancesResponse.java +++ b/awsapi/src/com/amazon/ec2/UnmonitorInstancesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * UnmonitorInstancesResponse.java diff --git a/awsapi/src/com/amazon/ec2/UserDataType.java b/awsapi/src/com/amazon/ec2/UserDataType.java index d8e36b4d2e1..d250161caef 100644 --- a/awsapi/src/com/amazon/ec2/UserDataType.java +++ b/awsapi/src/com/amazon/ec2/UserDataType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * UserDataType.java diff --git a/awsapi/src/com/amazon/ec2/UserIdGroupPairSetType.java b/awsapi/src/com/amazon/ec2/UserIdGroupPairSetType.java index 5fea24682e0..8d8bde5c3c2 100644 --- a/awsapi/src/com/amazon/ec2/UserIdGroupPairSetType.java +++ b/awsapi/src/com/amazon/ec2/UserIdGroupPairSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * UserIdGroupPairSetType.java diff --git a/awsapi/src/com/amazon/ec2/UserIdGroupPairType.java b/awsapi/src/com/amazon/ec2/UserIdGroupPairType.java index c266a0f12c8..7938f4927d5 100644 --- a/awsapi/src/com/amazon/ec2/UserIdGroupPairType.java +++ b/awsapi/src/com/amazon/ec2/UserIdGroupPairType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * UserIdGroupPairType.java diff --git a/awsapi/src/com/amazon/ec2/ValueSetType.java b/awsapi/src/com/amazon/ec2/ValueSetType.java index 71b3b415be9..6fcd854c538 100644 --- a/awsapi/src/com/amazon/ec2/ValueSetType.java +++ b/awsapi/src/com/amazon/ec2/ValueSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ValueSetType.java diff --git a/awsapi/src/com/amazon/ec2/ValueType.java b/awsapi/src/com/amazon/ec2/ValueType.java index b123f7a40f5..457e4177726 100644 --- a/awsapi/src/com/amazon/ec2/ValueType.java +++ b/awsapi/src/com/amazon/ec2/ValueType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * ValueType.java diff --git a/awsapi/src/com/amazon/ec2/VpcIdSetItemType.java b/awsapi/src/com/amazon/ec2/VpcIdSetItemType.java index a3d50290571..b0703cee81f 100644 --- a/awsapi/src/com/amazon/ec2/VpcIdSetItemType.java +++ b/awsapi/src/com/amazon/ec2/VpcIdSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpcIdSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/VpcIdSetType.java b/awsapi/src/com/amazon/ec2/VpcIdSetType.java index 0c23aa0437d..3629518ebbf 100644 --- a/awsapi/src/com/amazon/ec2/VpcIdSetType.java +++ b/awsapi/src/com/amazon/ec2/VpcIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpcIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/VpcSetType.java b/awsapi/src/com/amazon/ec2/VpcSetType.java index 57116f1f6b9..3388e9b80c5 100644 --- a/awsapi/src/com/amazon/ec2/VpcSetType.java +++ b/awsapi/src/com/amazon/ec2/VpcSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpcSetType.java diff --git a/awsapi/src/com/amazon/ec2/VpcType.java b/awsapi/src/com/amazon/ec2/VpcType.java index e2f26109894..8bf591434ec 100644 --- a/awsapi/src/com/amazon/ec2/VpcType.java +++ b/awsapi/src/com/amazon/ec2/VpcType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpcType.java diff --git a/awsapi/src/com/amazon/ec2/VpnConnectionIdSetItemType.java b/awsapi/src/com/amazon/ec2/VpnConnectionIdSetItemType.java index 781734f71ee..198f4be775a 100644 --- a/awsapi/src/com/amazon/ec2/VpnConnectionIdSetItemType.java +++ b/awsapi/src/com/amazon/ec2/VpnConnectionIdSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpnConnectionIdSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/VpnConnectionIdSetType.java b/awsapi/src/com/amazon/ec2/VpnConnectionIdSetType.java index 69795d7b016..aa3be900615 100644 --- a/awsapi/src/com/amazon/ec2/VpnConnectionIdSetType.java +++ b/awsapi/src/com/amazon/ec2/VpnConnectionIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpnConnectionIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/VpnConnectionSetType.java b/awsapi/src/com/amazon/ec2/VpnConnectionSetType.java index 1b255f6eec3..9f70ff61328 100644 --- a/awsapi/src/com/amazon/ec2/VpnConnectionSetType.java +++ b/awsapi/src/com/amazon/ec2/VpnConnectionSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpnConnectionSetType.java diff --git a/awsapi/src/com/amazon/ec2/VpnConnectionType.java b/awsapi/src/com/amazon/ec2/VpnConnectionType.java index c0eafc4aa0b..90c967d39a0 100644 --- a/awsapi/src/com/amazon/ec2/VpnConnectionType.java +++ b/awsapi/src/com/amazon/ec2/VpnConnectionType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpnConnectionType.java diff --git a/awsapi/src/com/amazon/ec2/VpnGatewayIdSetItemType.java b/awsapi/src/com/amazon/ec2/VpnGatewayIdSetItemType.java index 327d37bc68b..8273809ea33 100644 --- a/awsapi/src/com/amazon/ec2/VpnGatewayIdSetItemType.java +++ b/awsapi/src/com/amazon/ec2/VpnGatewayIdSetItemType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpnGatewayIdSetItemType.java diff --git a/awsapi/src/com/amazon/ec2/VpnGatewayIdSetType.java b/awsapi/src/com/amazon/ec2/VpnGatewayIdSetType.java index e2e6bfbb00d..c1dc742384c 100644 --- a/awsapi/src/com/amazon/ec2/VpnGatewayIdSetType.java +++ b/awsapi/src/com/amazon/ec2/VpnGatewayIdSetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpnGatewayIdSetType.java diff --git a/awsapi/src/com/amazon/ec2/VpnGatewaySetType.java b/awsapi/src/com/amazon/ec2/VpnGatewaySetType.java index d76b50060c5..3a5af791115 100644 --- a/awsapi/src/com/amazon/ec2/VpnGatewaySetType.java +++ b/awsapi/src/com/amazon/ec2/VpnGatewaySetType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpnGatewaySetType.java diff --git a/awsapi/src/com/amazon/ec2/VpnGatewayType.java b/awsapi/src/com/amazon/ec2/VpnGatewayType.java index 24111893378..fe1bba18be4 100644 --- a/awsapi/src/com/amazon/ec2/VpnGatewayType.java +++ b/awsapi/src/com/amazon/ec2/VpnGatewayType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * VpnGatewayType.java diff --git a/awsapi/src/com/amazon/ec2/client/AmazonEC2CallbackHandler.java b/awsapi/src/com/amazon/ec2/client/AmazonEC2CallbackHandler.java index 91f74abc3ef..832197053d3 100644 --- a/awsapi/src/com/amazon/ec2/client/AmazonEC2CallbackHandler.java +++ b/awsapi/src/com/amazon/ec2/client/AmazonEC2CallbackHandler.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AmazonEC2CallbackHandler.java diff --git a/awsapi/src/com/amazon/ec2/client/AmazonEC2Stub.java b/awsapi/src/com/amazon/ec2/client/AmazonEC2Stub.java index dacdee9d039..d016cc396a0 100644 --- a/awsapi/src/com/amazon/ec2/client/AmazonEC2Stub.java +++ b/awsapi/src/com/amazon/ec2/client/AmazonEC2Stub.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * AmazonEC2Stub.java diff --git a/awsapi/src/com/amazon/s3/AccessControlList.java b/awsapi/src/com/amazon/s3/AccessControlList.java index cef31152b7d..5654a9822b9 100644 --- a/awsapi/src/com/amazon/s3/AccessControlList.java +++ b/awsapi/src/com/amazon/s3/AccessControlList.java @@ -1,564 +1,580 @@ - -/** - * AccessControlList.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * AccessControlList bean class - */ - - public class AccessControlList - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = AccessControlList - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Grant - * This was an Array! - */ - - - protected com.amazon.s3.Grant[] localGrant ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localGrantTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.Grant[] - */ - public com.amazon.s3.Grant[] getGrant(){ - return localGrant; - } - - - - - - - /** - * validate the array for Grant - */ - protected void validateGrant(com.amazon.s3.Grant[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param Grant - */ - public void setGrant(com.amazon.s3.Grant[] param){ - - validateGrant(param); - - - if (param != null){ - //update the setting tracker - localGrantTracker = true; - } else { - localGrantTracker = false; - - } - - this.localGrant=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.Grant - */ - public void addGrant(com.amazon.s3.Grant param){ - if (localGrant == null){ - localGrant = new com.amazon.s3.Grant[]{}; - } - - - //update the setting tracker - localGrantTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localGrant); - list.add(param); - this.localGrant = - (com.amazon.s3.Grant[])list.toArray( - new com.amazon.s3.Grant[list.size()]); - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - AccessControlList.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":AccessControlList", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "AccessControlList", - xmlWriter); - } - - - } - if (localGrantTracker){ - if (localGrant!=null){ - for (int i = 0;i < localGrant.length;i++){ - if (localGrant[i] != null){ - localGrant[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Grant cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localGrantTracker){ - if (localGrant!=null) { - for (int i = 0;i < localGrant.length;i++){ - - if (localGrant[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Grant")); - elementList.add(localGrant[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Grant cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static AccessControlList parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - AccessControlList object = - new AccessControlList(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"AccessControlList".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AccessControlList)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list1.add(com.amazon.s3.Grant.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while(!loopDone1){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant").equals(reader.getName())){ - list1.add(com.amazon.s3.Grant.Factory.parse(reader)); - - }else{ - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setGrant((com.amazon.s3.Grant[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.Grant.class, - list1)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * AccessControlList.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * AccessControlList bean class + */ + + public class AccessControlList + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = AccessControlList + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Grant + * This was an Array! + */ + + + protected com.amazon.s3.Grant[] localGrant ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localGrantTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.Grant[] + */ + public com.amazon.s3.Grant[] getGrant(){ + return localGrant; + } + + + + + + + /** + * validate the array for Grant + */ + protected void validateGrant(com.amazon.s3.Grant[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param Grant + */ + public void setGrant(com.amazon.s3.Grant[] param){ + + validateGrant(param); + + + if (param != null){ + //update the setting tracker + localGrantTracker = true; + } else { + localGrantTracker = false; + + } + + this.localGrant=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.Grant + */ + public void addGrant(com.amazon.s3.Grant param){ + if (localGrant == null){ + localGrant = new com.amazon.s3.Grant[]{}; + } + + + //update the setting tracker + localGrantTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localGrant); + list.add(param); + this.localGrant = + (com.amazon.s3.Grant[])list.toArray( + new com.amazon.s3.Grant[list.size()]); + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + AccessControlList.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":AccessControlList", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "AccessControlList", + xmlWriter); + } + + + } + if (localGrantTracker){ + if (localGrant!=null){ + for (int i = 0;i < localGrant.length;i++){ + if (localGrant[i] != null){ + localGrant[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Grant cannot be null!!"); + + } + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localGrantTracker){ + if (localGrant!=null) { + for (int i = 0;i < localGrant.length;i++){ + + if (localGrant[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Grant")); + elementList.add(localGrant[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Grant cannot be null!!"); + + } + + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static AccessControlList parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + AccessControlList object = + new AccessControlList(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"AccessControlList".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (AccessControlList)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list1 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list1.add(com.amazon.s3.Grant.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone1 = false; + while(!loopDone1){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone1 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant").equals(reader.getName())){ + list1.add(com.amazon.s3.Grant.Factory.parse(reader)); + + }else{ + loopDone1 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setGrant((com.amazon.s3.Grant[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.Grant.class, + list1)); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/AccessControlPolicy.java b/awsapi/src/com/amazon/s3/AccessControlPolicy.java index eaae4d0fbff..f151442faac 100644 --- a/awsapi/src/com/amazon/s3/AccessControlPolicy.java +++ b/awsapi/src/com/amazon/s3/AccessControlPolicy.java @@ -1,513 +1,529 @@ - -/** - * AccessControlPolicy.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * AccessControlPolicy bean class - */ - - public class AccessControlPolicy - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = AccessControlPolicy - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Owner - */ - - - protected com.amazon.s3.CanonicalUser localOwner ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.CanonicalUser - */ - public com.amazon.s3.CanonicalUser getOwner(){ - return localOwner; - } - - - - /** - * Auto generated setter method - * @param param Owner - */ - public void setOwner(com.amazon.s3.CanonicalUser param){ - - this.localOwner=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected com.amazon.s3.AccessControlList localAccessControlList ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.AccessControlList - */ - public com.amazon.s3.AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(com.amazon.s3.AccessControlList param){ - - this.localAccessControlList=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - AccessControlPolicy.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":AccessControlPolicy", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "AccessControlPolicy", - xmlWriter); - } - - - } - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), - factory,xmlWriter); - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Owner")); - - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - elementList.add(localOwner); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static AccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - AccessControlPolicy object = - new AccessControlPolicy(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"AccessControlPolicy".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AccessControlPolicy)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ - - object.setOwner(com.amazon.s3.CanonicalUser.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * AccessControlPolicy.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * AccessControlPolicy bean class + */ + + public class AccessControlPolicy + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = AccessControlPolicy + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Owner + */ + + + protected com.amazon.s3.CanonicalUser localOwner ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.CanonicalUser + */ + public com.amazon.s3.CanonicalUser getOwner(){ + return localOwner; + } + + + + /** + * Auto generated setter method + * @param param Owner + */ + public void setOwner(com.amazon.s3.CanonicalUser param){ + + this.localOwner=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected com.amazon.s3.AccessControlList localAccessControlList ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.AccessControlList + */ + public com.amazon.s3.AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(com.amazon.s3.AccessControlList param){ + + this.localAccessControlList=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + AccessControlPolicy.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":AccessControlPolicy", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "AccessControlPolicy", + xmlWriter); + } + + + } + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), + factory,xmlWriter); + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Owner")); + + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + elementList.add(localOwner); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static AccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + AccessControlPolicy object = + new AccessControlPolicy(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"AccessControlPolicy".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (AccessControlPolicy)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ + + object.setOwner(com.amazon.s3.CanonicalUser.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/AmazonCustomerByEmail.java b/awsapi/src/com/amazon/s3/AmazonCustomerByEmail.java index 497943ddbdb..fed83d74fef 100644 --- a/awsapi/src/com/amazon/s3/AmazonCustomerByEmail.java +++ b/awsapi/src/com/amazon/s3/AmazonCustomerByEmail.java @@ -1,482 +1,498 @@ - -/** - * AmazonCustomerByEmail.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * AmazonCustomerByEmail bean class - */ - - public class AmazonCustomerByEmail extends com.amazon.s3.User - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = AmazonCustomerByEmail - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for EmailAddress - */ - - - protected java.lang.String localEmailAddress ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getEmailAddress(){ - return localEmailAddress; - } - - - - /** - * Auto generated setter method - * @param param EmailAddress - */ - public void setEmailAddress(java.lang.String param){ - - this.localEmailAddress=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - AmazonCustomerByEmail.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":AmazonCustomerByEmail", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "AmazonCustomerByEmail", - xmlWriter); - } - - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"EmailAddress", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"EmailAddress"); - } - - } else { - xmlWriter.writeStartElement("EmailAddress"); - } - - - if (localEmailAddress==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("EmailAddress cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localEmailAddress); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); - attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AmazonCustomerByEmail")); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "EmailAddress")); - - if (localEmailAddress != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEmailAddress)); - } else { - throw new org.apache.axis2.databinding.ADBException("EmailAddress cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static AmazonCustomerByEmail parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - AmazonCustomerByEmail object = - new AmazonCustomerByEmail(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"AmazonCustomerByEmail".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AmazonCustomerByEmail)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","EmailAddress").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setEmailAddress( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * AmazonCustomerByEmail.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * AmazonCustomerByEmail bean class + */ + + public class AmazonCustomerByEmail extends com.amazon.s3.User + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = AmazonCustomerByEmail + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for EmailAddress + */ + + + protected java.lang.String localEmailAddress ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getEmailAddress(){ + return localEmailAddress; + } + + + + /** + * Auto generated setter method + * @param param EmailAddress + */ + public void setEmailAddress(java.lang.String param){ + + this.localEmailAddress=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + AmazonCustomerByEmail.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":AmazonCustomerByEmail", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "AmazonCustomerByEmail", + xmlWriter); + } + + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"EmailAddress", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"EmailAddress"); + } + + } else { + xmlWriter.writeStartElement("EmailAddress"); + } + + + if (localEmailAddress==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("EmailAddress cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localEmailAddress); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); + attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AmazonCustomerByEmail")); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "EmailAddress")); + + if (localEmailAddress != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEmailAddress)); + } else { + throw new org.apache.axis2.databinding.ADBException("EmailAddress cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static AmazonCustomerByEmail parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + AmazonCustomerByEmail object = + new AmazonCustomerByEmail(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"AmazonCustomerByEmail".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (AmazonCustomerByEmail)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","EmailAddress").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setEmailAddress( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/AmazonS3MessageReceiverInOut.java b/awsapi/src/com/amazon/s3/AmazonS3MessageReceiverInOut.java index 6330207ab8e..cc137f015ba 100644 --- a/awsapi/src/com/amazon/s3/AmazonS3MessageReceiverInOut.java +++ b/awsapi/src/com/amazon/s3/AmazonS3MessageReceiverInOut.java @@ -1,1369 +1,1385 @@ - -/** - * AmazonS3MessageReceiverInOut.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) - */ - package com.amazon.s3; - - /** - * AmazonS3MessageReceiverInOut message receiver - */ - - public class AmazonS3MessageReceiverInOut extends org.apache.axis2.receivers.AbstractInOutMessageReceiver{ - - - public void invokeBusinessLogic(org.apache.axis2.context.MessageContext msgContext, org.apache.axis2.context.MessageContext newMsgContext) - throws org.apache.axis2.AxisFault{ - - try { - - // get the implementation class for the Web Service - Object obj = getTheImplementationObject(msgContext); - - AmazonS3SkeletonInterface skel = (AmazonS3SkeletonInterface)obj; - //Out Envelop - org.apache.axiom.soap.SOAPEnvelope envelope = null; - //Find the axisOperation that has been set by the Dispatch phase. - org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext().getAxisOperation(); - if (op == null) { - throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider"); - } - - java.lang.String methodName; - if((op.getName() != null) && ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJavaIdentifier(op.getName().getLocalPart())) != null)){ - - - - if("getBucketLoggingStatus".equals(methodName)){ - - com.amazon.s3.GetBucketLoggingStatusResponse getBucketLoggingStatusResponse33 = null; - com.amazon.s3.GetBucketLoggingStatus wrappedParam = - (com.amazon.s3.GetBucketLoggingStatus)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.GetBucketLoggingStatus.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - getBucketLoggingStatusResponse33 = - - - skel.getBucketLoggingStatus(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), getBucketLoggingStatusResponse33, false); - } else - - if("copyObject".equals(methodName)){ - - com.amazon.s3.CopyObjectResponse copyObjectResponse35 = null; - com.amazon.s3.CopyObject wrappedParam = - (com.amazon.s3.CopyObject)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.CopyObject.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - copyObjectResponse35 = - - - skel.copyObject(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), copyObjectResponse35, false); - } else - - if("getBucketAccessControlPolicy".equals(methodName)){ - - com.amazon.s3.GetBucketAccessControlPolicyResponse getBucketAccessControlPolicyResponse37 = null; - com.amazon.s3.GetBucketAccessControlPolicy wrappedParam = - (com.amazon.s3.GetBucketAccessControlPolicy)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.GetBucketAccessControlPolicy.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - getBucketAccessControlPolicyResponse37 = - - - skel.getBucketAccessControlPolicy(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), getBucketAccessControlPolicyResponse37, false); - } else - - if("listBucket".equals(methodName)){ - - com.amazon.s3.ListBucketResponse listBucketResponse39 = null; - com.amazon.s3.ListBucket wrappedParam = - (com.amazon.s3.ListBucket)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.ListBucket.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - listBucketResponse39 = - - - skel.listBucket(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), listBucketResponse39, false); - } else - - if("putObject".equals(methodName)){ - - com.amazon.s3.PutObjectResponse putObjectResponse41 = null; - com.amazon.s3.PutObject wrappedParam = - (com.amazon.s3.PutObject)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.PutObject.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - putObjectResponse41 = - - - skel.putObject(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), putObjectResponse41, false); - } else - - if("createBucket".equals(methodName)){ - - com.amazon.s3.CreateBucketResponse createBucketResponse43 = null; - com.amazon.s3.CreateBucket wrappedParam = - (com.amazon.s3.CreateBucket)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.CreateBucket.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - createBucketResponse43 = - - - skel.createBucket(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), createBucketResponse43, false); - } else - - if("listAllMyBuckets".equals(methodName)){ - - com.amazon.s3.ListAllMyBucketsResponse listAllMyBucketsResponse45 = null; - com.amazon.s3.ListAllMyBuckets wrappedParam = - (com.amazon.s3.ListAllMyBuckets)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.ListAllMyBuckets.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - listAllMyBucketsResponse45 = - - - skel.listAllMyBuckets(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), listAllMyBucketsResponse45, false); - } else - - if("getObject".equals(methodName)){ - - com.amazon.s3.GetObjectResponse getObjectResponse47 = null; - com.amazon.s3.GetObject wrappedParam = - (com.amazon.s3.GetObject)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.GetObject.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - getObjectResponse47 = - - - skel.getObject(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), getObjectResponse47, false); - } else - - if("deleteBucket".equals(methodName)){ - - com.amazon.s3.DeleteBucketResponse deleteBucketResponse49 = null; - com.amazon.s3.DeleteBucket wrappedParam = - (com.amazon.s3.DeleteBucket)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.DeleteBucket.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - deleteBucketResponse49 = - - - skel.deleteBucket(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), deleteBucketResponse49, false); - } else - - if("setBucketLoggingStatus".equals(methodName)){ - - com.amazon.s3.SetBucketLoggingStatusResponse setBucketLoggingStatusResponse51 = null; - com.amazon.s3.SetBucketLoggingStatus wrappedParam = - (com.amazon.s3.SetBucketLoggingStatus)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.SetBucketLoggingStatus.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - setBucketLoggingStatusResponse51 = - - - skel.setBucketLoggingStatus(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), setBucketLoggingStatusResponse51, false); - } else - - if("getObjectAccessControlPolicy".equals(methodName)){ - - com.amazon.s3.GetObjectAccessControlPolicyResponse getObjectAccessControlPolicyResponse53 = null; - com.amazon.s3.GetObjectAccessControlPolicy wrappedParam = - (com.amazon.s3.GetObjectAccessControlPolicy)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.GetObjectAccessControlPolicy.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - getObjectAccessControlPolicyResponse53 = - - - skel.getObjectAccessControlPolicy(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), getObjectAccessControlPolicyResponse53, false); - } else - - if("deleteObject".equals(methodName)){ - - com.amazon.s3.DeleteObjectResponse deleteObjectResponse55 = null; - com.amazon.s3.DeleteObject wrappedParam = - (com.amazon.s3.DeleteObject)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.DeleteObject.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - deleteObjectResponse55 = - - - skel.deleteObject(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), deleteObjectResponse55, false); - } else - - if("setBucketAccessControlPolicy".equals(methodName)){ - - com.amazon.s3.SetBucketAccessControlPolicyResponse setBucketAccessControlPolicyResponse57 = null; - com.amazon.s3.SetBucketAccessControlPolicy wrappedParam = - (com.amazon.s3.SetBucketAccessControlPolicy)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.SetBucketAccessControlPolicy.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - setBucketAccessControlPolicyResponse57 = - - - skel.setBucketAccessControlPolicy(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), setBucketAccessControlPolicyResponse57, false); - } else - - if("setObjectAccessControlPolicy".equals(methodName)){ - - com.amazon.s3.SetObjectAccessControlPolicyResponse setObjectAccessControlPolicyResponse59 = null; - com.amazon.s3.SetObjectAccessControlPolicy wrappedParam = - (com.amazon.s3.SetObjectAccessControlPolicy)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.SetObjectAccessControlPolicy.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - setObjectAccessControlPolicyResponse59 = - - - skel.setObjectAccessControlPolicy(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), setObjectAccessControlPolicyResponse59, false); - } else - - if("putObjectInline".equals(methodName)){ - - com.amazon.s3.PutObjectInlineResponse putObjectInlineResponse61 = null; - com.amazon.s3.PutObjectInline wrappedParam = - (com.amazon.s3.PutObjectInline)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.PutObjectInline.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - putObjectInlineResponse61 = - - - skel.putObjectInline(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), putObjectInlineResponse61, false); - } else - - if("getObjectExtended".equals(methodName)){ - - com.amazon.s3.GetObjectExtendedResponse getObjectExtendedResponse63 = null; - com.amazon.s3.GetObjectExtended wrappedParam = - (com.amazon.s3.GetObjectExtended)fromOM( - msgContext.getEnvelope().getBody().getFirstElement(), - com.amazon.s3.GetObjectExtended.class, - getEnvelopeNamespaces(msgContext.getEnvelope())); - - getObjectExtendedResponse63 = - - - skel.getObjectExtended(wrappedParam) - ; - - envelope = toEnvelope(getSOAPFactory(msgContext), getObjectExtendedResponse63, false); - - } else { - throw new java.lang.RuntimeException("method not found"); - } - - - newMsgContext.setEnvelope(envelope); - } - } - catch (java.lang.Exception e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - // - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetBucketLoggingStatus param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.GetBucketLoggingStatus.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetBucketLoggingStatusResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.GetBucketLoggingStatusResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.CopyObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.CopyObject.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.CopyObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.CopyObjectResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetBucketAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.GetBucketAccessControlPolicy.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetBucketAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.GetBucketAccessControlPolicyResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.ListBucket param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.ListBucket.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.ListBucketResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.ListBucketResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.PutObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.PutObject.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.PutObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.PutObjectResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.CreateBucket param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.CreateBucket.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.CreateBucketResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.CreateBucketResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.ListAllMyBuckets param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.ListAllMyBuckets.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.ListAllMyBucketsResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.ListAllMyBucketsResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.GetObject.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.GetObjectResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.DeleteBucket param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.DeleteBucket.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.DeleteBucketResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.DeleteBucketResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetBucketLoggingStatus param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.SetBucketLoggingStatus.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetBucketLoggingStatusResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.SetBucketLoggingStatusResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObjectAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.GetObjectAccessControlPolicy.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObjectAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.GetObjectAccessControlPolicyResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.DeleteObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.DeleteObject.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.DeleteObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.DeleteObjectResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetBucketAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.SetBucketAccessControlPolicy.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetBucketAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.SetBucketAccessControlPolicyResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetObjectAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.SetObjectAccessControlPolicy.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetObjectAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.SetObjectAccessControlPolicyResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.PutObjectInline param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.PutObjectInline.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.PutObjectInlineResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.PutObjectInlineResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObjectExtended param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.GetObjectExtended.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObjectExtendedResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.GetObjectExtendedResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.GetBucketLoggingStatusResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.GetBucketLoggingStatusResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.GetBucketLoggingStatusResponse wrapGetBucketLoggingStatus(){ - com.amazon.s3.GetBucketLoggingStatusResponse wrappedElement = new com.amazon.s3.GetBucketLoggingStatusResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.CopyObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.CopyObjectResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.CopyObjectResponse wrapCopyObject(){ - com.amazon.s3.CopyObjectResponse wrappedElement = new com.amazon.s3.CopyObjectResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.GetBucketAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.GetBucketAccessControlPolicyResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.GetBucketAccessControlPolicyResponse wrapGetBucketAccessControlPolicy(){ - com.amazon.s3.GetBucketAccessControlPolicyResponse wrappedElement = new com.amazon.s3.GetBucketAccessControlPolicyResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.ListBucketResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.ListBucketResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.ListBucketResponse wrapListBucket(){ - com.amazon.s3.ListBucketResponse wrappedElement = new com.amazon.s3.ListBucketResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.PutObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.PutObjectResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.PutObjectResponse wrapPutObject(){ - com.amazon.s3.PutObjectResponse wrappedElement = new com.amazon.s3.PutObjectResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.CreateBucketResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.CreateBucketResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.CreateBucketResponse wrapCreateBucket(){ - com.amazon.s3.CreateBucketResponse wrappedElement = new com.amazon.s3.CreateBucketResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.ListAllMyBucketsResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.ListAllMyBucketsResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.ListAllMyBucketsResponse wrapListAllMyBuckets(){ - com.amazon.s3.ListAllMyBucketsResponse wrappedElement = new com.amazon.s3.ListAllMyBucketsResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.GetObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.GetObjectResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.GetObjectResponse wrapGetObject(){ - com.amazon.s3.GetObjectResponse wrappedElement = new com.amazon.s3.GetObjectResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.DeleteBucketResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.DeleteBucketResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.DeleteBucketResponse wrapDeleteBucket(){ - com.amazon.s3.DeleteBucketResponse wrappedElement = new com.amazon.s3.DeleteBucketResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.SetBucketLoggingStatusResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.SetBucketLoggingStatusResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.SetBucketLoggingStatusResponse wrapSetBucketLoggingStatus(){ - com.amazon.s3.SetBucketLoggingStatusResponse wrappedElement = new com.amazon.s3.SetBucketLoggingStatusResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.GetObjectAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.GetObjectAccessControlPolicyResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.GetObjectAccessControlPolicyResponse wrapGetObjectAccessControlPolicy(){ - com.amazon.s3.GetObjectAccessControlPolicyResponse wrappedElement = new com.amazon.s3.GetObjectAccessControlPolicyResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.DeleteObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.DeleteObjectResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.DeleteObjectResponse wrapDeleteObject(){ - com.amazon.s3.DeleteObjectResponse wrappedElement = new com.amazon.s3.DeleteObjectResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.SetBucketAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.SetBucketAccessControlPolicyResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.SetBucketAccessControlPolicyResponse wrapSetBucketAccessControlPolicy(){ - com.amazon.s3.SetBucketAccessControlPolicyResponse wrappedElement = new com.amazon.s3.SetBucketAccessControlPolicyResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.SetObjectAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.SetObjectAccessControlPolicyResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.SetObjectAccessControlPolicyResponse wrapSetObjectAccessControlPolicy(){ - com.amazon.s3.SetObjectAccessControlPolicyResponse wrappedElement = new com.amazon.s3.SetObjectAccessControlPolicyResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.PutObjectInlineResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.PutObjectInlineResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.PutObjectInlineResponse wrapPutObjectInline(){ - com.amazon.s3.PutObjectInlineResponse wrappedElement = new com.amazon.s3.PutObjectInlineResponse(); - return wrappedElement; - } - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.GetObjectExtendedResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - try{ - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.GetObjectExtendedResponse.MY_QNAME,factory)); - - - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - private com.amazon.s3.GetObjectExtendedResponse wrapGetObjectExtended(){ - com.amazon.s3.GetObjectExtendedResponse wrappedElement = new com.amazon.s3.GetObjectExtendedResponse(); - return wrappedElement; - } - - - - /** - * get the default envelope - */ - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){ - return factory.getDefaultEnvelope(); - } - - - private java.lang.Object fromOM( - org.apache.axiom.om.OMElement param, - java.lang.Class type, - java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{ - - try { - - if (com.amazon.s3.GetBucketLoggingStatus.class.equals(type)){ - - return com.amazon.s3.GetBucketLoggingStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.GetBucketLoggingStatusResponse.class.equals(type)){ - - return com.amazon.s3.GetBucketLoggingStatusResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.CopyObject.class.equals(type)){ - - return com.amazon.s3.CopyObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.CopyObjectResponse.class.equals(type)){ - - return com.amazon.s3.CopyObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.GetBucketAccessControlPolicy.class.equals(type)){ - - return com.amazon.s3.GetBucketAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.GetBucketAccessControlPolicyResponse.class.equals(type)){ - - return com.amazon.s3.GetBucketAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.ListBucket.class.equals(type)){ - - return com.amazon.s3.ListBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.ListBucketResponse.class.equals(type)){ - - return com.amazon.s3.ListBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.PutObject.class.equals(type)){ - - return com.amazon.s3.PutObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.PutObjectResponse.class.equals(type)){ - - return com.amazon.s3.PutObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.CreateBucket.class.equals(type)){ - - return com.amazon.s3.CreateBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.CreateBucketResponse.class.equals(type)){ - - return com.amazon.s3.CreateBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.ListAllMyBuckets.class.equals(type)){ - - return com.amazon.s3.ListAllMyBuckets.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.ListAllMyBucketsResponse.class.equals(type)){ - - return com.amazon.s3.ListAllMyBucketsResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.GetObject.class.equals(type)){ - - return com.amazon.s3.GetObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.GetObjectResponse.class.equals(type)){ - - return com.amazon.s3.GetObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.DeleteBucket.class.equals(type)){ - - return com.amazon.s3.DeleteBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.DeleteBucketResponse.class.equals(type)){ - - return com.amazon.s3.DeleteBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.SetBucketLoggingStatus.class.equals(type)){ - - return com.amazon.s3.SetBucketLoggingStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.SetBucketLoggingStatusResponse.class.equals(type)){ - - return com.amazon.s3.SetBucketLoggingStatusResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.GetObjectAccessControlPolicy.class.equals(type)){ - - return com.amazon.s3.GetObjectAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.GetObjectAccessControlPolicyResponse.class.equals(type)){ - - return com.amazon.s3.GetObjectAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.DeleteObject.class.equals(type)){ - - return com.amazon.s3.DeleteObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.DeleteObjectResponse.class.equals(type)){ - - return com.amazon.s3.DeleteObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.SetBucketAccessControlPolicy.class.equals(type)){ - - return com.amazon.s3.SetBucketAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.SetBucketAccessControlPolicyResponse.class.equals(type)){ - - return com.amazon.s3.SetBucketAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.SetObjectAccessControlPolicy.class.equals(type)){ - - return com.amazon.s3.SetObjectAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.SetObjectAccessControlPolicyResponse.class.equals(type)){ - - return com.amazon.s3.SetObjectAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.PutObjectInline.class.equals(type)){ - - return com.amazon.s3.PutObjectInline.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.PutObjectInlineResponse.class.equals(type)){ - - return com.amazon.s3.PutObjectInlineResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.GetObjectExtended.class.equals(type)){ - - return com.amazon.s3.GetObjectExtended.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.GetObjectExtendedResponse.class.equals(type)){ - - return com.amazon.s3.GetObjectExtendedResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - } catch (java.lang.Exception e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - return null; - } - - - - - - /** - * A utility method that copies the namepaces from the SOAPEnvelope - */ - private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){ - java.util.Map returnMap = new java.util.HashMap(); - java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); - while (namespaceIterator.hasNext()) { - org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); - returnMap.put(ns.getPrefix(),ns.getNamespaceURI()); - } - return returnMap; - } - - private org.apache.axis2.AxisFault createAxisFault(java.lang.Exception e) { - org.apache.axis2.AxisFault f; - Throwable cause = e.getCause(); - if (cause != null) { - f = new org.apache.axis2.AxisFault(e.getMessage(), cause); - } else { - f = new org.apache.axis2.AxisFault(e.getMessage()); - } - - return f; - } - - }//end of class +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * AmazonS3MessageReceiverInOut.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) + */ + package com.amazon.s3; + + /** + * AmazonS3MessageReceiverInOut message receiver + */ + + public class AmazonS3MessageReceiverInOut extends org.apache.axis2.receivers.AbstractInOutMessageReceiver{ + + + public void invokeBusinessLogic(org.apache.axis2.context.MessageContext msgContext, org.apache.axis2.context.MessageContext newMsgContext) + throws org.apache.axis2.AxisFault{ + + try { + + // get the implementation class for the Web Service + Object obj = getTheImplementationObject(msgContext); + + AmazonS3SkeletonInterface skel = (AmazonS3SkeletonInterface)obj; + //Out Envelop + org.apache.axiom.soap.SOAPEnvelope envelope = null; + //Find the axisOperation that has been set by the Dispatch phase. + org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext().getAxisOperation(); + if (op == null) { + throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider"); + } + + java.lang.String methodName; + if((op.getName() != null) && ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJavaIdentifier(op.getName().getLocalPart())) != null)){ + + + + if("getBucketLoggingStatus".equals(methodName)){ + + com.amazon.s3.GetBucketLoggingStatusResponse getBucketLoggingStatusResponse33 = null; + com.amazon.s3.GetBucketLoggingStatus wrappedParam = + (com.amazon.s3.GetBucketLoggingStatus)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.GetBucketLoggingStatus.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + getBucketLoggingStatusResponse33 = + + + skel.getBucketLoggingStatus(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), getBucketLoggingStatusResponse33, false); + } else + + if("copyObject".equals(methodName)){ + + com.amazon.s3.CopyObjectResponse copyObjectResponse35 = null; + com.amazon.s3.CopyObject wrappedParam = + (com.amazon.s3.CopyObject)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.CopyObject.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + copyObjectResponse35 = + + + skel.copyObject(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), copyObjectResponse35, false); + } else + + if("getBucketAccessControlPolicy".equals(methodName)){ + + com.amazon.s3.GetBucketAccessControlPolicyResponse getBucketAccessControlPolicyResponse37 = null; + com.amazon.s3.GetBucketAccessControlPolicy wrappedParam = + (com.amazon.s3.GetBucketAccessControlPolicy)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.GetBucketAccessControlPolicy.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + getBucketAccessControlPolicyResponse37 = + + + skel.getBucketAccessControlPolicy(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), getBucketAccessControlPolicyResponse37, false); + } else + + if("listBucket".equals(methodName)){ + + com.amazon.s3.ListBucketResponse listBucketResponse39 = null; + com.amazon.s3.ListBucket wrappedParam = + (com.amazon.s3.ListBucket)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.ListBucket.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + listBucketResponse39 = + + + skel.listBucket(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), listBucketResponse39, false); + } else + + if("putObject".equals(methodName)){ + + com.amazon.s3.PutObjectResponse putObjectResponse41 = null; + com.amazon.s3.PutObject wrappedParam = + (com.amazon.s3.PutObject)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.PutObject.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + putObjectResponse41 = + + + skel.putObject(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), putObjectResponse41, false); + } else + + if("createBucket".equals(methodName)){ + + com.amazon.s3.CreateBucketResponse createBucketResponse43 = null; + com.amazon.s3.CreateBucket wrappedParam = + (com.amazon.s3.CreateBucket)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.CreateBucket.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + createBucketResponse43 = + + + skel.createBucket(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), createBucketResponse43, false); + } else + + if("listAllMyBuckets".equals(methodName)){ + + com.amazon.s3.ListAllMyBucketsResponse listAllMyBucketsResponse45 = null; + com.amazon.s3.ListAllMyBuckets wrappedParam = + (com.amazon.s3.ListAllMyBuckets)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.ListAllMyBuckets.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + listAllMyBucketsResponse45 = + + + skel.listAllMyBuckets(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), listAllMyBucketsResponse45, false); + } else + + if("getObject".equals(methodName)){ + + com.amazon.s3.GetObjectResponse getObjectResponse47 = null; + com.amazon.s3.GetObject wrappedParam = + (com.amazon.s3.GetObject)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.GetObject.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + getObjectResponse47 = + + + skel.getObject(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), getObjectResponse47, false); + } else + + if("deleteBucket".equals(methodName)){ + + com.amazon.s3.DeleteBucketResponse deleteBucketResponse49 = null; + com.amazon.s3.DeleteBucket wrappedParam = + (com.amazon.s3.DeleteBucket)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.DeleteBucket.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + deleteBucketResponse49 = + + + skel.deleteBucket(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), deleteBucketResponse49, false); + } else + + if("setBucketLoggingStatus".equals(methodName)){ + + com.amazon.s3.SetBucketLoggingStatusResponse setBucketLoggingStatusResponse51 = null; + com.amazon.s3.SetBucketLoggingStatus wrappedParam = + (com.amazon.s3.SetBucketLoggingStatus)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.SetBucketLoggingStatus.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + setBucketLoggingStatusResponse51 = + + + skel.setBucketLoggingStatus(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), setBucketLoggingStatusResponse51, false); + } else + + if("getObjectAccessControlPolicy".equals(methodName)){ + + com.amazon.s3.GetObjectAccessControlPolicyResponse getObjectAccessControlPolicyResponse53 = null; + com.amazon.s3.GetObjectAccessControlPolicy wrappedParam = + (com.amazon.s3.GetObjectAccessControlPolicy)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.GetObjectAccessControlPolicy.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + getObjectAccessControlPolicyResponse53 = + + + skel.getObjectAccessControlPolicy(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), getObjectAccessControlPolicyResponse53, false); + } else + + if("deleteObject".equals(methodName)){ + + com.amazon.s3.DeleteObjectResponse deleteObjectResponse55 = null; + com.amazon.s3.DeleteObject wrappedParam = + (com.amazon.s3.DeleteObject)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.DeleteObject.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + deleteObjectResponse55 = + + + skel.deleteObject(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), deleteObjectResponse55, false); + } else + + if("setBucketAccessControlPolicy".equals(methodName)){ + + com.amazon.s3.SetBucketAccessControlPolicyResponse setBucketAccessControlPolicyResponse57 = null; + com.amazon.s3.SetBucketAccessControlPolicy wrappedParam = + (com.amazon.s3.SetBucketAccessControlPolicy)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.SetBucketAccessControlPolicy.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + setBucketAccessControlPolicyResponse57 = + + + skel.setBucketAccessControlPolicy(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), setBucketAccessControlPolicyResponse57, false); + } else + + if("setObjectAccessControlPolicy".equals(methodName)){ + + com.amazon.s3.SetObjectAccessControlPolicyResponse setObjectAccessControlPolicyResponse59 = null; + com.amazon.s3.SetObjectAccessControlPolicy wrappedParam = + (com.amazon.s3.SetObjectAccessControlPolicy)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.SetObjectAccessControlPolicy.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + setObjectAccessControlPolicyResponse59 = + + + skel.setObjectAccessControlPolicy(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), setObjectAccessControlPolicyResponse59, false); + } else + + if("putObjectInline".equals(methodName)){ + + com.amazon.s3.PutObjectInlineResponse putObjectInlineResponse61 = null; + com.amazon.s3.PutObjectInline wrappedParam = + (com.amazon.s3.PutObjectInline)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.PutObjectInline.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + putObjectInlineResponse61 = + + + skel.putObjectInline(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), putObjectInlineResponse61, false); + } else + + if("getObjectExtended".equals(methodName)){ + + com.amazon.s3.GetObjectExtendedResponse getObjectExtendedResponse63 = null; + com.amazon.s3.GetObjectExtended wrappedParam = + (com.amazon.s3.GetObjectExtended)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.amazon.s3.GetObjectExtended.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + getObjectExtendedResponse63 = + + + skel.getObjectExtended(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), getObjectExtendedResponse63, false); + + } else { + throw new java.lang.RuntimeException("method not found"); + } + + + newMsgContext.setEnvelope(envelope); + } + } + catch (java.lang.Exception e) { + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + // + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetBucketLoggingStatus param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.GetBucketLoggingStatus.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetBucketLoggingStatusResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.GetBucketLoggingStatusResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.CopyObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.CopyObject.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.CopyObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.CopyObjectResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetBucketAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.GetBucketAccessControlPolicy.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetBucketAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.GetBucketAccessControlPolicyResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.ListBucket param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.ListBucket.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.ListBucketResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.ListBucketResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.PutObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.PutObject.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.PutObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.PutObjectResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.CreateBucket param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.CreateBucket.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.CreateBucketResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.CreateBucketResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.ListAllMyBuckets param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.ListAllMyBuckets.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.ListAllMyBucketsResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.ListAllMyBucketsResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.GetObject.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.GetObjectResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.DeleteBucket param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.DeleteBucket.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.DeleteBucketResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.DeleteBucketResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetBucketLoggingStatus param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.SetBucketLoggingStatus.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetBucketLoggingStatusResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.SetBucketLoggingStatusResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObjectAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.GetObjectAccessControlPolicy.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObjectAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.GetObjectAccessControlPolicyResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.DeleteObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.DeleteObject.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.DeleteObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.DeleteObjectResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetBucketAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.SetBucketAccessControlPolicy.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetBucketAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.SetBucketAccessControlPolicyResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetObjectAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.SetObjectAccessControlPolicy.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.SetObjectAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.SetObjectAccessControlPolicyResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.PutObjectInline param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.PutObjectInline.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.PutObjectInlineResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.PutObjectInlineResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObjectExtended param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.GetObjectExtended.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.GetObjectExtendedResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.GetObjectExtendedResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.GetBucketLoggingStatusResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.GetBucketLoggingStatusResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.GetBucketLoggingStatusResponse wrapGetBucketLoggingStatus(){ + com.amazon.s3.GetBucketLoggingStatusResponse wrappedElement = new com.amazon.s3.GetBucketLoggingStatusResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.CopyObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.CopyObjectResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.CopyObjectResponse wrapCopyObject(){ + com.amazon.s3.CopyObjectResponse wrappedElement = new com.amazon.s3.CopyObjectResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.GetBucketAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.GetBucketAccessControlPolicyResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.GetBucketAccessControlPolicyResponse wrapGetBucketAccessControlPolicy(){ + com.amazon.s3.GetBucketAccessControlPolicyResponse wrappedElement = new com.amazon.s3.GetBucketAccessControlPolicyResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.ListBucketResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.ListBucketResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.ListBucketResponse wrapListBucket(){ + com.amazon.s3.ListBucketResponse wrappedElement = new com.amazon.s3.ListBucketResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.PutObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.PutObjectResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.PutObjectResponse wrapPutObject(){ + com.amazon.s3.PutObjectResponse wrappedElement = new com.amazon.s3.PutObjectResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.CreateBucketResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.CreateBucketResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.CreateBucketResponse wrapCreateBucket(){ + com.amazon.s3.CreateBucketResponse wrappedElement = new com.amazon.s3.CreateBucketResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.ListAllMyBucketsResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.ListAllMyBucketsResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.ListAllMyBucketsResponse wrapListAllMyBuckets(){ + com.amazon.s3.ListAllMyBucketsResponse wrappedElement = new com.amazon.s3.ListAllMyBucketsResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.GetObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.GetObjectResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.GetObjectResponse wrapGetObject(){ + com.amazon.s3.GetObjectResponse wrappedElement = new com.amazon.s3.GetObjectResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.DeleteBucketResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.DeleteBucketResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.DeleteBucketResponse wrapDeleteBucket(){ + com.amazon.s3.DeleteBucketResponse wrappedElement = new com.amazon.s3.DeleteBucketResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.SetBucketLoggingStatusResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.SetBucketLoggingStatusResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.SetBucketLoggingStatusResponse wrapSetBucketLoggingStatus(){ + com.amazon.s3.SetBucketLoggingStatusResponse wrappedElement = new com.amazon.s3.SetBucketLoggingStatusResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.GetObjectAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.GetObjectAccessControlPolicyResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.GetObjectAccessControlPolicyResponse wrapGetObjectAccessControlPolicy(){ + com.amazon.s3.GetObjectAccessControlPolicyResponse wrappedElement = new com.amazon.s3.GetObjectAccessControlPolicyResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.DeleteObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.DeleteObjectResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.DeleteObjectResponse wrapDeleteObject(){ + com.amazon.s3.DeleteObjectResponse wrappedElement = new com.amazon.s3.DeleteObjectResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.SetBucketAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.SetBucketAccessControlPolicyResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.SetBucketAccessControlPolicyResponse wrapSetBucketAccessControlPolicy(){ + com.amazon.s3.SetBucketAccessControlPolicyResponse wrappedElement = new com.amazon.s3.SetBucketAccessControlPolicyResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.SetObjectAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.SetObjectAccessControlPolicyResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.SetObjectAccessControlPolicyResponse wrapSetObjectAccessControlPolicy(){ + com.amazon.s3.SetObjectAccessControlPolicyResponse wrappedElement = new com.amazon.s3.SetObjectAccessControlPolicyResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.PutObjectInlineResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.PutObjectInlineResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.PutObjectInlineResponse wrapPutObjectInline(){ + com.amazon.s3.PutObjectInlineResponse wrappedElement = new com.amazon.s3.PutObjectInlineResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.GetObjectExtendedResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.GetObjectExtendedResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.amazon.s3.GetObjectExtendedResponse wrapGetObjectExtended(){ + com.amazon.s3.GetObjectExtendedResponse wrappedElement = new com.amazon.s3.GetObjectExtendedResponse(); + return wrappedElement; + } + + + + /** + * get the default envelope + */ + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){ + return factory.getDefaultEnvelope(); + } + + + private java.lang.Object fromOM( + org.apache.axiom.om.OMElement param, + java.lang.Class type, + java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{ + + try { + + if (com.amazon.s3.GetBucketLoggingStatus.class.equals(type)){ + + return com.amazon.s3.GetBucketLoggingStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.GetBucketLoggingStatusResponse.class.equals(type)){ + + return com.amazon.s3.GetBucketLoggingStatusResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.CopyObject.class.equals(type)){ + + return com.amazon.s3.CopyObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.CopyObjectResponse.class.equals(type)){ + + return com.amazon.s3.CopyObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.GetBucketAccessControlPolicy.class.equals(type)){ + + return com.amazon.s3.GetBucketAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.GetBucketAccessControlPolicyResponse.class.equals(type)){ + + return com.amazon.s3.GetBucketAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.ListBucket.class.equals(type)){ + + return com.amazon.s3.ListBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.ListBucketResponse.class.equals(type)){ + + return com.amazon.s3.ListBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.PutObject.class.equals(type)){ + + return com.amazon.s3.PutObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.PutObjectResponse.class.equals(type)){ + + return com.amazon.s3.PutObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.CreateBucket.class.equals(type)){ + + return com.amazon.s3.CreateBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.CreateBucketResponse.class.equals(type)){ + + return com.amazon.s3.CreateBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.ListAllMyBuckets.class.equals(type)){ + + return com.amazon.s3.ListAllMyBuckets.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.ListAllMyBucketsResponse.class.equals(type)){ + + return com.amazon.s3.ListAllMyBucketsResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.GetObject.class.equals(type)){ + + return com.amazon.s3.GetObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.GetObjectResponse.class.equals(type)){ + + return com.amazon.s3.GetObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.DeleteBucket.class.equals(type)){ + + return com.amazon.s3.DeleteBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.DeleteBucketResponse.class.equals(type)){ + + return com.amazon.s3.DeleteBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.SetBucketLoggingStatus.class.equals(type)){ + + return com.amazon.s3.SetBucketLoggingStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.SetBucketLoggingStatusResponse.class.equals(type)){ + + return com.amazon.s3.SetBucketLoggingStatusResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.GetObjectAccessControlPolicy.class.equals(type)){ + + return com.amazon.s3.GetObjectAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.GetObjectAccessControlPolicyResponse.class.equals(type)){ + + return com.amazon.s3.GetObjectAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.DeleteObject.class.equals(type)){ + + return com.amazon.s3.DeleteObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.DeleteObjectResponse.class.equals(type)){ + + return com.amazon.s3.DeleteObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.SetBucketAccessControlPolicy.class.equals(type)){ + + return com.amazon.s3.SetBucketAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.SetBucketAccessControlPolicyResponse.class.equals(type)){ + + return com.amazon.s3.SetBucketAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.SetObjectAccessControlPolicy.class.equals(type)){ + + return com.amazon.s3.SetObjectAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.SetObjectAccessControlPolicyResponse.class.equals(type)){ + + return com.amazon.s3.SetObjectAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.PutObjectInline.class.equals(type)){ + + return com.amazon.s3.PutObjectInline.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.PutObjectInlineResponse.class.equals(type)){ + + return com.amazon.s3.PutObjectInlineResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.GetObjectExtended.class.equals(type)){ + + return com.amazon.s3.GetObjectExtended.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.GetObjectExtendedResponse.class.equals(type)){ + + return com.amazon.s3.GetObjectExtendedResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + } catch (java.lang.Exception e) { + throw org.apache.axis2.AxisFault.makeFault(e); + } + return null; + } + + + + + + /** + * A utility method that copies the namepaces from the SOAPEnvelope + */ + private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){ + java.util.Map returnMap = new java.util.HashMap(); + java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); + while (namespaceIterator.hasNext()) { + org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); + returnMap.put(ns.getPrefix(),ns.getNamespaceURI()); + } + return returnMap; + } + + private org.apache.axis2.AxisFault createAxisFault(java.lang.Exception e) { + org.apache.axis2.AxisFault f; + Throwable cause = e.getCause(); + if (cause != null) { + f = new org.apache.axis2.AxisFault(e.getMessage(), cause); + } else { + f = new org.apache.axis2.AxisFault(e.getMessage()); + } + + return f; + } + + }//end of class \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/AmazonS3Skeleton.java b/awsapi/src/com/amazon/s3/AmazonS3Skeleton.java index a455aff6ea9..a31c1c24253 100644 --- a/awsapi/src/com/amazon/s3/AmazonS3Skeleton.java +++ b/awsapi/src/com/amazon/s3/AmazonS3Skeleton.java @@ -1,271 +1,287 @@ - -/** - * AmazonS3Skeleton.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) - */ - package com.amazon.s3; - /** - * AmazonS3Skeleton java skeleton for the axisService - */ - public class AmazonS3Skeleton implements AmazonS3SkeletonInterface{ - - - /** - * Auto generated method signature - * - * @param getBucketLoggingStatus0 - */ - - public com.amazon.s3.GetBucketLoggingStatusResponse getBucketLoggingStatus - ( - com.amazon.s3.GetBucketLoggingStatus getBucketLoggingStatus0 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getBucketLoggingStatus"); - } - - - /** - * Auto generated method signature - * - * @param copyObject2 - */ - - public com.amazon.s3.CopyObjectResponse copyObject - ( - com.amazon.s3.CopyObject copyObject2 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#copyObject"); - } - - - /** - * Auto generated method signature - * - * @param getBucketAccessControlPolicy4 - */ - - public com.amazon.s3.GetBucketAccessControlPolicyResponse getBucketAccessControlPolicy - ( - com.amazon.s3.GetBucketAccessControlPolicy getBucketAccessControlPolicy4 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getBucketAccessControlPolicy"); - } - - - /** - * Auto generated method signature - * - * @param listBucket6 - */ - - public com.amazon.s3.ListBucketResponse listBucket - ( - com.amazon.s3.ListBucket listBucket6 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#listBucket"); - } - - - /** - * Auto generated method signature - * - * @param putObject8 - */ - - public com.amazon.s3.PutObjectResponse putObject - ( - com.amazon.s3.PutObject putObject8 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#putObject"); - } - - - /** - * Auto generated method signature - * - * @param createBucket10 - */ - - public com.amazon.s3.CreateBucketResponse createBucket - ( - com.amazon.s3.CreateBucket createBucket10 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#createBucket"); - } - - - /** - * Auto generated method signature - * - * @param listAllMyBuckets12 - */ - - public com.amazon.s3.ListAllMyBucketsResponse listAllMyBuckets - ( - com.amazon.s3.ListAllMyBuckets listAllMyBuckets12 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#listAllMyBuckets"); - } - - - /** - * Auto generated method signature - * - * @param getObject14 - */ - - public com.amazon.s3.GetObjectResponse getObject - ( - com.amazon.s3.GetObject getObject14 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getObject"); - } - - - /** - * Auto generated method signature - * - * @param deleteBucket16 - */ - - public com.amazon.s3.DeleteBucketResponse deleteBucket - ( - com.amazon.s3.DeleteBucket deleteBucket16 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#deleteBucket"); - } - - - /** - * Auto generated method signature - * - * @param setBucketLoggingStatus18 - */ - - public com.amazon.s3.SetBucketLoggingStatusResponse setBucketLoggingStatus - ( - com.amazon.s3.SetBucketLoggingStatus setBucketLoggingStatus18 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#setBucketLoggingStatus"); - } - - - /** - * Auto generated method signature - * - * @param getObjectAccessControlPolicy20 - */ - - public com.amazon.s3.GetObjectAccessControlPolicyResponse getObjectAccessControlPolicy - ( - com.amazon.s3.GetObjectAccessControlPolicy getObjectAccessControlPolicy20 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getObjectAccessControlPolicy"); - } - - - /** - * Auto generated method signature - * - * @param deleteObject22 - */ - - public com.amazon.s3.DeleteObjectResponse deleteObject - ( - com.amazon.s3.DeleteObject deleteObject22 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#deleteObject"); - } - - - /** - * Auto generated method signature - * - * @param setBucketAccessControlPolicy24 - */ - - public com.amazon.s3.SetBucketAccessControlPolicyResponse setBucketAccessControlPolicy - ( - com.amazon.s3.SetBucketAccessControlPolicy setBucketAccessControlPolicy24 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#setBucketAccessControlPolicy"); - } - - - /** - * Auto generated method signature - * - * @param setObjectAccessControlPolicy26 - */ - - public com.amazon.s3.SetObjectAccessControlPolicyResponse setObjectAccessControlPolicy - ( - com.amazon.s3.SetObjectAccessControlPolicy setObjectAccessControlPolicy26 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#setObjectAccessControlPolicy"); - } - - - /** - * Auto generated method signature - * - * @param putObjectInline28 - */ - - public com.amazon.s3.PutObjectInlineResponse putObjectInline - ( - com.amazon.s3.PutObjectInline putObjectInline28 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#putObjectInline"); - } - - - /** - * Auto generated method signature - * - * @param getObjectExtended30 - */ - - public com.amazon.s3.GetObjectExtendedResponse getObjectExtended - ( - com.amazon.s3.GetObjectExtended getObjectExtended30 - ) - { - //TODO : fill this with the necessary business logic - throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getObjectExtended"); - } - - } +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * AmazonS3Skeleton.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) + */ + package com.amazon.s3; + /** + * AmazonS3Skeleton java skeleton for the axisService + */ + public class AmazonS3Skeleton implements AmazonS3SkeletonInterface{ + + + /** + * Auto generated method signature + * + * @param getBucketLoggingStatus0 + */ + + public com.amazon.s3.GetBucketLoggingStatusResponse getBucketLoggingStatus + ( + com.amazon.s3.GetBucketLoggingStatus getBucketLoggingStatus0 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getBucketLoggingStatus"); + } + + + /** + * Auto generated method signature + * + * @param copyObject2 + */ + + public com.amazon.s3.CopyObjectResponse copyObject + ( + com.amazon.s3.CopyObject copyObject2 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#copyObject"); + } + + + /** + * Auto generated method signature + * + * @param getBucketAccessControlPolicy4 + */ + + public com.amazon.s3.GetBucketAccessControlPolicyResponse getBucketAccessControlPolicy + ( + com.amazon.s3.GetBucketAccessControlPolicy getBucketAccessControlPolicy4 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getBucketAccessControlPolicy"); + } + + + /** + * Auto generated method signature + * + * @param listBucket6 + */ + + public com.amazon.s3.ListBucketResponse listBucket + ( + com.amazon.s3.ListBucket listBucket6 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#listBucket"); + } + + + /** + * Auto generated method signature + * + * @param putObject8 + */ + + public com.amazon.s3.PutObjectResponse putObject + ( + com.amazon.s3.PutObject putObject8 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#putObject"); + } + + + /** + * Auto generated method signature + * + * @param createBucket10 + */ + + public com.amazon.s3.CreateBucketResponse createBucket + ( + com.amazon.s3.CreateBucket createBucket10 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#createBucket"); + } + + + /** + * Auto generated method signature + * + * @param listAllMyBuckets12 + */ + + public com.amazon.s3.ListAllMyBucketsResponse listAllMyBuckets + ( + com.amazon.s3.ListAllMyBuckets listAllMyBuckets12 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#listAllMyBuckets"); + } + + + /** + * Auto generated method signature + * + * @param getObject14 + */ + + public com.amazon.s3.GetObjectResponse getObject + ( + com.amazon.s3.GetObject getObject14 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getObject"); + } + + + /** + * Auto generated method signature + * + * @param deleteBucket16 + */ + + public com.amazon.s3.DeleteBucketResponse deleteBucket + ( + com.amazon.s3.DeleteBucket deleteBucket16 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#deleteBucket"); + } + + + /** + * Auto generated method signature + * + * @param setBucketLoggingStatus18 + */ + + public com.amazon.s3.SetBucketLoggingStatusResponse setBucketLoggingStatus + ( + com.amazon.s3.SetBucketLoggingStatus setBucketLoggingStatus18 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#setBucketLoggingStatus"); + } + + + /** + * Auto generated method signature + * + * @param getObjectAccessControlPolicy20 + */ + + public com.amazon.s3.GetObjectAccessControlPolicyResponse getObjectAccessControlPolicy + ( + com.amazon.s3.GetObjectAccessControlPolicy getObjectAccessControlPolicy20 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getObjectAccessControlPolicy"); + } + + + /** + * Auto generated method signature + * + * @param deleteObject22 + */ + + public com.amazon.s3.DeleteObjectResponse deleteObject + ( + com.amazon.s3.DeleteObject deleteObject22 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#deleteObject"); + } + + + /** + * Auto generated method signature + * + * @param setBucketAccessControlPolicy24 + */ + + public com.amazon.s3.SetBucketAccessControlPolicyResponse setBucketAccessControlPolicy + ( + com.amazon.s3.SetBucketAccessControlPolicy setBucketAccessControlPolicy24 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#setBucketAccessControlPolicy"); + } + + + /** + * Auto generated method signature + * + * @param setObjectAccessControlPolicy26 + */ + + public com.amazon.s3.SetObjectAccessControlPolicyResponse setObjectAccessControlPolicy + ( + com.amazon.s3.SetObjectAccessControlPolicy setObjectAccessControlPolicy26 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#setObjectAccessControlPolicy"); + } + + + /** + * Auto generated method signature + * + * @param putObjectInline28 + */ + + public com.amazon.s3.PutObjectInlineResponse putObjectInline + ( + com.amazon.s3.PutObjectInline putObjectInline28 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#putObjectInline"); + } + + + /** + * Auto generated method signature + * + * @param getObjectExtended30 + */ + + public com.amazon.s3.GetObjectExtendedResponse getObjectExtended + ( + com.amazon.s3.GetObjectExtended getObjectExtended30 + ) + { + //TODO : fill this with the necessary business logic + throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#getObjectExtended"); + } + + } \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/AmazonS3SkeletonInterface.java b/awsapi/src/com/amazon/s3/AmazonS3SkeletonInterface.java index 0c45caf7701..c10cbda2422 100644 --- a/awsapi/src/com/amazon/s3/AmazonS3SkeletonInterface.java +++ b/awsapi/src/com/amazon/s3/AmazonS3SkeletonInterface.java @@ -1,242 +1,258 @@ - -/** - * AmazonS3SkeletonInterface.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) - */ - package com.amazon.s3; - -import org.apache.axis2.AxisFault; - /** - * AmazonS3SkeletonInterface java skeleton interface for the axisService - */ - public interface AmazonS3SkeletonInterface { - - - /** - * Auto generated method signature - * - * @param getBucketLoggingStatus - */ - - - public com.amazon.s3.GetBucketLoggingStatusResponse getBucketLoggingStatus - ( - com.amazon.s3.GetBucketLoggingStatus getBucketLoggingStatus - ) - ; - - - /** - * Auto generated method signature - * - * @param copyObject - * @throws AxisFault - */ - - - public com.amazon.s3.CopyObjectResponse copyObject - ( - com.amazon.s3.CopyObject copyObject - ) throws AxisFault - ; - - - /** - * Auto generated method signature - * - * @param getBucketAccessControlPolicy - */ - - - public com.amazon.s3.GetBucketAccessControlPolicyResponse getBucketAccessControlPolicy - ( - com.amazon.s3.GetBucketAccessControlPolicy getBucketAccessControlPolicy - ) - ; - - - /** - * Auto generated method signature - * - * @param listBucket - */ - - - public com.amazon.s3.ListBucketResponse listBucket - ( - com.amazon.s3.ListBucket listBucket - ) - ; - - - /** - * Auto generated method signature - * - * @param putObject - */ - - - public com.amazon.s3.PutObjectResponse putObject - ( - com.amazon.s3.PutObject putObject - ) - ; - - - /** - * Auto generated method signature - * - * @param createBucket - */ - - - public com.amazon.s3.CreateBucketResponse createBucket - ( - com.amazon.s3.CreateBucket createBucket - ) - ; - - - /** - * Auto generated method signature - * - * @param listAllMyBuckets - */ - - - public com.amazon.s3.ListAllMyBucketsResponse listAllMyBuckets - ( - com.amazon.s3.ListAllMyBuckets listAllMyBuckets - ) - ; - - - /** - * Auto generated method signature - * - * @param getObject - */ - - - public com.amazon.s3.GetObjectResponse getObject - ( - com.amazon.s3.GetObject getObject - ) - ; - - - /** - * Auto generated method signature - * - * @param deleteBucket - */ - - - public com.amazon.s3.DeleteBucketResponse deleteBucket - ( - com.amazon.s3.DeleteBucket deleteBucket - ) - ; - - - /** - * Auto generated method signature - * - * @param setBucketLoggingStatus - */ - - - public com.amazon.s3.SetBucketLoggingStatusResponse setBucketLoggingStatus - ( - com.amazon.s3.SetBucketLoggingStatus setBucketLoggingStatus - ) - ; - - - /** - * Auto generated method signature - * - * @param getObjectAccessControlPolicy - */ - - - public com.amazon.s3.GetObjectAccessControlPolicyResponse getObjectAccessControlPolicy - ( - com.amazon.s3.GetObjectAccessControlPolicy getObjectAccessControlPolicy - ) - ; - - - /** - * Auto generated method signature - * - * @param deleteObject - */ - - - public com.amazon.s3.DeleteObjectResponse deleteObject - ( - com.amazon.s3.DeleteObject deleteObject - ) - ; - - - /** - * Auto generated method signature - * - * @param setBucketAccessControlPolicy - */ - - - public com.amazon.s3.SetBucketAccessControlPolicyResponse setBucketAccessControlPolicy - ( - com.amazon.s3.SetBucketAccessControlPolicy setBucketAccessControlPolicy - ) - ; - - - /** - * Auto generated method signature - * - * @param setObjectAccessControlPolicy - */ - - - public com.amazon.s3.SetObjectAccessControlPolicyResponse setObjectAccessControlPolicy - ( - com.amazon.s3.SetObjectAccessControlPolicy setObjectAccessControlPolicy - ) - ; - - - /** - * Auto generated method signature - * - * @param putObjectInline - */ - - - public com.amazon.s3.PutObjectInlineResponse putObjectInline - ( - com.amazon.s3.PutObjectInline putObjectInline - ) - ; - - - /** - * Auto generated method signature - * - * @param getObjectExtended - */ - - - public com.amazon.s3.GetObjectExtendedResponse getObjectExtended - ( - com.amazon.s3.GetObjectExtended getObjectExtended - ) - ; - - } +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * AmazonS3SkeletonInterface.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) + */ + package com.amazon.s3; + +import org.apache.axis2.AxisFault; + /** + * AmazonS3SkeletonInterface java skeleton interface for the axisService + */ + public interface AmazonS3SkeletonInterface { + + + /** + * Auto generated method signature + * + * @param getBucketLoggingStatus + */ + + + public com.amazon.s3.GetBucketLoggingStatusResponse getBucketLoggingStatus + ( + com.amazon.s3.GetBucketLoggingStatus getBucketLoggingStatus + ) + ; + + + /** + * Auto generated method signature + * + * @param copyObject + * @throws AxisFault + */ + + + public com.amazon.s3.CopyObjectResponse copyObject + ( + com.amazon.s3.CopyObject copyObject + ) throws AxisFault + ; + + + /** + * Auto generated method signature + * + * @param getBucketAccessControlPolicy + */ + + + public com.amazon.s3.GetBucketAccessControlPolicyResponse getBucketAccessControlPolicy + ( + com.amazon.s3.GetBucketAccessControlPolicy getBucketAccessControlPolicy + ) + ; + + + /** + * Auto generated method signature + * + * @param listBucket + */ + + + public com.amazon.s3.ListBucketResponse listBucket + ( + com.amazon.s3.ListBucket listBucket + ) + ; + + + /** + * Auto generated method signature + * + * @param putObject + */ + + + public com.amazon.s3.PutObjectResponse putObject + ( + com.amazon.s3.PutObject putObject + ) + ; + + + /** + * Auto generated method signature + * + * @param createBucket + */ + + + public com.amazon.s3.CreateBucketResponse createBucket + ( + com.amazon.s3.CreateBucket createBucket + ) + ; + + + /** + * Auto generated method signature + * + * @param listAllMyBuckets + */ + + + public com.amazon.s3.ListAllMyBucketsResponse listAllMyBuckets + ( + com.amazon.s3.ListAllMyBuckets listAllMyBuckets + ) + ; + + + /** + * Auto generated method signature + * + * @param getObject + */ + + + public com.amazon.s3.GetObjectResponse getObject + ( + com.amazon.s3.GetObject getObject + ) + ; + + + /** + * Auto generated method signature + * + * @param deleteBucket + */ + + + public com.amazon.s3.DeleteBucketResponse deleteBucket + ( + com.amazon.s3.DeleteBucket deleteBucket + ) + ; + + + /** + * Auto generated method signature + * + * @param setBucketLoggingStatus + */ + + + public com.amazon.s3.SetBucketLoggingStatusResponse setBucketLoggingStatus + ( + com.amazon.s3.SetBucketLoggingStatus setBucketLoggingStatus + ) + ; + + + /** + * Auto generated method signature + * + * @param getObjectAccessControlPolicy + */ + + + public com.amazon.s3.GetObjectAccessControlPolicyResponse getObjectAccessControlPolicy + ( + com.amazon.s3.GetObjectAccessControlPolicy getObjectAccessControlPolicy + ) + ; + + + /** + * Auto generated method signature + * + * @param deleteObject + */ + + + public com.amazon.s3.DeleteObjectResponse deleteObject + ( + com.amazon.s3.DeleteObject deleteObject + ) + ; + + + /** + * Auto generated method signature + * + * @param setBucketAccessControlPolicy + */ + + + public com.amazon.s3.SetBucketAccessControlPolicyResponse setBucketAccessControlPolicy + ( + com.amazon.s3.SetBucketAccessControlPolicy setBucketAccessControlPolicy + ) + ; + + + /** + * Auto generated method signature + * + * @param setObjectAccessControlPolicy + */ + + + public com.amazon.s3.SetObjectAccessControlPolicyResponse setObjectAccessControlPolicy + ( + com.amazon.s3.SetObjectAccessControlPolicy setObjectAccessControlPolicy + ) + ; + + + /** + * Auto generated method signature + * + * @param putObjectInline + */ + + + public com.amazon.s3.PutObjectInlineResponse putObjectInline + ( + com.amazon.s3.PutObjectInline putObjectInline + ) + ; + + + /** + * Auto generated method signature + * + * @param getObjectExtended + */ + + + public com.amazon.s3.GetObjectExtendedResponse getObjectExtended + ( + com.amazon.s3.GetObjectExtended getObjectExtended + ) + ; + + } \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/BucketLoggingStatus.java b/awsapi/src/com/amazon/s3/BucketLoggingStatus.java index 67f9425ffc3..38121ed474b 100644 --- a/awsapi/src/com/amazon/s3/BucketLoggingStatus.java +++ b/awsapi/src/com/amazon/s3/BucketLoggingStatus.java @@ -1,465 +1,481 @@ - -/** - * BucketLoggingStatus.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * BucketLoggingStatus bean class - */ - - public class BucketLoggingStatus - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = BucketLoggingStatus - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for LoggingEnabled - */ - - - protected com.amazon.s3.LoggingSettings localLoggingEnabled ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localLoggingEnabledTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.LoggingSettings - */ - public com.amazon.s3.LoggingSettings getLoggingEnabled(){ - return localLoggingEnabled; - } - - - - /** - * Auto generated setter method - * @param param LoggingEnabled - */ - public void setLoggingEnabled(com.amazon.s3.LoggingSettings param){ - - if (param != null){ - //update the setting tracker - localLoggingEnabledTracker = true; - } else { - localLoggingEnabledTracker = false; - - } - - this.localLoggingEnabled=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - BucketLoggingStatus.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":BucketLoggingStatus", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "BucketLoggingStatus", - xmlWriter); - } - - - } - if (localLoggingEnabledTracker){ - if (localLoggingEnabled==null){ - throw new org.apache.axis2.databinding.ADBException("LoggingEnabled cannot be null!!"); - } - localLoggingEnabled.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LoggingEnabled"), - factory,xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localLoggingEnabledTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LoggingEnabled")); - - - if (localLoggingEnabled==null){ - throw new org.apache.axis2.databinding.ADBException("LoggingEnabled cannot be null!!"); - } - elementList.add(localLoggingEnabled); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static BucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - BucketLoggingStatus object = - new BucketLoggingStatus(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"BucketLoggingStatus".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (BucketLoggingStatus)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LoggingEnabled").equals(reader.getName())){ - - object.setLoggingEnabled(com.amazon.s3.LoggingSettings.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * BucketLoggingStatus.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * BucketLoggingStatus bean class + */ + + public class BucketLoggingStatus + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = BucketLoggingStatus + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for LoggingEnabled + */ + + + protected com.amazon.s3.LoggingSettings localLoggingEnabled ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localLoggingEnabledTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.LoggingSettings + */ + public com.amazon.s3.LoggingSettings getLoggingEnabled(){ + return localLoggingEnabled; + } + + + + /** + * Auto generated setter method + * @param param LoggingEnabled + */ + public void setLoggingEnabled(com.amazon.s3.LoggingSettings param){ + + if (param != null){ + //update the setting tracker + localLoggingEnabledTracker = true; + } else { + localLoggingEnabledTracker = false; + + } + + this.localLoggingEnabled=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + BucketLoggingStatus.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":BucketLoggingStatus", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "BucketLoggingStatus", + xmlWriter); + } + + + } + if (localLoggingEnabledTracker){ + if (localLoggingEnabled==null){ + throw new org.apache.axis2.databinding.ADBException("LoggingEnabled cannot be null!!"); + } + localLoggingEnabled.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LoggingEnabled"), + factory,xmlWriter); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localLoggingEnabledTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LoggingEnabled")); + + + if (localLoggingEnabled==null){ + throw new org.apache.axis2.databinding.ADBException("LoggingEnabled cannot be null!!"); + } + elementList.add(localLoggingEnabled); + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static BucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + BucketLoggingStatus object = + new BucketLoggingStatus(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"BucketLoggingStatus".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (BucketLoggingStatus)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LoggingEnabled").equals(reader.getName())){ + + object.setLoggingEnabled(com.amazon.s3.LoggingSettings.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/CanonicalUser.java b/awsapi/src/com/amazon/s3/CanonicalUser.java index ec6ca0c66c6..c95f9af835b 100644 --- a/awsapi/src/com/amazon/s3/CanonicalUser.java +++ b/awsapi/src/com/amazon/s3/CanonicalUser.java @@ -1,587 +1,603 @@ - -/** - * CanonicalUser.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * CanonicalUser bean class - */ - - public class CanonicalUser extends com.amazon.s3.User - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = CanonicalUser - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for ID - */ - - - protected java.lang.String localID ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getID(){ - return localID; - } - - - - /** - * Auto generated setter method - * @param param ID - */ - public void setID(java.lang.String param){ - - this.localID=param; - - - } - - - /** - * field for DisplayName - */ - - - protected java.lang.String localDisplayName ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localDisplayNameTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDisplayName(){ - return localDisplayName; - } - - - - /** - * Auto generated setter method - * @param param DisplayName - */ - public void setDisplayName(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localDisplayNameTracker = true; - } else { - localDisplayNameTracker = false; - - } - - this.localDisplayName=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CanonicalUser.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CanonicalUser", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CanonicalUser", - xmlWriter); - } - - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ID", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ID"); - } - - } else { - xmlWriter.writeStartElement("ID"); - } - - - if (localID==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ID cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localID); - - } - - xmlWriter.writeEndElement(); - if (localDisplayNameTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"DisplayName", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"DisplayName"); - } - - } else { - xmlWriter.writeStartElement("DisplayName"); - } - - - if (localDisplayName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("DisplayName cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDisplayName); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); - attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CanonicalUser")); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ID")); - - if (localID != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localID)); - } else { - throw new org.apache.axis2.databinding.ADBException("ID cannot be null!!"); - } - if (localDisplayNameTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DisplayName")); - - if (localDisplayName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDisplayName)); - } else { - throw new org.apache.axis2.databinding.ADBException("DisplayName cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CanonicalUser parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CanonicalUser object = - new CanonicalUser(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CanonicalUser".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CanonicalUser)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ID").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setID( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DisplayName").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDisplayName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * CanonicalUser.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * CanonicalUser bean class + */ + + public class CanonicalUser extends com.amazon.s3.User + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = CanonicalUser + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for ID + */ + + + protected java.lang.String localID ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getID(){ + return localID; + } + + + + /** + * Auto generated setter method + * @param param ID + */ + public void setID(java.lang.String param){ + + this.localID=param; + + + } + + + /** + * field for DisplayName + */ + + + protected java.lang.String localDisplayName ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localDisplayNameTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDisplayName(){ + return localDisplayName; + } + + + + /** + * Auto generated setter method + * @param param DisplayName + */ + public void setDisplayName(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localDisplayNameTracker = true; + } else { + localDisplayNameTracker = false; + + } + + this.localDisplayName=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CanonicalUser.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CanonicalUser", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CanonicalUser", + xmlWriter); + } + + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ID", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ID"); + } + + } else { + xmlWriter.writeStartElement("ID"); + } + + + if (localID==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ID cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localID); + + } + + xmlWriter.writeEndElement(); + if (localDisplayNameTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"DisplayName", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"DisplayName"); + } + + } else { + xmlWriter.writeStartElement("DisplayName"); + } + + + if (localDisplayName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("DisplayName cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDisplayName); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); + attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CanonicalUser")); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ID")); + + if (localID != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localID)); + } else { + throw new org.apache.axis2.databinding.ADBException("ID cannot be null!!"); + } + if (localDisplayNameTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DisplayName")); + + if (localDisplayName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDisplayName)); + } else { + throw new org.apache.axis2.databinding.ADBException("DisplayName cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CanonicalUser parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CanonicalUser object = + new CanonicalUser(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CanonicalUser".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CanonicalUser)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ID").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setID( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DisplayName").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDisplayName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/CopyObject.java b/awsapi/src/com/amazon/s3/CopyObject.java index 31f8e9e3dfd..fa5dbb707c7 100644 --- a/awsapi/src/com/amazon/s3/CopyObject.java +++ b/awsapi/src/com/amazon/s3/CopyObject.java @@ -1,2183 +1,2199 @@ - -/** - * CopyObject.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * CopyObject bean class - */ - - public class CopyObject - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "CopyObject", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for SourceBucket - */ - - - protected java.lang.String localSourceBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSourceBucket(){ - return localSourceBucket; - } - - - - /** - * Auto generated setter method - * @param param SourceBucket - */ - public void setSourceBucket(java.lang.String param){ - - this.localSourceBucket=param; - - - } - - - /** - * field for SourceKey - */ - - - protected java.lang.String localSourceKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSourceKey(){ - return localSourceKey; - } - - - - /** - * Auto generated setter method - * @param param SourceKey - */ - public void setSourceKey(java.lang.String param){ - - this.localSourceKey=param; - - - } - - - /** - * field for DestinationBucket - */ - - - protected java.lang.String localDestinationBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDestinationBucket(){ - return localDestinationBucket; - } - - - - /** - * Auto generated setter method - * @param param DestinationBucket - */ - public void setDestinationBucket(java.lang.String param){ - - this.localDestinationBucket=param; - - - } - - - /** - * field for DestinationKey - */ - - - protected java.lang.String localDestinationKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDestinationKey(){ - return localDestinationKey; - } - - - - /** - * Auto generated setter method - * @param param DestinationKey - */ - public void setDestinationKey(java.lang.String param){ - - this.localDestinationKey=param; - - - } - - - /** - * field for MetadataDirective - */ - - - protected com.amazon.s3.MetadataDirective localMetadataDirective ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataDirectiveTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.MetadataDirective - */ - public com.amazon.s3.MetadataDirective getMetadataDirective(){ - return localMetadataDirective; - } - - - - /** - * Auto generated setter method - * @param param MetadataDirective - */ - public void setMetadataDirective(com.amazon.s3.MetadataDirective param){ - - if (param != null){ - //update the setting tracker - localMetadataDirectiveTracker = true; - } else { - localMetadataDirectiveTracker = false; - - } - - this.localMetadataDirective=param; - - - } - - - /** - * field for Metadata - * This was an Array! - */ - - - protected com.amazon.s3.MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.MetadataEntry[] - */ - public com.amazon.s3.MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(com.amazon.s3.MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.MetadataEntry - */ - public void addMetadata(com.amazon.s3.MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new com.amazon.s3.MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (com.amazon.s3.MetadataEntry[])list.toArray( - new com.amazon.s3.MetadataEntry[list.size()]); - - } - - - /** - * field for AccessControlList - */ - - - protected com.amazon.s3.AccessControlList localAccessControlList ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAccessControlListTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.AccessControlList - */ - public com.amazon.s3.AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(com.amazon.s3.AccessControlList param){ - - if (param != null){ - //update the setting tracker - localAccessControlListTracker = true; - } else { - localAccessControlListTracker = false; - - } - - this.localAccessControlList=param; - - - } - - - /** - * field for CopySourceIfModifiedSince - */ - - - protected java.util.Calendar localCopySourceIfModifiedSince ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCopySourceIfModifiedSinceTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getCopySourceIfModifiedSince(){ - return localCopySourceIfModifiedSince; - } - - - - /** - * Auto generated setter method - * @param param CopySourceIfModifiedSince - */ - public void setCopySourceIfModifiedSince(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localCopySourceIfModifiedSinceTracker = true; - } else { - localCopySourceIfModifiedSinceTracker = false; - - } - - this.localCopySourceIfModifiedSince=param; - - - } - - - /** - * field for CopySourceIfUnmodifiedSince - */ - - - protected java.util.Calendar localCopySourceIfUnmodifiedSince ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCopySourceIfUnmodifiedSinceTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getCopySourceIfUnmodifiedSince(){ - return localCopySourceIfUnmodifiedSince; - } - - - - /** - * Auto generated setter method - * @param param CopySourceIfUnmodifiedSince - */ - public void setCopySourceIfUnmodifiedSince(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localCopySourceIfUnmodifiedSinceTracker = true; - } else { - localCopySourceIfUnmodifiedSinceTracker = false; - - } - - this.localCopySourceIfUnmodifiedSince=param; - - - } - - - /** - * field for CopySourceIfMatch - * This was an Array! - */ - - - protected java.lang.String[] localCopySourceIfMatch ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCopySourceIfMatchTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String[] - */ - public java.lang.String[] getCopySourceIfMatch(){ - return localCopySourceIfMatch; - } - - - - - - - /** - * validate the array for CopySourceIfMatch - */ - protected void validateCopySourceIfMatch(java.lang.String[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param CopySourceIfMatch - */ - public void setCopySourceIfMatch(java.lang.String[] param){ - - validateCopySourceIfMatch(param); - - - if (param != null){ - //update the setting tracker - localCopySourceIfMatchTracker = true; - } else { - localCopySourceIfMatchTracker = false; - - } - - this.localCopySourceIfMatch=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param java.lang.String - */ - public void addCopySourceIfMatch(java.lang.String param){ - if (localCopySourceIfMatch == null){ - localCopySourceIfMatch = new java.lang.String[]{}; - } - - - //update the setting tracker - localCopySourceIfMatchTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localCopySourceIfMatch); - list.add(param); - this.localCopySourceIfMatch = - (java.lang.String[])list.toArray( - new java.lang.String[list.size()]); - - } - - - /** - * field for CopySourceIfNoneMatch - * This was an Array! - */ - - - protected java.lang.String[] localCopySourceIfNoneMatch ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCopySourceIfNoneMatchTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String[] - */ - public java.lang.String[] getCopySourceIfNoneMatch(){ - return localCopySourceIfNoneMatch; - } - - - - - - - /** - * validate the array for CopySourceIfNoneMatch - */ - protected void validateCopySourceIfNoneMatch(java.lang.String[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param CopySourceIfNoneMatch - */ - public void setCopySourceIfNoneMatch(java.lang.String[] param){ - - validateCopySourceIfNoneMatch(param); - - - if (param != null){ - //update the setting tracker - localCopySourceIfNoneMatchTracker = true; - } else { - localCopySourceIfNoneMatchTracker = false; - - } - - this.localCopySourceIfNoneMatch=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param java.lang.String - */ - public void addCopySourceIfNoneMatch(java.lang.String param){ - if (localCopySourceIfNoneMatch == null){ - localCopySourceIfNoneMatch = new java.lang.String[]{}; - } - - - //update the setting tracker - localCopySourceIfNoneMatchTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localCopySourceIfNoneMatch); - list.add(param); - this.localCopySourceIfNoneMatch = - (java.lang.String[])list.toArray( - new java.lang.String[list.size()]); - - } - - - /** - * field for StorageClass - */ - - - protected com.amazon.s3.StorageClass localStorageClass ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localStorageClassTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.StorageClass - */ - public com.amazon.s3.StorageClass getStorageClass(){ - return localStorageClass; - } - - - - /** - * Auto generated setter method - * @param param StorageClass - */ - public void setStorageClass(com.amazon.s3.StorageClass param){ - - if (param != null){ - //update the setting tracker - localStorageClassTracker = true; - } else { - localStorageClassTracker = false; - - } - - this.localStorageClass=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CopyObject.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CopyObject", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CopyObject", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"SourceBucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"SourceBucket"); - } - - } else { - xmlWriter.writeStartElement("SourceBucket"); - } - - - if (localSourceBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("SourceBucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSourceBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"SourceKey", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"SourceKey"); - } - - } else { - xmlWriter.writeStartElement("SourceKey"); - } - - - if (localSourceKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("SourceKey cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSourceKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"DestinationBucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"DestinationBucket"); - } - - } else { - xmlWriter.writeStartElement("DestinationBucket"); - } - - - if (localDestinationBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("DestinationBucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDestinationBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"DestinationKey", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"DestinationKey"); - } - - } else { - xmlWriter.writeStartElement("DestinationKey"); - } - - - if (localDestinationKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("DestinationKey cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDestinationKey); - - } - - xmlWriter.writeEndElement(); - if (localMetadataDirectiveTracker){ - if (localMetadataDirective==null){ - throw new org.apache.axis2.databinding.ADBException("MetadataDirective cannot be null!!"); - } - localMetadataDirective.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MetadataDirective"), - factory,xmlWriter); - } if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } if (localAccessControlListTracker){ - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - } if (localCopySourceIfModifiedSinceTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"CopySourceIfModifiedSince", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"CopySourceIfModifiedSince"); - } - - } else { - xmlWriter.writeStartElement("CopySourceIfModifiedSince"); - } - - - if (localCopySourceIfModifiedSince==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfModifiedSince cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfModifiedSince)); - - } - - xmlWriter.writeEndElement(); - } if (localCopySourceIfUnmodifiedSinceTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"CopySourceIfUnmodifiedSince", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"CopySourceIfUnmodifiedSince"); - } - - } else { - xmlWriter.writeStartElement("CopySourceIfUnmodifiedSince"); - } - - - if (localCopySourceIfUnmodifiedSince==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfUnmodifiedSince cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfUnmodifiedSince)); - - } - - xmlWriter.writeEndElement(); - } if (localCopySourceIfMatchTracker){ - if (localCopySourceIfMatch!=null) { - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - boolean emptyNamespace = namespace == null || namespace.length() == 0; - prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); - for (int i = 0;i < localCopySourceIfMatch.length;i++){ - - if (localCopySourceIfMatch[i] != null){ - - if (!emptyNamespace) { - if (prefix == null) { - java.lang.String prefix2 = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix2,"CopySourceIfMatch", namespace); - xmlWriter.writeNamespace(prefix2, namespace); - xmlWriter.setPrefix(prefix2, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"CopySourceIfMatch"); - } - - } else { - xmlWriter.writeStartElement("CopySourceIfMatch"); - } - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfMatch[i])); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfMatch cannot be null!!"); - - } - - } if (localCopySourceIfNoneMatchTracker){ - if (localCopySourceIfNoneMatch!=null) { - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - boolean emptyNamespace = namespace == null || namespace.length() == 0; - prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); - for (int i = 0;i < localCopySourceIfNoneMatch.length;i++){ - - if (localCopySourceIfNoneMatch[i] != null){ - - if (!emptyNamespace) { - if (prefix == null) { - java.lang.String prefix2 = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix2,"CopySourceIfNoneMatch", namespace); - xmlWriter.writeNamespace(prefix2, namespace); - xmlWriter.setPrefix(prefix2, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"CopySourceIfNoneMatch"); - } - - } else { - xmlWriter.writeStartElement("CopySourceIfNoneMatch"); - } - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfNoneMatch[i])); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfNoneMatch cannot be null!!"); - - } - - } if (localStorageClassTracker){ - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), - factory,xmlWriter); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "SourceBucket")); - - if (localSourceBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSourceBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("SourceBucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "SourceKey")); - - if (localSourceKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSourceKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("SourceKey cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DestinationBucket")); - - if (localDestinationBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDestinationBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("DestinationBucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DestinationKey")); - - if (localDestinationKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDestinationKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("DestinationKey cannot be null!!"); - } - if (localMetadataDirectiveTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "MetadataDirective")); - - - if (localMetadataDirective==null){ - throw new org.apache.axis2.databinding.ADBException("MetadataDirective cannot be null!!"); - } - elementList.add(localMetadataDirective); - } if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } if (localAccessControlListTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - } if (localCopySourceIfModifiedSinceTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CopySourceIfModifiedSince")); - - if (localCopySourceIfModifiedSince != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfModifiedSince)); - } else { - throw new org.apache.axis2.databinding.ADBException("CopySourceIfModifiedSince cannot be null!!"); - } - } if (localCopySourceIfUnmodifiedSinceTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CopySourceIfUnmodifiedSince")); - - if (localCopySourceIfUnmodifiedSince != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfUnmodifiedSince)); - } else { - throw new org.apache.axis2.databinding.ADBException("CopySourceIfUnmodifiedSince cannot be null!!"); - } - } if (localCopySourceIfMatchTracker){ - if (localCopySourceIfMatch!=null){ - for (int i = 0;i < localCopySourceIfMatch.length;i++){ - - if (localCopySourceIfMatch[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CopySourceIfMatch")); - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfMatch[i])); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfMatch cannot be null!!"); - - } - - } if (localCopySourceIfNoneMatchTracker){ - if (localCopySourceIfNoneMatch!=null){ - for (int i = 0;i < localCopySourceIfNoneMatch.length;i++){ - - if (localCopySourceIfNoneMatch[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CopySourceIfNoneMatch")); - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfNoneMatch[i])); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfNoneMatch cannot be null!!"); - - } - - } if (localStorageClassTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass")); - - - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - elementList.add(localStorageClass); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CopyObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CopyObject object = - new CopyObject(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CopyObject".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CopyObject)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list6 = new java.util.ArrayList(); - - java.util.ArrayList list10 = new java.util.ArrayList(); - - java.util.ArrayList list11 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","SourceBucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSourceBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","SourceKey").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSourceKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DestinationBucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDestinationBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DestinationKey").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDestinationKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MetadataDirective").equals(reader.getName())){ - - object.setMetadataDirective(com.amazon.s3.MetadataDirective.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list6.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone6 = false; - while(!loopDone6){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone6 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list6.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone6 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((com.amazon.s3.MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.MetadataEntry.class, - list6)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfModifiedSince").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCopySourceIfModifiedSince( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfUnmodifiedSince").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCopySourceIfUnmodifiedSince( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfMatch").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list10.add(reader.getElementText()); - - //loop until we find a start element that is not part of this array - boolean loopDone10 = false; - while(!loopDone10){ - // Ensure we are at the EndElement - while (!reader.isEndElement()){ - reader.next(); - } - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone10 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfMatch").equals(reader.getName())){ - list10.add(reader.getElementText()); - - }else{ - loopDone10 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCopySourceIfMatch((java.lang.String[]) - list10.toArray(new java.lang.String[list10.size()])); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfNoneMatch").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list11.add(reader.getElementText()); - - //loop until we find a start element that is not part of this array - boolean loopDone11 = false; - while(!loopDone11){ - // Ensure we are at the EndElement - while (!reader.isEndElement()){ - reader.next(); - } - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone11 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfNoneMatch").equals(reader.getName())){ - list11.add(reader.getElementText()); - - }else{ - loopDone11 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCopySourceIfNoneMatch((java.lang.String[]) - list11.toArray(new java.lang.String[list11.size()])); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ - - object.setStorageClass(com.amazon.s3.StorageClass.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * CopyObject.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * CopyObject bean class + */ + + public class CopyObject + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "CopyObject", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for SourceBucket + */ + + + protected java.lang.String localSourceBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSourceBucket(){ + return localSourceBucket; + } + + + + /** + * Auto generated setter method + * @param param SourceBucket + */ + public void setSourceBucket(java.lang.String param){ + + this.localSourceBucket=param; + + + } + + + /** + * field for SourceKey + */ + + + protected java.lang.String localSourceKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSourceKey(){ + return localSourceKey; + } + + + + /** + * Auto generated setter method + * @param param SourceKey + */ + public void setSourceKey(java.lang.String param){ + + this.localSourceKey=param; + + + } + + + /** + * field for DestinationBucket + */ + + + protected java.lang.String localDestinationBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDestinationBucket(){ + return localDestinationBucket; + } + + + + /** + * Auto generated setter method + * @param param DestinationBucket + */ + public void setDestinationBucket(java.lang.String param){ + + this.localDestinationBucket=param; + + + } + + + /** + * field for DestinationKey + */ + + + protected java.lang.String localDestinationKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDestinationKey(){ + return localDestinationKey; + } + + + + /** + * Auto generated setter method + * @param param DestinationKey + */ + public void setDestinationKey(java.lang.String param){ + + this.localDestinationKey=param; + + + } + + + /** + * field for MetadataDirective + */ + + + protected com.amazon.s3.MetadataDirective localMetadataDirective ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataDirectiveTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.MetadataDirective + */ + public com.amazon.s3.MetadataDirective getMetadataDirective(){ + return localMetadataDirective; + } + + + + /** + * Auto generated setter method + * @param param MetadataDirective + */ + public void setMetadataDirective(com.amazon.s3.MetadataDirective param){ + + if (param != null){ + //update the setting tracker + localMetadataDirectiveTracker = true; + } else { + localMetadataDirectiveTracker = false; + + } + + this.localMetadataDirective=param; + + + } + + + /** + * field for Metadata + * This was an Array! + */ + + + protected com.amazon.s3.MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.MetadataEntry[] + */ + public com.amazon.s3.MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(com.amazon.s3.MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.MetadataEntry + */ + public void addMetadata(com.amazon.s3.MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new com.amazon.s3.MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (com.amazon.s3.MetadataEntry[])list.toArray( + new com.amazon.s3.MetadataEntry[list.size()]); + + } + + + /** + * field for AccessControlList + */ + + + protected com.amazon.s3.AccessControlList localAccessControlList ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAccessControlListTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.AccessControlList + */ + public com.amazon.s3.AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(com.amazon.s3.AccessControlList param){ + + if (param != null){ + //update the setting tracker + localAccessControlListTracker = true; + } else { + localAccessControlListTracker = false; + + } + + this.localAccessControlList=param; + + + } + + + /** + * field for CopySourceIfModifiedSince + */ + + + protected java.util.Calendar localCopySourceIfModifiedSince ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCopySourceIfModifiedSinceTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getCopySourceIfModifiedSince(){ + return localCopySourceIfModifiedSince; + } + + + + /** + * Auto generated setter method + * @param param CopySourceIfModifiedSince + */ + public void setCopySourceIfModifiedSince(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localCopySourceIfModifiedSinceTracker = true; + } else { + localCopySourceIfModifiedSinceTracker = false; + + } + + this.localCopySourceIfModifiedSince=param; + + + } + + + /** + * field for CopySourceIfUnmodifiedSince + */ + + + protected java.util.Calendar localCopySourceIfUnmodifiedSince ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCopySourceIfUnmodifiedSinceTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getCopySourceIfUnmodifiedSince(){ + return localCopySourceIfUnmodifiedSince; + } + + + + /** + * Auto generated setter method + * @param param CopySourceIfUnmodifiedSince + */ + public void setCopySourceIfUnmodifiedSince(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localCopySourceIfUnmodifiedSinceTracker = true; + } else { + localCopySourceIfUnmodifiedSinceTracker = false; + + } + + this.localCopySourceIfUnmodifiedSince=param; + + + } + + + /** + * field for CopySourceIfMatch + * This was an Array! + */ + + + protected java.lang.String[] localCopySourceIfMatch ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCopySourceIfMatchTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String[] + */ + public java.lang.String[] getCopySourceIfMatch(){ + return localCopySourceIfMatch; + } + + + + + + + /** + * validate the array for CopySourceIfMatch + */ + protected void validateCopySourceIfMatch(java.lang.String[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param CopySourceIfMatch + */ + public void setCopySourceIfMatch(java.lang.String[] param){ + + validateCopySourceIfMatch(param); + + + if (param != null){ + //update the setting tracker + localCopySourceIfMatchTracker = true; + } else { + localCopySourceIfMatchTracker = false; + + } + + this.localCopySourceIfMatch=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param java.lang.String + */ + public void addCopySourceIfMatch(java.lang.String param){ + if (localCopySourceIfMatch == null){ + localCopySourceIfMatch = new java.lang.String[]{}; + } + + + //update the setting tracker + localCopySourceIfMatchTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localCopySourceIfMatch); + list.add(param); + this.localCopySourceIfMatch = + (java.lang.String[])list.toArray( + new java.lang.String[list.size()]); + + } + + + /** + * field for CopySourceIfNoneMatch + * This was an Array! + */ + + + protected java.lang.String[] localCopySourceIfNoneMatch ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCopySourceIfNoneMatchTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String[] + */ + public java.lang.String[] getCopySourceIfNoneMatch(){ + return localCopySourceIfNoneMatch; + } + + + + + + + /** + * validate the array for CopySourceIfNoneMatch + */ + protected void validateCopySourceIfNoneMatch(java.lang.String[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param CopySourceIfNoneMatch + */ + public void setCopySourceIfNoneMatch(java.lang.String[] param){ + + validateCopySourceIfNoneMatch(param); + + + if (param != null){ + //update the setting tracker + localCopySourceIfNoneMatchTracker = true; + } else { + localCopySourceIfNoneMatchTracker = false; + + } + + this.localCopySourceIfNoneMatch=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param java.lang.String + */ + public void addCopySourceIfNoneMatch(java.lang.String param){ + if (localCopySourceIfNoneMatch == null){ + localCopySourceIfNoneMatch = new java.lang.String[]{}; + } + + + //update the setting tracker + localCopySourceIfNoneMatchTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localCopySourceIfNoneMatch); + list.add(param); + this.localCopySourceIfNoneMatch = + (java.lang.String[])list.toArray( + new java.lang.String[list.size()]); + + } + + + /** + * field for StorageClass + */ + + + protected com.amazon.s3.StorageClass localStorageClass ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localStorageClassTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.StorageClass + */ + public com.amazon.s3.StorageClass getStorageClass(){ + return localStorageClass; + } + + + + /** + * Auto generated setter method + * @param param StorageClass + */ + public void setStorageClass(com.amazon.s3.StorageClass param){ + + if (param != null){ + //update the setting tracker + localStorageClassTracker = true; + } else { + localStorageClassTracker = false; + + } + + this.localStorageClass=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CopyObject.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CopyObject", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CopyObject", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"SourceBucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"SourceBucket"); + } + + } else { + xmlWriter.writeStartElement("SourceBucket"); + } + + + if (localSourceBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("SourceBucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSourceBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"SourceKey", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"SourceKey"); + } + + } else { + xmlWriter.writeStartElement("SourceKey"); + } + + + if (localSourceKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("SourceKey cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSourceKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"DestinationBucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"DestinationBucket"); + } + + } else { + xmlWriter.writeStartElement("DestinationBucket"); + } + + + if (localDestinationBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("DestinationBucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDestinationBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"DestinationKey", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"DestinationKey"); + } + + } else { + xmlWriter.writeStartElement("DestinationKey"); + } + + + if (localDestinationKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("DestinationKey cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDestinationKey); + + } + + xmlWriter.writeEndElement(); + if (localMetadataDirectiveTracker){ + if (localMetadataDirective==null){ + throw new org.apache.axis2.databinding.ADBException("MetadataDirective cannot be null!!"); + } + localMetadataDirective.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MetadataDirective"), + factory,xmlWriter); + } if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } if (localAccessControlListTracker){ + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + } if (localCopySourceIfModifiedSinceTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"CopySourceIfModifiedSince", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"CopySourceIfModifiedSince"); + } + + } else { + xmlWriter.writeStartElement("CopySourceIfModifiedSince"); + } + + + if (localCopySourceIfModifiedSince==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfModifiedSince cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfModifiedSince)); + + } + + xmlWriter.writeEndElement(); + } if (localCopySourceIfUnmodifiedSinceTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"CopySourceIfUnmodifiedSince", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"CopySourceIfUnmodifiedSince"); + } + + } else { + xmlWriter.writeStartElement("CopySourceIfUnmodifiedSince"); + } + + + if (localCopySourceIfUnmodifiedSince==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfUnmodifiedSince cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfUnmodifiedSince)); + + } + + xmlWriter.writeEndElement(); + } if (localCopySourceIfMatchTracker){ + if (localCopySourceIfMatch!=null) { + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + boolean emptyNamespace = namespace == null || namespace.length() == 0; + prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); + for (int i = 0;i < localCopySourceIfMatch.length;i++){ + + if (localCopySourceIfMatch[i] != null){ + + if (!emptyNamespace) { + if (prefix == null) { + java.lang.String prefix2 = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix2,"CopySourceIfMatch", namespace); + xmlWriter.writeNamespace(prefix2, namespace); + xmlWriter.setPrefix(prefix2, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"CopySourceIfMatch"); + } + + } else { + xmlWriter.writeStartElement("CopySourceIfMatch"); + } + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfMatch[i])); + + xmlWriter.writeEndElement(); + + } else { + + // we have to do nothing since minOccurs is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfMatch cannot be null!!"); + + } + + } if (localCopySourceIfNoneMatchTracker){ + if (localCopySourceIfNoneMatch!=null) { + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + boolean emptyNamespace = namespace == null || namespace.length() == 0; + prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); + for (int i = 0;i < localCopySourceIfNoneMatch.length;i++){ + + if (localCopySourceIfNoneMatch[i] != null){ + + if (!emptyNamespace) { + if (prefix == null) { + java.lang.String prefix2 = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix2,"CopySourceIfNoneMatch", namespace); + xmlWriter.writeNamespace(prefix2, namespace); + xmlWriter.setPrefix(prefix2, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"CopySourceIfNoneMatch"); + } + + } else { + xmlWriter.writeStartElement("CopySourceIfNoneMatch"); + } + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfNoneMatch[i])); + + xmlWriter.writeEndElement(); + + } else { + + // we have to do nothing since minOccurs is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfNoneMatch cannot be null!!"); + + } + + } if (localStorageClassTracker){ + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), + factory,xmlWriter); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "SourceBucket")); + + if (localSourceBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSourceBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("SourceBucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "SourceKey")); + + if (localSourceKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSourceKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("SourceKey cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DestinationBucket")); + + if (localDestinationBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDestinationBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("DestinationBucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DestinationKey")); + + if (localDestinationKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDestinationKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("DestinationKey cannot be null!!"); + } + if (localMetadataDirectiveTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "MetadataDirective")); + + + if (localMetadataDirective==null){ + throw new org.apache.axis2.databinding.ADBException("MetadataDirective cannot be null!!"); + } + elementList.add(localMetadataDirective); + } if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } if (localAccessControlListTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + } if (localCopySourceIfModifiedSinceTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CopySourceIfModifiedSince")); + + if (localCopySourceIfModifiedSince != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfModifiedSince)); + } else { + throw new org.apache.axis2.databinding.ADBException("CopySourceIfModifiedSince cannot be null!!"); + } + } if (localCopySourceIfUnmodifiedSinceTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CopySourceIfUnmodifiedSince")); + + if (localCopySourceIfUnmodifiedSince != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfUnmodifiedSince)); + } else { + throw new org.apache.axis2.databinding.ADBException("CopySourceIfUnmodifiedSince cannot be null!!"); + } + } if (localCopySourceIfMatchTracker){ + if (localCopySourceIfMatch!=null){ + for (int i = 0;i < localCopySourceIfMatch.length;i++){ + + if (localCopySourceIfMatch[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CopySourceIfMatch")); + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfMatch[i])); + } else { + + // have to do nothing + + } + + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfMatch cannot be null!!"); + + } + + } if (localCopySourceIfNoneMatchTracker){ + if (localCopySourceIfNoneMatch!=null){ + for (int i = 0;i < localCopySourceIfNoneMatch.length;i++){ + + if (localCopySourceIfNoneMatch[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CopySourceIfNoneMatch")); + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfNoneMatch[i])); + } else { + + // have to do nothing + + } + + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfNoneMatch cannot be null!!"); + + } + + } if (localStorageClassTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass")); + + + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + elementList.add(localStorageClass); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CopyObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CopyObject object = + new CopyObject(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CopyObject".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CopyObject)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list6 = new java.util.ArrayList(); + + java.util.ArrayList list10 = new java.util.ArrayList(); + + java.util.ArrayList list11 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","SourceBucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSourceBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","SourceKey").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSourceKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DestinationBucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDestinationBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DestinationKey").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDestinationKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MetadataDirective").equals(reader.getName())){ + + object.setMetadataDirective(com.amazon.s3.MetadataDirective.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list6.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone6 = false; + while(!loopDone6){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone6 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list6.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone6 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((com.amazon.s3.MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.MetadataEntry.class, + list6)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfModifiedSince").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCopySourceIfModifiedSince( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfUnmodifiedSince").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCopySourceIfUnmodifiedSince( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfMatch").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list10.add(reader.getElementText()); + + //loop until we find a start element that is not part of this array + boolean loopDone10 = false; + while(!loopDone10){ + // Ensure we are at the EndElement + while (!reader.isEndElement()){ + reader.next(); + } + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone10 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfMatch").equals(reader.getName())){ + list10.add(reader.getElementText()); + + }else{ + loopDone10 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setCopySourceIfMatch((java.lang.String[]) + list10.toArray(new java.lang.String[list10.size()])); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfNoneMatch").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list11.add(reader.getElementText()); + + //loop until we find a start element that is not part of this array + boolean loopDone11 = false; + while(!loopDone11){ + // Ensure we are at the EndElement + while (!reader.isEndElement()){ + reader.next(); + } + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone11 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfNoneMatch").equals(reader.getName())){ + list11.add(reader.getElementText()); + + }else{ + loopDone11 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setCopySourceIfNoneMatch((java.lang.String[]) + list11.toArray(new java.lang.String[list11.size()])); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ + + object.setStorageClass(com.amazon.s3.StorageClass.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/CopyObjectResponse.java b/awsapi/src/com/amazon/s3/CopyObjectResponse.java index c0096cccc4d..c3c311cf7f7 100644 --- a/awsapi/src/com/amazon/s3/CopyObjectResponse.java +++ b/awsapi/src/com/amazon/s3/CopyObjectResponse.java @@ -1,453 +1,469 @@ - -/** - * CopyObjectResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * CopyObjectResponse bean class - */ - - public class CopyObjectResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "CopyObjectResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for CopyObjectResult - */ - - - protected com.amazon.s3.CopyObjectResult localCopyObjectResult ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.CopyObjectResult - */ - public com.amazon.s3.CopyObjectResult getCopyObjectResult(){ - return localCopyObjectResult; - } - - - - /** - * Auto generated setter method - * @param param CopyObjectResult - */ - public void setCopyObjectResult(com.amazon.s3.CopyObjectResult param){ - - this.localCopyObjectResult=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CopyObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CopyObjectResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CopyObjectResponse", - xmlWriter); - } - - - } - - if (localCopyObjectResult==null){ - throw new org.apache.axis2.databinding.ADBException("CopyObjectResult cannot be null!!"); - } - localCopyObjectResult.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopyObjectResult"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CopyObjectResult")); - - - if (localCopyObjectResult==null){ - throw new org.apache.axis2.databinding.ADBException("CopyObjectResult cannot be null!!"); - } - elementList.add(localCopyObjectResult); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CopyObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CopyObjectResponse object = - new CopyObjectResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CopyObjectResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CopyObjectResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopyObjectResult").equals(reader.getName())){ - - object.setCopyObjectResult(com.amazon.s3.CopyObjectResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * CopyObjectResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * CopyObjectResponse bean class + */ + + public class CopyObjectResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "CopyObjectResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for CopyObjectResult + */ + + + protected com.amazon.s3.CopyObjectResult localCopyObjectResult ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.CopyObjectResult + */ + public com.amazon.s3.CopyObjectResult getCopyObjectResult(){ + return localCopyObjectResult; + } + + + + /** + * Auto generated setter method + * @param param CopyObjectResult + */ + public void setCopyObjectResult(com.amazon.s3.CopyObjectResult param){ + + this.localCopyObjectResult=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CopyObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CopyObjectResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CopyObjectResponse", + xmlWriter); + } + + + } + + if (localCopyObjectResult==null){ + throw new org.apache.axis2.databinding.ADBException("CopyObjectResult cannot be null!!"); + } + localCopyObjectResult.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopyObjectResult"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CopyObjectResult")); + + + if (localCopyObjectResult==null){ + throw new org.apache.axis2.databinding.ADBException("CopyObjectResult cannot be null!!"); + } + elementList.add(localCopyObjectResult); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CopyObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CopyObjectResponse object = + new CopyObjectResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CopyObjectResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CopyObjectResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopyObjectResult").equals(reader.getName())){ + + object.setCopyObjectResult(com.amazon.s3.CopyObjectResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/CopyObjectResult.java b/awsapi/src/com/amazon/s3/CopyObjectResult.java index fa32cc27c8c..c67b8824c8f 100644 --- a/awsapi/src/com/amazon/s3/CopyObjectResult.java +++ b/awsapi/src/com/amazon/s3/CopyObjectResult.java @@ -1,575 +1,591 @@ - -/** - * CopyObjectResult.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * CopyObjectResult bean class - */ - - public class CopyObjectResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = CopyObjectResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for LastModified - */ - - - protected java.util.Calendar localLastModified ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getLastModified(){ - return localLastModified; - } - - - - /** - * Auto generated setter method - * @param param LastModified - */ - public void setLastModified(java.util.Calendar param){ - - this.localLastModified=param; - - - } - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CopyObjectResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CopyObjectResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CopyObjectResult", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"LastModified", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"LastModified"); - } - - } else { - xmlWriter.writeStartElement("LastModified"); - } - - - if (localLastModified==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LastModified")); - - if (localLastModified != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - } else { - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CopyObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CopyObjectResult object = - new CopyObjectResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CopyObjectResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CopyObjectResult)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLastModified( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * CopyObjectResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * CopyObjectResult bean class + */ + + public class CopyObjectResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = CopyObjectResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for LastModified + */ + + + protected java.util.Calendar localLastModified ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getLastModified(){ + return localLastModified; + } + + + + /** + * Auto generated setter method + * @param param LastModified + */ + public void setLastModified(java.util.Calendar param){ + + this.localLastModified=param; + + + } + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CopyObjectResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CopyObjectResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CopyObjectResult", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"LastModified", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"LastModified"); + } + + } else { + xmlWriter.writeStartElement("LastModified"); + } + + + if (localLastModified==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LastModified")); + + if (localLastModified != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + } else { + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CopyObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CopyObjectResult object = + new CopyObjectResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CopyObjectResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CopyObjectResult)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLastModified( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/CreateBucket.java b/awsapi/src/com/amazon/s3/CreateBucket.java index acc22702024..8860bbc2649 100644 --- a/awsapi/src/com/amazon/s3/CreateBucket.java +++ b/awsapi/src/com/amazon/s3/CreateBucket.java @@ -1,873 +1,889 @@ - -/** - * CreateBucket.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * CreateBucket bean class - */ - - public class CreateBucket - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "CreateBucket", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected com.amazon.s3.AccessControlList localAccessControlList ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAccessControlListTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.AccessControlList - */ - public com.amazon.s3.AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(com.amazon.s3.AccessControlList param){ - - if (param != null){ - //update the setting tracker - localAccessControlListTracker = true; - } else { - localAccessControlListTracker = false; - - } - - this.localAccessControlList=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CreateBucket.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CreateBucket", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CreateBucket", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAccessControlListTracker){ - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAccessControlListTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CreateBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CreateBucket object = - new CreateBucket(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CreateBucket".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CreateBucket)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * CreateBucket.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * CreateBucket bean class + */ + + public class CreateBucket + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "CreateBucket", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected com.amazon.s3.AccessControlList localAccessControlList ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAccessControlListTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.AccessControlList + */ + public com.amazon.s3.AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(com.amazon.s3.AccessControlList param){ + + if (param != null){ + //update the setting tracker + localAccessControlListTracker = true; + } else { + localAccessControlListTracker = false; + + } + + this.localAccessControlList=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CreateBucket.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CreateBucket", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CreateBucket", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAccessControlListTracker){ + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAccessControlListTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CreateBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CreateBucket object = + new CreateBucket(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CreateBucket".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CreateBucket)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/CreateBucketConfiguration.java b/awsapi/src/com/amazon/s3/CreateBucketConfiguration.java index cc04d38bf85..44c386f2d68 100644 --- a/awsapi/src/com/amazon/s3/CreateBucketConfiguration.java +++ b/awsapi/src/com/amazon/s3/CreateBucketConfiguration.java @@ -1,452 +1,468 @@ - -/** - * CreateBucketConfiguration.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * CreateBucketConfiguration bean class - */ - - public class CreateBucketConfiguration - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = CreateBucketConfiguration - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for LocationConstraint - */ - - - protected com.amazon.s3.LocationConstraint localLocationConstraint ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.LocationConstraint - */ - public com.amazon.s3.LocationConstraint getLocationConstraint(){ - return localLocationConstraint; - } - - - - /** - * Auto generated setter method - * @param param LocationConstraint - */ - public void setLocationConstraint(com.amazon.s3.LocationConstraint param){ - - this.localLocationConstraint=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CreateBucketConfiguration.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CreateBucketConfiguration", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CreateBucketConfiguration", - xmlWriter); - } - - - } - - if (localLocationConstraint==null){ - throw new org.apache.axis2.databinding.ADBException("LocationConstraint cannot be null!!"); - } - localLocationConstraint.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LocationConstraint"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LocationConstraint")); - - - if (localLocationConstraint==null){ - throw new org.apache.axis2.databinding.ADBException("LocationConstraint cannot be null!!"); - } - elementList.add(localLocationConstraint); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CreateBucketConfiguration parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CreateBucketConfiguration object = - new CreateBucketConfiguration(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CreateBucketConfiguration".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CreateBucketConfiguration)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LocationConstraint").equals(reader.getName())){ - - object.setLocationConstraint(com.amazon.s3.LocationConstraint.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * CreateBucketConfiguration.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * CreateBucketConfiguration bean class + */ + + public class CreateBucketConfiguration + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = CreateBucketConfiguration + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for LocationConstraint + */ + + + protected com.amazon.s3.LocationConstraint localLocationConstraint ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.LocationConstraint + */ + public com.amazon.s3.LocationConstraint getLocationConstraint(){ + return localLocationConstraint; + } + + + + /** + * Auto generated setter method + * @param param LocationConstraint + */ + public void setLocationConstraint(com.amazon.s3.LocationConstraint param){ + + this.localLocationConstraint=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CreateBucketConfiguration.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CreateBucketConfiguration", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CreateBucketConfiguration", + xmlWriter); + } + + + } + + if (localLocationConstraint==null){ + throw new org.apache.axis2.databinding.ADBException("LocationConstraint cannot be null!!"); + } + localLocationConstraint.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LocationConstraint"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LocationConstraint")); + + + if (localLocationConstraint==null){ + throw new org.apache.axis2.databinding.ADBException("LocationConstraint cannot be null!!"); + } + elementList.add(localLocationConstraint); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CreateBucketConfiguration parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CreateBucketConfiguration object = + new CreateBucketConfiguration(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CreateBucketConfiguration".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CreateBucketConfiguration)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LocationConstraint").equals(reader.getName())){ + + object.setLocationConstraint(com.amazon.s3.LocationConstraint.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/CreateBucketResponse.java b/awsapi/src/com/amazon/s3/CreateBucketResponse.java index 0704933a42a..edddb58b9b3 100644 --- a/awsapi/src/com/amazon/s3/CreateBucketResponse.java +++ b/awsapi/src/com/amazon/s3/CreateBucketResponse.java @@ -1,453 +1,469 @@ - -/** - * CreateBucketResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * CreateBucketResponse bean class - */ - - public class CreateBucketResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "CreateBucketResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for CreateBucketReturn - */ - - - protected com.amazon.s3.CreateBucketResult localCreateBucketReturn ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.CreateBucketResult - */ - public com.amazon.s3.CreateBucketResult getCreateBucketReturn(){ - return localCreateBucketReturn; - } - - - - /** - * Auto generated setter method - * @param param CreateBucketReturn - */ - public void setCreateBucketReturn(com.amazon.s3.CreateBucketResult param){ - - this.localCreateBucketReturn=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CreateBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CreateBucketResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CreateBucketResponse", - xmlWriter); - } - - - } - - if (localCreateBucketReturn==null){ - throw new org.apache.axis2.databinding.ADBException("CreateBucketReturn cannot be null!!"); - } - localCreateBucketReturn.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreateBucketReturn"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CreateBucketReturn")); - - - if (localCreateBucketReturn==null){ - throw new org.apache.axis2.databinding.ADBException("CreateBucketReturn cannot be null!!"); - } - elementList.add(localCreateBucketReturn); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CreateBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CreateBucketResponse object = - new CreateBucketResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CreateBucketResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CreateBucketResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreateBucketReturn").equals(reader.getName())){ - - object.setCreateBucketReturn(com.amazon.s3.CreateBucketResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * CreateBucketResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * CreateBucketResponse bean class + */ + + public class CreateBucketResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "CreateBucketResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for CreateBucketReturn + */ + + + protected com.amazon.s3.CreateBucketResult localCreateBucketReturn ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.CreateBucketResult + */ + public com.amazon.s3.CreateBucketResult getCreateBucketReturn(){ + return localCreateBucketReturn; + } + + + + /** + * Auto generated setter method + * @param param CreateBucketReturn + */ + public void setCreateBucketReturn(com.amazon.s3.CreateBucketResult param){ + + this.localCreateBucketReturn=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CreateBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CreateBucketResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CreateBucketResponse", + xmlWriter); + } + + + } + + if (localCreateBucketReturn==null){ + throw new org.apache.axis2.databinding.ADBException("CreateBucketReturn cannot be null!!"); + } + localCreateBucketReturn.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreateBucketReturn"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CreateBucketReturn")); + + + if (localCreateBucketReturn==null){ + throw new org.apache.axis2.databinding.ADBException("CreateBucketReturn cannot be null!!"); + } + elementList.add(localCreateBucketReturn); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CreateBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CreateBucketResponse object = + new CreateBucketResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CreateBucketResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CreateBucketResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreateBucketReturn").equals(reader.getName())){ + + object.setCreateBucketReturn(com.amazon.s3.CreateBucketResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/CreateBucketResult.java b/awsapi/src/com/amazon/s3/CreateBucketResult.java index 78d1dcad845..d0fb788e475 100644 --- a/awsapi/src/com/amazon/s3/CreateBucketResult.java +++ b/awsapi/src/com/amazon/s3/CreateBucketResult.java @@ -1,483 +1,499 @@ - -/** - * CreateBucketResult.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * CreateBucketResult bean class - */ - - public class CreateBucketResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = CreateBucketResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for BucketName - */ - - - protected java.lang.String localBucketName ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucketName(){ - return localBucketName; - } - - - - /** - * Auto generated setter method - * @param param BucketName - */ - public void setBucketName(java.lang.String param){ - - this.localBucketName=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CreateBucketResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CreateBucketResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CreateBucketResult", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"BucketName", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"BucketName"); - } - - } else { - xmlWriter.writeStartElement("BucketName"); - } - - - if (localBucketName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("BucketName cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucketName); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "BucketName")); - - if (localBucketName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucketName)); - } else { - throw new org.apache.axis2.databinding.ADBException("BucketName cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CreateBucketResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CreateBucketResult object = - new CreateBucketResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CreateBucketResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CreateBucketResult)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketName").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucketName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * CreateBucketResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * CreateBucketResult bean class + */ + + public class CreateBucketResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = CreateBucketResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for BucketName + */ + + + protected java.lang.String localBucketName ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucketName(){ + return localBucketName; + } + + + + /** + * Auto generated setter method + * @param param BucketName + */ + public void setBucketName(java.lang.String param){ + + this.localBucketName=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CreateBucketResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CreateBucketResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CreateBucketResult", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"BucketName", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"BucketName"); + } + + } else { + xmlWriter.writeStartElement("BucketName"); + } + + + if (localBucketName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("BucketName cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucketName); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "BucketName")); + + if (localBucketName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucketName)); + } else { + throw new org.apache.axis2.databinding.ADBException("BucketName cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CreateBucketResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CreateBucketResult object = + new CreateBucketResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CreateBucketResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CreateBucketResult)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketName").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucketName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/DeleteBucket.java b/awsapi/src/com/amazon/s3/DeleteBucket.java index 529c2b058ad..a07a0c0f048 100644 --- a/awsapi/src/com/amazon/s3/DeleteBucket.java +++ b/awsapi/src/com/amazon/s3/DeleteBucket.java @@ -1,904 +1,920 @@ - -/** - * DeleteBucket.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * DeleteBucket bean class - */ - - public class DeleteBucket - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteBucket", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - DeleteBucket.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":DeleteBucket", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "DeleteBucket", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static DeleteBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - DeleteBucket object = - new DeleteBucket(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"DeleteBucket".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteBucket)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * DeleteBucket.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * DeleteBucket bean class + */ + + public class DeleteBucket + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteBucket", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + DeleteBucket.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":DeleteBucket", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "DeleteBucket", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static DeleteBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + DeleteBucket object = + new DeleteBucket(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"DeleteBucket".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (DeleteBucket)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/DeleteBucketResponse.java b/awsapi/src/com/amazon/s3/DeleteBucketResponse.java index 31337a41183..6cddd4de7d4 100644 --- a/awsapi/src/com/amazon/s3/DeleteBucketResponse.java +++ b/awsapi/src/com/amazon/s3/DeleteBucketResponse.java @@ -1,453 +1,469 @@ - -/** - * DeleteBucketResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * DeleteBucketResponse bean class - */ - - public class DeleteBucketResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteBucketResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for DeleteBucketResponse - */ - - - protected com.amazon.s3.Status localDeleteBucketResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.Status - */ - public com.amazon.s3.Status getDeleteBucketResponse(){ - return localDeleteBucketResponse; - } - - - - /** - * Auto generated setter method - * @param param DeleteBucketResponse - */ - public void setDeleteBucketResponse(com.amazon.s3.Status param){ - - this.localDeleteBucketResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - DeleteBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":DeleteBucketResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "DeleteBucketResponse", - xmlWriter); - } - - - } - - if (localDeleteBucketResponse==null){ - throw new org.apache.axis2.databinding.ADBException("DeleteBucketResponse cannot be null!!"); - } - localDeleteBucketResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteBucketResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteBucketResponse")); - - - if (localDeleteBucketResponse==null){ - throw new org.apache.axis2.databinding.ADBException("DeleteBucketResponse cannot be null!!"); - } - elementList.add(localDeleteBucketResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static DeleteBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - DeleteBucketResponse object = - new DeleteBucketResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"DeleteBucketResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteBucketResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteBucketResponse").equals(reader.getName())){ - - object.setDeleteBucketResponse(com.amazon.s3.Status.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * DeleteBucketResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * DeleteBucketResponse bean class + */ + + public class DeleteBucketResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteBucketResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for DeleteBucketResponse + */ + + + protected com.amazon.s3.Status localDeleteBucketResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.Status + */ + public com.amazon.s3.Status getDeleteBucketResponse(){ + return localDeleteBucketResponse; + } + + + + /** + * Auto generated setter method + * @param param DeleteBucketResponse + */ + public void setDeleteBucketResponse(com.amazon.s3.Status param){ + + this.localDeleteBucketResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + DeleteBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":DeleteBucketResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "DeleteBucketResponse", + xmlWriter); + } + + + } + + if (localDeleteBucketResponse==null){ + throw new org.apache.axis2.databinding.ADBException("DeleteBucketResponse cannot be null!!"); + } + localDeleteBucketResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteBucketResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteBucketResponse")); + + + if (localDeleteBucketResponse==null){ + throw new org.apache.axis2.databinding.ADBException("DeleteBucketResponse cannot be null!!"); + } + elementList.add(localDeleteBucketResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static DeleteBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + DeleteBucketResponse object = + new DeleteBucketResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"DeleteBucketResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (DeleteBucketResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteBucketResponse").equals(reader.getName())){ + + object.setDeleteBucketResponse(com.amazon.s3.Status.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/DeleteMarkerEntry.java b/awsapi/src/com/amazon/s3/DeleteMarkerEntry.java index bd205ef9e6a..bd72165301d 100644 --- a/awsapi/src/com/amazon/s3/DeleteMarkerEntry.java +++ b/awsapi/src/com/amazon/s3/DeleteMarkerEntry.java @@ -1,825 +1,841 @@ - -/** - * DeleteMarkerEntry.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * DeleteMarkerEntry bean class - */ - - public class DeleteMarkerEntry - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = DeleteMarkerEntry - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for VersionId - */ - - - protected java.lang.String localVersionId ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getVersionId(){ - return localVersionId; - } - - - - /** - * Auto generated setter method - * @param param VersionId - */ - public void setVersionId(java.lang.String param){ - - this.localVersionId=param; - - - } - - - /** - * field for IsLatest - */ - - - protected boolean localIsLatest ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getIsLatest(){ - return localIsLatest; - } - - - - /** - * Auto generated setter method - * @param param IsLatest - */ - public void setIsLatest(boolean param){ - - this.localIsLatest=param; - - - } - - - /** - * field for LastModified - */ - - - protected java.util.Calendar localLastModified ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getLastModified(){ - return localLastModified; - } - - - - /** - * Auto generated setter method - * @param param LastModified - */ - public void setLastModified(java.util.Calendar param){ - - this.localLastModified=param; - - - } - - - /** - * field for Owner - */ - - - protected com.amazon.s3.CanonicalUser localOwner ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localOwnerTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.CanonicalUser - */ - public com.amazon.s3.CanonicalUser getOwner(){ - return localOwner; - } - - - - /** - * Auto generated setter method - * @param param Owner - */ - public void setOwner(com.amazon.s3.CanonicalUser param){ - - if (param != null){ - //update the setting tracker - localOwnerTracker = true; - } else { - localOwnerTracker = false; - - } - - this.localOwner=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - DeleteMarkerEntry.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":DeleteMarkerEntry", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "DeleteMarkerEntry", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"VersionId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"VersionId"); - } - - } else { - xmlWriter.writeStartElement("VersionId"); - } - - - if (localVersionId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("VersionId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localVersionId); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"IsLatest", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IsLatest"); - } - - } else { - xmlWriter.writeStartElement("IsLatest"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("IsLatest cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsLatest)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"LastModified", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"LastModified"); - } - - } else { - xmlWriter.writeStartElement("LastModified"); - } - - - if (localLastModified==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - - } - - xmlWriter.writeEndElement(); - if (localOwnerTracker){ - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), - factory,xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "VersionId")); - - if (localVersionId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localVersionId)); - } else { - throw new org.apache.axis2.databinding.ADBException("VersionId cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IsLatest")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsLatest)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LastModified")); - - if (localLastModified != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - } else { - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - } - if (localOwnerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Owner")); - - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - elementList.add(localOwner); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static DeleteMarkerEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - DeleteMarkerEntry object = - new DeleteMarkerEntry(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"DeleteMarkerEntry".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteMarkerEntry)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","VersionId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setVersionId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IsLatest").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setIsLatest( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLastModified( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ - - object.setOwner(com.amazon.s3.CanonicalUser.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * DeleteMarkerEntry.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * DeleteMarkerEntry bean class + */ + + public class DeleteMarkerEntry + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = DeleteMarkerEntry + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for VersionId + */ + + + protected java.lang.String localVersionId ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getVersionId(){ + return localVersionId; + } + + + + /** + * Auto generated setter method + * @param param VersionId + */ + public void setVersionId(java.lang.String param){ + + this.localVersionId=param; + + + } + + + /** + * field for IsLatest + */ + + + protected boolean localIsLatest ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getIsLatest(){ + return localIsLatest; + } + + + + /** + * Auto generated setter method + * @param param IsLatest + */ + public void setIsLatest(boolean param){ + + this.localIsLatest=param; + + + } + + + /** + * field for LastModified + */ + + + protected java.util.Calendar localLastModified ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getLastModified(){ + return localLastModified; + } + + + + /** + * Auto generated setter method + * @param param LastModified + */ + public void setLastModified(java.util.Calendar param){ + + this.localLastModified=param; + + + } + + + /** + * field for Owner + */ + + + protected com.amazon.s3.CanonicalUser localOwner ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localOwnerTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.CanonicalUser + */ + public com.amazon.s3.CanonicalUser getOwner(){ + return localOwner; + } + + + + /** + * Auto generated setter method + * @param param Owner + */ + public void setOwner(com.amazon.s3.CanonicalUser param){ + + if (param != null){ + //update the setting tracker + localOwnerTracker = true; + } else { + localOwnerTracker = false; + + } + + this.localOwner=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + DeleteMarkerEntry.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":DeleteMarkerEntry", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "DeleteMarkerEntry", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"VersionId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"VersionId"); + } + + } else { + xmlWriter.writeStartElement("VersionId"); + } + + + if (localVersionId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("VersionId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localVersionId); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"IsLatest", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IsLatest"); + } + + } else { + xmlWriter.writeStartElement("IsLatest"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("IsLatest cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsLatest)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"LastModified", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"LastModified"); + } + + } else { + xmlWriter.writeStartElement("LastModified"); + } + + + if (localLastModified==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + + } + + xmlWriter.writeEndElement(); + if (localOwnerTracker){ + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), + factory,xmlWriter); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "VersionId")); + + if (localVersionId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localVersionId)); + } else { + throw new org.apache.axis2.databinding.ADBException("VersionId cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IsLatest")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsLatest)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LastModified")); + + if (localLastModified != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + } else { + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + } + if (localOwnerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Owner")); + + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + elementList.add(localOwner); + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static DeleteMarkerEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + DeleteMarkerEntry object = + new DeleteMarkerEntry(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"DeleteMarkerEntry".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (DeleteMarkerEntry)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","VersionId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setVersionId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IsLatest").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setIsLatest( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLastModified( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ + + object.setOwner(com.amazon.s3.CanonicalUser.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/DeleteObject.java b/awsapi/src/com/amazon/s3/DeleteObject.java index 14268b25d10..5230b345a3b 100644 --- a/awsapi/src/com/amazon/s3/DeleteObject.java +++ b/awsapi/src/com/amazon/s3/DeleteObject.java @@ -1,996 +1,1012 @@ - -/** - * DeleteObject.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * DeleteObject bean class - */ - - public class DeleteObject - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteObject", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - DeleteObject.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":DeleteObject", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "DeleteObject", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static DeleteObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - DeleteObject object = - new DeleteObject(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"DeleteObject".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteObject)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * DeleteObject.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * DeleteObject bean class + */ + + public class DeleteObject + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteObject", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + DeleteObject.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":DeleteObject", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "DeleteObject", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static DeleteObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + DeleteObject object = + new DeleteObject(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"DeleteObject".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (DeleteObject)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/DeleteObjectResponse.java b/awsapi/src/com/amazon/s3/DeleteObjectResponse.java index a16b91a97bd..5c5775ed0bd 100644 --- a/awsapi/src/com/amazon/s3/DeleteObjectResponse.java +++ b/awsapi/src/com/amazon/s3/DeleteObjectResponse.java @@ -1,453 +1,469 @@ - -/** - * DeleteObjectResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * DeleteObjectResponse bean class - */ - - public class DeleteObjectResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteObjectResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for DeleteObjectResponse - */ - - - protected com.amazon.s3.Status localDeleteObjectResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.Status - */ - public com.amazon.s3.Status getDeleteObjectResponse(){ - return localDeleteObjectResponse; - } - - - - /** - * Auto generated setter method - * @param param DeleteObjectResponse - */ - public void setDeleteObjectResponse(com.amazon.s3.Status param){ - - this.localDeleteObjectResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - DeleteObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":DeleteObjectResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "DeleteObjectResponse", - xmlWriter); - } - - - } - - if (localDeleteObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("DeleteObjectResponse cannot be null!!"); - } - localDeleteObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteObjectResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteObjectResponse")); - - - if (localDeleteObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("DeleteObjectResponse cannot be null!!"); - } - elementList.add(localDeleteObjectResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static DeleteObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - DeleteObjectResponse object = - new DeleteObjectResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"DeleteObjectResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteObjectResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteObjectResponse").equals(reader.getName())){ - - object.setDeleteObjectResponse(com.amazon.s3.Status.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * DeleteObjectResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * DeleteObjectResponse bean class + */ + + public class DeleteObjectResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteObjectResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for DeleteObjectResponse + */ + + + protected com.amazon.s3.Status localDeleteObjectResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.Status + */ + public com.amazon.s3.Status getDeleteObjectResponse(){ + return localDeleteObjectResponse; + } + + + + /** + * Auto generated setter method + * @param param DeleteObjectResponse + */ + public void setDeleteObjectResponse(com.amazon.s3.Status param){ + + this.localDeleteObjectResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + DeleteObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":DeleteObjectResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "DeleteObjectResponse", + xmlWriter); + } + + + } + + if (localDeleteObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("DeleteObjectResponse cannot be null!!"); + } + localDeleteObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteObjectResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteObjectResponse")); + + + if (localDeleteObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("DeleteObjectResponse cannot be null!!"); + } + elementList.add(localDeleteObjectResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static DeleteObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + DeleteObjectResponse object = + new DeleteObjectResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"DeleteObjectResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (DeleteObjectResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteObjectResponse").equals(reader.getName())){ + + object.setDeleteObjectResponse(com.amazon.s3.Status.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ExtensionMapper.java b/awsapi/src/com/amazon/s3/ExtensionMapper.java index b432551047b..e028ee18c8c 100644 --- a/awsapi/src/com/amazon/s3/ExtensionMapper.java +++ b/awsapi/src/com/amazon/s3/ExtensionMapper.java @@ -1,405 +1,421 @@ - -/** - * ExtensionMapper.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - /** - * ExtensionMapper class - */ - - public class ExtensionMapper{ - - public static java.lang.Object getTypeObject(java.lang.String namespaceURI, - java.lang.String typeName, - javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "PutObjectResult".equals(typeName)){ - - return com.amazon.s3.PutObjectResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "AccessControlList".equals(typeName)){ - - return com.amazon.s3.AccessControlList.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "VersioningConfiguration".equals(typeName)){ - - return com.amazon.s3.VersioningConfiguration.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListAllMyBucketsEntry".equals(typeName)){ - - return com.amazon.s3.ListAllMyBucketsEntry.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListBucketResult".equals(typeName)){ - - return com.amazon.s3.ListBucketResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "PrefixEntry".equals(typeName)){ - - return com.amazon.s3.PrefixEntry.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "AccessControlPolicy".equals(typeName)){ - - return com.amazon.s3.AccessControlPolicy.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "VersioningStatus".equals(typeName)){ - - return com.amazon.s3.VersioningStatus.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListAllMyBucketsList".equals(typeName)){ - - return com.amazon.s3.ListAllMyBucketsList.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "CreateBucketResult".equals(typeName)){ - - return com.amazon.s3.CreateBucketResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Status".equals(typeName)){ - - return com.amazon.s3.Status.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "VersionEntry".equals(typeName)){ - - return com.amazon.s3.VersionEntry.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "LoggingSettings".equals(typeName)){ - - return com.amazon.s3.LoggingSettings.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "AmazonCustomerByEmail".equals(typeName)){ - - return com.amazon.s3.AmazonCustomerByEmail.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "CanonicalUser".equals(typeName)){ - - return com.amazon.s3.CanonicalUser.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "CopyObjectResult".equals(typeName)){ - - return com.amazon.s3.CopyObjectResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListEntry".equals(typeName)){ - - return com.amazon.s3.ListEntry.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Permission".equals(typeName)){ - - return com.amazon.s3.Permission.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Grantee".equals(typeName)){ - - return com.amazon.s3.Grantee.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Result".equals(typeName)){ - - return com.amazon.s3.Result.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "RequestPaymentConfiguration".equals(typeName)){ - - return com.amazon.s3.RequestPaymentConfiguration.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "MfaDeleteStatus".equals(typeName)){ - - return com.amazon.s3.MfaDeleteStatus.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Payer".equals(typeName)){ - - return com.amazon.s3.Payer.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListAllMyBucketsResult".equals(typeName)){ - - return com.amazon.s3.ListAllMyBucketsResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "BucketLoggingStatus".equals(typeName)){ - - return com.amazon.s3.BucketLoggingStatus.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListVersionsResult".equals(typeName)){ - - return com.amazon.s3.ListVersionsResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "MetadataDirective".equals(typeName)){ - - return com.amazon.s3.MetadataDirective.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "GetObjectResult".equals(typeName)){ - - return com.amazon.s3.GetObjectResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Grant".equals(typeName)){ - - return com.amazon.s3.Grant.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "CreateBucketConfiguration".equals(typeName)){ - - return com.amazon.s3.CreateBucketConfiguration.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "TopicConfiguration".equals(typeName)){ - - return com.amazon.s3.TopicConfiguration.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Group".equals(typeName)){ - - return com.amazon.s3.Group.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "NotificationConfiguration".equals(typeName)){ - - return com.amazon.s3.NotificationConfiguration.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "MetadataEntry".equals(typeName)){ - - return com.amazon.s3.MetadataEntry.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "DeleteMarkerEntry".equals(typeName)){ - - return com.amazon.s3.DeleteMarkerEntry.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "LocationConstraint".equals(typeName)){ - - return com.amazon.s3.LocationConstraint.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "StorageClass".equals(typeName)){ - - return com.amazon.s3.StorageClass.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "User".equals(typeName)){ - - return com.amazon.s3.User.Factory.parse(reader); - - - } - - - throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); - } - - } +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ExtensionMapper.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + /** + * ExtensionMapper class + */ + + public class ExtensionMapper{ + + public static java.lang.Object getTypeObject(java.lang.String namespaceURI, + java.lang.String typeName, + javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "PutObjectResult".equals(typeName)){ + + return com.amazon.s3.PutObjectResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "AccessControlList".equals(typeName)){ + + return com.amazon.s3.AccessControlList.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "VersioningConfiguration".equals(typeName)){ + + return com.amazon.s3.VersioningConfiguration.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListAllMyBucketsEntry".equals(typeName)){ + + return com.amazon.s3.ListAllMyBucketsEntry.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListBucketResult".equals(typeName)){ + + return com.amazon.s3.ListBucketResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "PrefixEntry".equals(typeName)){ + + return com.amazon.s3.PrefixEntry.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "AccessControlPolicy".equals(typeName)){ + + return com.amazon.s3.AccessControlPolicy.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "VersioningStatus".equals(typeName)){ + + return com.amazon.s3.VersioningStatus.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListAllMyBucketsList".equals(typeName)){ + + return com.amazon.s3.ListAllMyBucketsList.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "CreateBucketResult".equals(typeName)){ + + return com.amazon.s3.CreateBucketResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Status".equals(typeName)){ + + return com.amazon.s3.Status.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "VersionEntry".equals(typeName)){ + + return com.amazon.s3.VersionEntry.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "LoggingSettings".equals(typeName)){ + + return com.amazon.s3.LoggingSettings.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "AmazonCustomerByEmail".equals(typeName)){ + + return com.amazon.s3.AmazonCustomerByEmail.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "CanonicalUser".equals(typeName)){ + + return com.amazon.s3.CanonicalUser.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "CopyObjectResult".equals(typeName)){ + + return com.amazon.s3.CopyObjectResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListEntry".equals(typeName)){ + + return com.amazon.s3.ListEntry.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Permission".equals(typeName)){ + + return com.amazon.s3.Permission.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Grantee".equals(typeName)){ + + return com.amazon.s3.Grantee.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Result".equals(typeName)){ + + return com.amazon.s3.Result.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "RequestPaymentConfiguration".equals(typeName)){ + + return com.amazon.s3.RequestPaymentConfiguration.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "MfaDeleteStatus".equals(typeName)){ + + return com.amazon.s3.MfaDeleteStatus.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Payer".equals(typeName)){ + + return com.amazon.s3.Payer.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListAllMyBucketsResult".equals(typeName)){ + + return com.amazon.s3.ListAllMyBucketsResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "BucketLoggingStatus".equals(typeName)){ + + return com.amazon.s3.BucketLoggingStatus.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListVersionsResult".equals(typeName)){ + + return com.amazon.s3.ListVersionsResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "MetadataDirective".equals(typeName)){ + + return com.amazon.s3.MetadataDirective.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "GetObjectResult".equals(typeName)){ + + return com.amazon.s3.GetObjectResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Grant".equals(typeName)){ + + return com.amazon.s3.Grant.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "CreateBucketConfiguration".equals(typeName)){ + + return com.amazon.s3.CreateBucketConfiguration.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "TopicConfiguration".equals(typeName)){ + + return com.amazon.s3.TopicConfiguration.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Group".equals(typeName)){ + + return com.amazon.s3.Group.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "NotificationConfiguration".equals(typeName)){ + + return com.amazon.s3.NotificationConfiguration.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "MetadataEntry".equals(typeName)){ + + return com.amazon.s3.MetadataEntry.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "DeleteMarkerEntry".equals(typeName)){ + + return com.amazon.s3.DeleteMarkerEntry.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "LocationConstraint".equals(typeName)){ + + return com.amazon.s3.LocationConstraint.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "StorageClass".equals(typeName)){ + + return com.amazon.s3.StorageClass.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "User".equals(typeName)){ + + return com.amazon.s3.User.Factory.parse(reader); + + + } + + + throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); + } + + } \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetBucketAccessControlPolicy.java b/awsapi/src/com/amazon/s3/GetBucketAccessControlPolicy.java index 78782b8fe72..4a51f4ff3cd 100644 --- a/awsapi/src/com/amazon/s3/GetBucketAccessControlPolicy.java +++ b/awsapi/src/com/amazon/s3/GetBucketAccessControlPolicy.java @@ -1,904 +1,920 @@ - -/** - * GetBucketAccessControlPolicy.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetBucketAccessControlPolicy bean class - */ - - public class GetBucketAccessControlPolicy - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketAccessControlPolicy", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetBucketAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetBucketAccessControlPolicy", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetBucketAccessControlPolicy", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetBucketAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetBucketAccessControlPolicy object = - new GetBucketAccessControlPolicy(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetBucketAccessControlPolicy".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetBucketAccessControlPolicy)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetBucketAccessControlPolicy.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetBucketAccessControlPolicy bean class + */ + + public class GetBucketAccessControlPolicy + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketAccessControlPolicy", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetBucketAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetBucketAccessControlPolicy", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetBucketAccessControlPolicy", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetBucketAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetBucketAccessControlPolicy object = + new GetBucketAccessControlPolicy(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetBucketAccessControlPolicy".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetBucketAccessControlPolicy)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetBucketAccessControlPolicyResponse.java b/awsapi/src/com/amazon/s3/GetBucketAccessControlPolicyResponse.java index a9af1772a23..474c3e6ebf6 100644 --- a/awsapi/src/com/amazon/s3/GetBucketAccessControlPolicyResponse.java +++ b/awsapi/src/com/amazon/s3/GetBucketAccessControlPolicyResponse.java @@ -1,453 +1,469 @@ - -/** - * GetBucketAccessControlPolicyResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetBucketAccessControlPolicyResponse bean class - */ - - public class GetBucketAccessControlPolicyResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketAccessControlPolicyResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for GetBucketAccessControlPolicyResponse - */ - - - protected com.amazon.s3.AccessControlPolicy localGetBucketAccessControlPolicyResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.AccessControlPolicy - */ - public com.amazon.s3.AccessControlPolicy getGetBucketAccessControlPolicyResponse(){ - return localGetBucketAccessControlPolicyResponse; - } - - - - /** - * Auto generated setter method - * @param param GetBucketAccessControlPolicyResponse - */ - public void setGetBucketAccessControlPolicyResponse(com.amazon.s3.AccessControlPolicy param){ - - this.localGetBucketAccessControlPolicyResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetBucketAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetBucketAccessControlPolicyResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetBucketAccessControlPolicyResponse", - xmlWriter); - } - - - } - - if (localGetBucketAccessControlPolicyResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetBucketAccessControlPolicyResponse cannot be null!!"); - } - localGetBucketAccessControlPolicyResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketAccessControlPolicyResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketAccessControlPolicyResponse")); - - - if (localGetBucketAccessControlPolicyResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetBucketAccessControlPolicyResponse cannot be null!!"); - } - elementList.add(localGetBucketAccessControlPolicyResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetBucketAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetBucketAccessControlPolicyResponse object = - new GetBucketAccessControlPolicyResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetBucketAccessControlPolicyResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetBucketAccessControlPolicyResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketAccessControlPolicyResponse").equals(reader.getName())){ - - object.setGetBucketAccessControlPolicyResponse(com.amazon.s3.AccessControlPolicy.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetBucketAccessControlPolicyResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetBucketAccessControlPolicyResponse bean class + */ + + public class GetBucketAccessControlPolicyResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketAccessControlPolicyResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetBucketAccessControlPolicyResponse + */ + + + protected com.amazon.s3.AccessControlPolicy localGetBucketAccessControlPolicyResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.AccessControlPolicy + */ + public com.amazon.s3.AccessControlPolicy getGetBucketAccessControlPolicyResponse(){ + return localGetBucketAccessControlPolicyResponse; + } + + + + /** + * Auto generated setter method + * @param param GetBucketAccessControlPolicyResponse + */ + public void setGetBucketAccessControlPolicyResponse(com.amazon.s3.AccessControlPolicy param){ + + this.localGetBucketAccessControlPolicyResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetBucketAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetBucketAccessControlPolicyResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetBucketAccessControlPolicyResponse", + xmlWriter); + } + + + } + + if (localGetBucketAccessControlPolicyResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetBucketAccessControlPolicyResponse cannot be null!!"); + } + localGetBucketAccessControlPolicyResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketAccessControlPolicyResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketAccessControlPolicyResponse")); + + + if (localGetBucketAccessControlPolicyResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetBucketAccessControlPolicyResponse cannot be null!!"); + } + elementList.add(localGetBucketAccessControlPolicyResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetBucketAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetBucketAccessControlPolicyResponse object = + new GetBucketAccessControlPolicyResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetBucketAccessControlPolicyResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetBucketAccessControlPolicyResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketAccessControlPolicyResponse").equals(reader.getName())){ + + object.setGetBucketAccessControlPolicyResponse(com.amazon.s3.AccessControlPolicy.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetBucketLoggingStatus.java b/awsapi/src/com/amazon/s3/GetBucketLoggingStatus.java index 7cc0b207c75..267b16c7f33 100644 --- a/awsapi/src/com/amazon/s3/GetBucketLoggingStatus.java +++ b/awsapi/src/com/amazon/s3/GetBucketLoggingStatus.java @@ -1,904 +1,920 @@ - -/** - * GetBucketLoggingStatus.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetBucketLoggingStatus bean class - */ - - public class GetBucketLoggingStatus - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketLoggingStatus", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetBucketLoggingStatus.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetBucketLoggingStatus", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetBucketLoggingStatus", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetBucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetBucketLoggingStatus object = - new GetBucketLoggingStatus(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetBucketLoggingStatus".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetBucketLoggingStatus)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetBucketLoggingStatus.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetBucketLoggingStatus bean class + */ + + public class GetBucketLoggingStatus + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketLoggingStatus", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetBucketLoggingStatus.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetBucketLoggingStatus", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetBucketLoggingStatus", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetBucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetBucketLoggingStatus object = + new GetBucketLoggingStatus(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetBucketLoggingStatus".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetBucketLoggingStatus)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetBucketLoggingStatusResponse.java b/awsapi/src/com/amazon/s3/GetBucketLoggingStatusResponse.java index 65199121ff1..b3b98a6b90b 100644 --- a/awsapi/src/com/amazon/s3/GetBucketLoggingStatusResponse.java +++ b/awsapi/src/com/amazon/s3/GetBucketLoggingStatusResponse.java @@ -1,453 +1,469 @@ - -/** - * GetBucketLoggingStatusResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetBucketLoggingStatusResponse bean class - */ - - public class GetBucketLoggingStatusResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketLoggingStatusResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for GetBucketLoggingStatusResponse - */ - - - protected com.amazon.s3.BucketLoggingStatus localGetBucketLoggingStatusResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.BucketLoggingStatus - */ - public com.amazon.s3.BucketLoggingStatus getGetBucketLoggingStatusResponse(){ - return localGetBucketLoggingStatusResponse; - } - - - - /** - * Auto generated setter method - * @param param GetBucketLoggingStatusResponse - */ - public void setGetBucketLoggingStatusResponse(com.amazon.s3.BucketLoggingStatus param){ - - this.localGetBucketLoggingStatusResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetBucketLoggingStatusResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetBucketLoggingStatusResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetBucketLoggingStatusResponse", - xmlWriter); - } - - - } - - if (localGetBucketLoggingStatusResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetBucketLoggingStatusResponse cannot be null!!"); - } - localGetBucketLoggingStatusResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketLoggingStatusResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketLoggingStatusResponse")); - - - if (localGetBucketLoggingStatusResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetBucketLoggingStatusResponse cannot be null!!"); - } - elementList.add(localGetBucketLoggingStatusResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetBucketLoggingStatusResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetBucketLoggingStatusResponse object = - new GetBucketLoggingStatusResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetBucketLoggingStatusResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetBucketLoggingStatusResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketLoggingStatusResponse").equals(reader.getName())){ - - object.setGetBucketLoggingStatusResponse(com.amazon.s3.BucketLoggingStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetBucketLoggingStatusResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetBucketLoggingStatusResponse bean class + */ + + public class GetBucketLoggingStatusResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketLoggingStatusResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetBucketLoggingStatusResponse + */ + + + protected com.amazon.s3.BucketLoggingStatus localGetBucketLoggingStatusResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.BucketLoggingStatus + */ + public com.amazon.s3.BucketLoggingStatus getGetBucketLoggingStatusResponse(){ + return localGetBucketLoggingStatusResponse; + } + + + + /** + * Auto generated setter method + * @param param GetBucketLoggingStatusResponse + */ + public void setGetBucketLoggingStatusResponse(com.amazon.s3.BucketLoggingStatus param){ + + this.localGetBucketLoggingStatusResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetBucketLoggingStatusResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetBucketLoggingStatusResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetBucketLoggingStatusResponse", + xmlWriter); + } + + + } + + if (localGetBucketLoggingStatusResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetBucketLoggingStatusResponse cannot be null!!"); + } + localGetBucketLoggingStatusResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketLoggingStatusResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketLoggingStatusResponse")); + + + if (localGetBucketLoggingStatusResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetBucketLoggingStatusResponse cannot be null!!"); + } + elementList.add(localGetBucketLoggingStatusResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetBucketLoggingStatusResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetBucketLoggingStatusResponse object = + new GetBucketLoggingStatusResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetBucketLoggingStatusResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetBucketLoggingStatusResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketLoggingStatusResponse").equals(reader.getName())){ + + object.setGetBucketLoggingStatusResponse(com.amazon.s3.BucketLoggingStatus.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetObject.java b/awsapi/src/com/amazon/s3/GetObject.java index 0b1fcc3b6e6..c6ef9738957 100644 --- a/awsapi/src/com/amazon/s3/GetObject.java +++ b/awsapi/src/com/amazon/s3/GetObject.java @@ -1,1248 +1,1264 @@ - -/** - * GetObject.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetObject bean class - */ - - public class GetObject - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObject", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for GetMetadata - */ - - - protected boolean localGetMetadata ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getGetMetadata(){ - return localGetMetadata; - } - - - - /** - * Auto generated setter method - * @param param GetMetadata - */ - public void setGetMetadata(boolean param){ - - this.localGetMetadata=param; - - - } - - - /** - * field for GetData - */ - - - protected boolean localGetData ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getGetData(){ - return localGetData; - } - - - - /** - * Auto generated setter method - * @param param GetData - */ - public void setGetData(boolean param){ - - this.localGetData=param; - - - } - - - /** - * field for InlineData - */ - - - protected boolean localInlineData ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getInlineData(){ - return localInlineData; - } - - - - /** - * Auto generated setter method - * @param param InlineData - */ - public void setInlineData(boolean param){ - - this.localInlineData=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObject.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObject", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObject", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"GetMetadata", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"GetMetadata"); - } - - } else { - xmlWriter.writeStartElement("GetMetadata"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("GetMetadata cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"GetData", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"GetData"); - } - - } else { - xmlWriter.writeStartElement("GetData"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("GetData cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"InlineData", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"InlineData"); - } - - } else { - xmlWriter.writeStartElement("InlineData"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("InlineData cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetMetadata")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetData")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "InlineData")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObject object = - new GetObject(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObject".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObject)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetMetadata").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setGetMetadata( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetData").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setGetData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","InlineData").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setInlineData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetObject.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetObject bean class + */ + + public class GetObject + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObject", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for GetMetadata + */ + + + protected boolean localGetMetadata ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getGetMetadata(){ + return localGetMetadata; + } + + + + /** + * Auto generated setter method + * @param param GetMetadata + */ + public void setGetMetadata(boolean param){ + + this.localGetMetadata=param; + + + } + + + /** + * field for GetData + */ + + + protected boolean localGetData ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getGetData(){ + return localGetData; + } + + + + /** + * Auto generated setter method + * @param param GetData + */ + public void setGetData(boolean param){ + + this.localGetData=param; + + + } + + + /** + * field for InlineData + */ + + + protected boolean localInlineData ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getInlineData(){ + return localInlineData; + } + + + + /** + * Auto generated setter method + * @param param InlineData + */ + public void setInlineData(boolean param){ + + this.localInlineData=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObject.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObject", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObject", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"GetMetadata", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"GetMetadata"); + } + + } else { + xmlWriter.writeStartElement("GetMetadata"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("GetMetadata cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"GetData", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"GetData"); + } + + } else { + xmlWriter.writeStartElement("GetData"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("GetData cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"InlineData", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"InlineData"); + } + + } else { + xmlWriter.writeStartElement("InlineData"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("InlineData cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetMetadata")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetData")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "InlineData")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObject object = + new GetObject(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObject".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObject)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetMetadata").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setGetMetadata( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetData").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setGetData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","InlineData").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setInlineData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetObjectAccessControlPolicy.java b/awsapi/src/com/amazon/s3/GetObjectAccessControlPolicy.java index 904a046e311..2c7ddcd7070 100644 --- a/awsapi/src/com/amazon/s3/GetObjectAccessControlPolicy.java +++ b/awsapi/src/com/amazon/s3/GetObjectAccessControlPolicy.java @@ -1,996 +1,1012 @@ - -/** - * GetObjectAccessControlPolicy.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetObjectAccessControlPolicy bean class - */ - - public class GetObjectAccessControlPolicy - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectAccessControlPolicy", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectAccessControlPolicy", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectAccessControlPolicy", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectAccessControlPolicy object = - new GetObjectAccessControlPolicy(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectAccessControlPolicy".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectAccessControlPolicy)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetObjectAccessControlPolicy.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetObjectAccessControlPolicy bean class + */ + + public class GetObjectAccessControlPolicy + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectAccessControlPolicy", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectAccessControlPolicy", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectAccessControlPolicy", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectAccessControlPolicy object = + new GetObjectAccessControlPolicy(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectAccessControlPolicy".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectAccessControlPolicy)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetObjectAccessControlPolicyResponse.java b/awsapi/src/com/amazon/s3/GetObjectAccessControlPolicyResponse.java index 2e8ba1d084f..81b0ee3a43d 100644 --- a/awsapi/src/com/amazon/s3/GetObjectAccessControlPolicyResponse.java +++ b/awsapi/src/com/amazon/s3/GetObjectAccessControlPolicyResponse.java @@ -1,453 +1,469 @@ - -/** - * GetObjectAccessControlPolicyResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetObjectAccessControlPolicyResponse bean class - */ - - public class GetObjectAccessControlPolicyResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectAccessControlPolicyResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for GetObjectAccessControlPolicyResponse - */ - - - protected com.amazon.s3.AccessControlPolicy localGetObjectAccessControlPolicyResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.AccessControlPolicy - */ - public com.amazon.s3.AccessControlPolicy getGetObjectAccessControlPolicyResponse(){ - return localGetObjectAccessControlPolicyResponse; - } - - - - /** - * Auto generated setter method - * @param param GetObjectAccessControlPolicyResponse - */ - public void setGetObjectAccessControlPolicyResponse(com.amazon.s3.AccessControlPolicy param){ - - this.localGetObjectAccessControlPolicyResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectAccessControlPolicyResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectAccessControlPolicyResponse", - xmlWriter); - } - - - } - - if (localGetObjectAccessControlPolicyResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectAccessControlPolicyResponse cannot be null!!"); - } - localGetObjectAccessControlPolicyResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectAccessControlPolicyResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectAccessControlPolicyResponse")); - - - if (localGetObjectAccessControlPolicyResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectAccessControlPolicyResponse cannot be null!!"); - } - elementList.add(localGetObjectAccessControlPolicyResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectAccessControlPolicyResponse object = - new GetObjectAccessControlPolicyResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectAccessControlPolicyResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectAccessControlPolicyResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectAccessControlPolicyResponse").equals(reader.getName())){ - - object.setGetObjectAccessControlPolicyResponse(com.amazon.s3.AccessControlPolicy.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetObjectAccessControlPolicyResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetObjectAccessControlPolicyResponse bean class + */ + + public class GetObjectAccessControlPolicyResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectAccessControlPolicyResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetObjectAccessControlPolicyResponse + */ + + + protected com.amazon.s3.AccessControlPolicy localGetObjectAccessControlPolicyResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.AccessControlPolicy + */ + public com.amazon.s3.AccessControlPolicy getGetObjectAccessControlPolicyResponse(){ + return localGetObjectAccessControlPolicyResponse; + } + + + + /** + * Auto generated setter method + * @param param GetObjectAccessControlPolicyResponse + */ + public void setGetObjectAccessControlPolicyResponse(com.amazon.s3.AccessControlPolicy param){ + + this.localGetObjectAccessControlPolicyResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectAccessControlPolicyResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectAccessControlPolicyResponse", + xmlWriter); + } + + + } + + if (localGetObjectAccessControlPolicyResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectAccessControlPolicyResponse cannot be null!!"); + } + localGetObjectAccessControlPolicyResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectAccessControlPolicyResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectAccessControlPolicyResponse")); + + + if (localGetObjectAccessControlPolicyResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectAccessControlPolicyResponse cannot be null!!"); + } + elementList.add(localGetObjectAccessControlPolicyResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectAccessControlPolicyResponse object = + new GetObjectAccessControlPolicyResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectAccessControlPolicyResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectAccessControlPolicyResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectAccessControlPolicyResponse").equals(reader.getName())){ + + object.setGetObjectAccessControlPolicyResponse(com.amazon.s3.AccessControlPolicy.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetObjectExtended.java b/awsapi/src/com/amazon/s3/GetObjectExtended.java index 85548aaa504..918e9c80b40 100644 --- a/awsapi/src/com/amazon/s3/GetObjectExtended.java +++ b/awsapi/src/com/amazon/s3/GetObjectExtended.java @@ -1,2154 +1,2170 @@ - -/** - * GetObjectExtended.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetObjectExtended bean class - */ - - public class GetObjectExtended - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectExtended", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for GetMetadata - */ - - - protected boolean localGetMetadata ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getGetMetadata(){ - return localGetMetadata; - } - - - - /** - * Auto generated setter method - * @param param GetMetadata - */ - public void setGetMetadata(boolean param){ - - this.localGetMetadata=param; - - - } - - - /** - * field for GetData - */ - - - protected boolean localGetData ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getGetData(){ - return localGetData; - } - - - - /** - * Auto generated setter method - * @param param GetData - */ - public void setGetData(boolean param){ - - this.localGetData=param; - - - } - - - /** - * field for InlineData - */ - - - protected boolean localInlineData ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getInlineData(){ - return localInlineData; - } - - - - /** - * Auto generated setter method - * @param param InlineData - */ - public void setInlineData(boolean param){ - - this.localInlineData=param; - - - } - - - /** - * field for ByteRangeStart - */ - - - protected long localByteRangeStart ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localByteRangeStartTracker = false ; - - - /** - * Auto generated getter method - * @return long - */ - public long getByteRangeStart(){ - return localByteRangeStart; - } - - - - /** - * Auto generated setter method - * @param param ByteRangeStart - */ - public void setByteRangeStart(long param){ - - // setting primitive attribute tracker to true - - if (param==java.lang.Long.MIN_VALUE) { - localByteRangeStartTracker = false; - - } else { - localByteRangeStartTracker = true; - } - - this.localByteRangeStart=param; - - - } - - - /** - * field for ByteRangeEnd - */ - - - protected long localByteRangeEnd ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localByteRangeEndTracker = false ; - - - /** - * Auto generated getter method - * @return long - */ - public long getByteRangeEnd(){ - return localByteRangeEnd; - } - - - - /** - * Auto generated setter method - * @param param ByteRangeEnd - */ - public void setByteRangeEnd(long param){ - - // setting primitive attribute tracker to true - - if (param==java.lang.Long.MIN_VALUE) { - localByteRangeEndTracker = false; - - } else { - localByteRangeEndTracker = true; - } - - this.localByteRangeEnd=param; - - - } - - - /** - * field for IfModifiedSince - */ - - - protected java.util.Calendar localIfModifiedSince ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localIfModifiedSinceTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getIfModifiedSince(){ - return localIfModifiedSince; - } - - - - /** - * Auto generated setter method - * @param param IfModifiedSince - */ - public void setIfModifiedSince(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localIfModifiedSinceTracker = true; - } else { - localIfModifiedSinceTracker = false; - - } - - this.localIfModifiedSince=param; - - - } - - - /** - * field for IfUnmodifiedSince - */ - - - protected java.util.Calendar localIfUnmodifiedSince ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localIfUnmodifiedSinceTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getIfUnmodifiedSince(){ - return localIfUnmodifiedSince; - } - - - - /** - * Auto generated setter method - * @param param IfUnmodifiedSince - */ - public void setIfUnmodifiedSince(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localIfUnmodifiedSinceTracker = true; - } else { - localIfUnmodifiedSinceTracker = false; - - } - - this.localIfUnmodifiedSince=param; - - - } - - - /** - * field for IfMatch - * This was an Array! - */ - - - protected java.lang.String[] localIfMatch ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localIfMatchTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String[] - */ - public java.lang.String[] getIfMatch(){ - return localIfMatch; - } - - - - - - - /** - * validate the array for IfMatch - */ - protected void validateIfMatch(java.lang.String[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param IfMatch - */ - public void setIfMatch(java.lang.String[] param){ - - validateIfMatch(param); - - - if (param != null){ - //update the setting tracker - localIfMatchTracker = true; - } else { - localIfMatchTracker = false; - - } - - this.localIfMatch=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param java.lang.String - */ - public void addIfMatch(java.lang.String param){ - if (localIfMatch == null){ - localIfMatch = new java.lang.String[]{}; - } - - - //update the setting tracker - localIfMatchTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localIfMatch); - list.add(param); - this.localIfMatch = - (java.lang.String[])list.toArray( - new java.lang.String[list.size()]); - - } - - - /** - * field for IfNoneMatch - * This was an Array! - */ - - - protected java.lang.String[] localIfNoneMatch ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localIfNoneMatchTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String[] - */ - public java.lang.String[] getIfNoneMatch(){ - return localIfNoneMatch; - } - - - - - - - /** - * validate the array for IfNoneMatch - */ - protected void validateIfNoneMatch(java.lang.String[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param IfNoneMatch - */ - public void setIfNoneMatch(java.lang.String[] param){ - - validateIfNoneMatch(param); - - - if (param != null){ - //update the setting tracker - localIfNoneMatchTracker = true; - } else { - localIfNoneMatchTracker = false; - - } - - this.localIfNoneMatch=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param java.lang.String - */ - public void addIfNoneMatch(java.lang.String param){ - if (localIfNoneMatch == null){ - localIfNoneMatch = new java.lang.String[]{}; - } - - - //update the setting tracker - localIfNoneMatchTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localIfNoneMatch); - list.add(param); - this.localIfNoneMatch = - (java.lang.String[])list.toArray( - new java.lang.String[list.size()]); - - } - - - /** - * field for ReturnCompleteObjectOnConditionFailure - */ - - - protected boolean localReturnCompleteObjectOnConditionFailure ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localReturnCompleteObjectOnConditionFailureTracker = false ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getReturnCompleteObjectOnConditionFailure(){ - return localReturnCompleteObjectOnConditionFailure; - } - - - - /** - * Auto generated setter method - * @param param ReturnCompleteObjectOnConditionFailure - */ - public void setReturnCompleteObjectOnConditionFailure(boolean param){ - - // setting primitive attribute tracker to true - - if (false) { - localReturnCompleteObjectOnConditionFailureTracker = false; - - } else { - localReturnCompleteObjectOnConditionFailureTracker = true; - } - - this.localReturnCompleteObjectOnConditionFailure=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectExtended.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectExtended", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectExtended", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"GetMetadata", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"GetMetadata"); - } - - } else { - xmlWriter.writeStartElement("GetMetadata"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("GetMetadata cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"GetData", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"GetData"); - } - - } else { - xmlWriter.writeStartElement("GetData"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("GetData cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"InlineData", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"InlineData"); - } - - } else { - xmlWriter.writeStartElement("InlineData"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("InlineData cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); - } - - xmlWriter.writeEndElement(); - if (localByteRangeStartTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ByteRangeStart", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ByteRangeStart"); - } - - } else { - xmlWriter.writeStartElement("ByteRangeStart"); - } - - if (localByteRangeStart==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("ByteRangeStart cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeStart)); - } - - xmlWriter.writeEndElement(); - } if (localByteRangeEndTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ByteRangeEnd", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ByteRangeEnd"); - } - - } else { - xmlWriter.writeStartElement("ByteRangeEnd"); - } - - if (localByteRangeEnd==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("ByteRangeEnd cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeEnd)); - } - - xmlWriter.writeEndElement(); - } if (localIfModifiedSinceTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"IfModifiedSince", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IfModifiedSince"); - } - - } else { - xmlWriter.writeStartElement("IfModifiedSince"); - } - - - if (localIfModifiedSince==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("IfModifiedSince cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfModifiedSince)); - - } - - xmlWriter.writeEndElement(); - } if (localIfUnmodifiedSinceTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"IfUnmodifiedSince", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IfUnmodifiedSince"); - } - - } else { - xmlWriter.writeStartElement("IfUnmodifiedSince"); - } - - - if (localIfUnmodifiedSince==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("IfUnmodifiedSince cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfUnmodifiedSince)); - - } - - xmlWriter.writeEndElement(); - } if (localIfMatchTracker){ - if (localIfMatch!=null) { - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - boolean emptyNamespace = namespace == null || namespace.length() == 0; - prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); - for (int i = 0;i < localIfMatch.length;i++){ - - if (localIfMatch[i] != null){ - - if (!emptyNamespace) { - if (prefix == null) { - java.lang.String prefix2 = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix2,"IfMatch", namespace); - xmlWriter.writeNamespace(prefix2, namespace); - xmlWriter.setPrefix(prefix2, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IfMatch"); - } - - } else { - xmlWriter.writeStartElement("IfMatch"); - } - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfMatch[i])); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("IfMatch cannot be null!!"); - - } - - } if (localIfNoneMatchTracker){ - if (localIfNoneMatch!=null) { - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - boolean emptyNamespace = namespace == null || namespace.length() == 0; - prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); - for (int i = 0;i < localIfNoneMatch.length;i++){ - - if (localIfNoneMatch[i] != null){ - - if (!emptyNamespace) { - if (prefix == null) { - java.lang.String prefix2 = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix2,"IfNoneMatch", namespace); - xmlWriter.writeNamespace(prefix2, namespace); - xmlWriter.setPrefix(prefix2, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IfNoneMatch"); - } - - } else { - xmlWriter.writeStartElement("IfNoneMatch"); - } - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfNoneMatch[i])); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("IfNoneMatch cannot be null!!"); - - } - - } if (localReturnCompleteObjectOnConditionFailureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ReturnCompleteObjectOnConditionFailure", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ReturnCompleteObjectOnConditionFailure"); - } - - } else { - xmlWriter.writeStartElement("ReturnCompleteObjectOnConditionFailure"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("ReturnCompleteObjectOnConditionFailure cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReturnCompleteObjectOnConditionFailure)); - } - - xmlWriter.writeEndElement(); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetMetadata")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetData")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "InlineData")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); - if (localByteRangeStartTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ByteRangeStart")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeStart)); - } if (localByteRangeEndTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ByteRangeEnd")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeEnd)); - } if (localIfModifiedSinceTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IfModifiedSince")); - - if (localIfModifiedSince != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfModifiedSince)); - } else { - throw new org.apache.axis2.databinding.ADBException("IfModifiedSince cannot be null!!"); - } - } if (localIfUnmodifiedSinceTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IfUnmodifiedSince")); - - if (localIfUnmodifiedSince != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfUnmodifiedSince)); - } else { - throw new org.apache.axis2.databinding.ADBException("IfUnmodifiedSince cannot be null!!"); - } - } if (localIfMatchTracker){ - if (localIfMatch!=null){ - for (int i = 0;i < localIfMatch.length;i++){ - - if (localIfMatch[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IfMatch")); - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfMatch[i])); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("IfMatch cannot be null!!"); - - } - - } if (localIfNoneMatchTracker){ - if (localIfNoneMatch!=null){ - for (int i = 0;i < localIfNoneMatch.length;i++){ - - if (localIfNoneMatch[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IfNoneMatch")); - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfNoneMatch[i])); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("IfNoneMatch cannot be null!!"); - - } - - } if (localReturnCompleteObjectOnConditionFailureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ReturnCompleteObjectOnConditionFailure")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReturnCompleteObjectOnConditionFailure)); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectExtended parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectExtended object = - new GetObjectExtended(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectExtended".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectExtended)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list10 = new java.util.ArrayList(); - - java.util.ArrayList list11 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetMetadata").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setGetMetadata( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetData").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setGetData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","InlineData").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setInlineData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ByteRangeStart").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setByteRangeStart( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setByteRangeStart(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ByteRangeEnd").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setByteRangeEnd( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setByteRangeEnd(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfModifiedSince").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setIfModifiedSince( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfUnmodifiedSince").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setIfUnmodifiedSince( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfMatch").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list10.add(reader.getElementText()); - - //loop until we find a start element that is not part of this array - boolean loopDone10 = false; - while(!loopDone10){ - // Ensure we are at the EndElement - while (!reader.isEndElement()){ - reader.next(); - } - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone10 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfMatch").equals(reader.getName())){ - list10.add(reader.getElementText()); - - }else{ - loopDone10 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setIfMatch((java.lang.String[]) - list10.toArray(new java.lang.String[list10.size()])); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfNoneMatch").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list11.add(reader.getElementText()); - - //loop until we find a start element that is not part of this array - boolean loopDone11 = false; - while(!loopDone11){ - // Ensure we are at the EndElement - while (!reader.isEndElement()){ - reader.next(); - } - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone11 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfNoneMatch").equals(reader.getName())){ - list11.add(reader.getElementText()); - - }else{ - loopDone11 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setIfNoneMatch((java.lang.String[]) - list11.toArray(new java.lang.String[list11.size()])); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ReturnCompleteObjectOnConditionFailure").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setReturnCompleteObjectOnConditionFailure( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetObjectExtended.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetObjectExtended bean class + */ + + public class GetObjectExtended + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectExtended", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for GetMetadata + */ + + + protected boolean localGetMetadata ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getGetMetadata(){ + return localGetMetadata; + } + + + + /** + * Auto generated setter method + * @param param GetMetadata + */ + public void setGetMetadata(boolean param){ + + this.localGetMetadata=param; + + + } + + + /** + * field for GetData + */ + + + protected boolean localGetData ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getGetData(){ + return localGetData; + } + + + + /** + * Auto generated setter method + * @param param GetData + */ + public void setGetData(boolean param){ + + this.localGetData=param; + + + } + + + /** + * field for InlineData + */ + + + protected boolean localInlineData ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getInlineData(){ + return localInlineData; + } + + + + /** + * Auto generated setter method + * @param param InlineData + */ + public void setInlineData(boolean param){ + + this.localInlineData=param; + + + } + + + /** + * field for ByteRangeStart + */ + + + protected long localByteRangeStart ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localByteRangeStartTracker = false ; + + + /** + * Auto generated getter method + * @return long + */ + public long getByteRangeStart(){ + return localByteRangeStart; + } + + + + /** + * Auto generated setter method + * @param param ByteRangeStart + */ + public void setByteRangeStart(long param){ + + // setting primitive attribute tracker to true + + if (param==java.lang.Long.MIN_VALUE) { + localByteRangeStartTracker = false; + + } else { + localByteRangeStartTracker = true; + } + + this.localByteRangeStart=param; + + + } + + + /** + * field for ByteRangeEnd + */ + + + protected long localByteRangeEnd ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localByteRangeEndTracker = false ; + + + /** + * Auto generated getter method + * @return long + */ + public long getByteRangeEnd(){ + return localByteRangeEnd; + } + + + + /** + * Auto generated setter method + * @param param ByteRangeEnd + */ + public void setByteRangeEnd(long param){ + + // setting primitive attribute tracker to true + + if (param==java.lang.Long.MIN_VALUE) { + localByteRangeEndTracker = false; + + } else { + localByteRangeEndTracker = true; + } + + this.localByteRangeEnd=param; + + + } + + + /** + * field for IfModifiedSince + */ + + + protected java.util.Calendar localIfModifiedSince ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localIfModifiedSinceTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getIfModifiedSince(){ + return localIfModifiedSince; + } + + + + /** + * Auto generated setter method + * @param param IfModifiedSince + */ + public void setIfModifiedSince(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localIfModifiedSinceTracker = true; + } else { + localIfModifiedSinceTracker = false; + + } + + this.localIfModifiedSince=param; + + + } + + + /** + * field for IfUnmodifiedSince + */ + + + protected java.util.Calendar localIfUnmodifiedSince ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localIfUnmodifiedSinceTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getIfUnmodifiedSince(){ + return localIfUnmodifiedSince; + } + + + + /** + * Auto generated setter method + * @param param IfUnmodifiedSince + */ + public void setIfUnmodifiedSince(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localIfUnmodifiedSinceTracker = true; + } else { + localIfUnmodifiedSinceTracker = false; + + } + + this.localIfUnmodifiedSince=param; + + + } + + + /** + * field for IfMatch + * This was an Array! + */ + + + protected java.lang.String[] localIfMatch ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localIfMatchTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String[] + */ + public java.lang.String[] getIfMatch(){ + return localIfMatch; + } + + + + + + + /** + * validate the array for IfMatch + */ + protected void validateIfMatch(java.lang.String[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param IfMatch + */ + public void setIfMatch(java.lang.String[] param){ + + validateIfMatch(param); + + + if (param != null){ + //update the setting tracker + localIfMatchTracker = true; + } else { + localIfMatchTracker = false; + + } + + this.localIfMatch=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param java.lang.String + */ + public void addIfMatch(java.lang.String param){ + if (localIfMatch == null){ + localIfMatch = new java.lang.String[]{}; + } + + + //update the setting tracker + localIfMatchTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localIfMatch); + list.add(param); + this.localIfMatch = + (java.lang.String[])list.toArray( + new java.lang.String[list.size()]); + + } + + + /** + * field for IfNoneMatch + * This was an Array! + */ + + + protected java.lang.String[] localIfNoneMatch ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localIfNoneMatchTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String[] + */ + public java.lang.String[] getIfNoneMatch(){ + return localIfNoneMatch; + } + + + + + + + /** + * validate the array for IfNoneMatch + */ + protected void validateIfNoneMatch(java.lang.String[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param IfNoneMatch + */ + public void setIfNoneMatch(java.lang.String[] param){ + + validateIfNoneMatch(param); + + + if (param != null){ + //update the setting tracker + localIfNoneMatchTracker = true; + } else { + localIfNoneMatchTracker = false; + + } + + this.localIfNoneMatch=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param java.lang.String + */ + public void addIfNoneMatch(java.lang.String param){ + if (localIfNoneMatch == null){ + localIfNoneMatch = new java.lang.String[]{}; + } + + + //update the setting tracker + localIfNoneMatchTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localIfNoneMatch); + list.add(param); + this.localIfNoneMatch = + (java.lang.String[])list.toArray( + new java.lang.String[list.size()]); + + } + + + /** + * field for ReturnCompleteObjectOnConditionFailure + */ + + + protected boolean localReturnCompleteObjectOnConditionFailure ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localReturnCompleteObjectOnConditionFailureTracker = false ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getReturnCompleteObjectOnConditionFailure(){ + return localReturnCompleteObjectOnConditionFailure; + } + + + + /** + * Auto generated setter method + * @param param ReturnCompleteObjectOnConditionFailure + */ + public void setReturnCompleteObjectOnConditionFailure(boolean param){ + + // setting primitive attribute tracker to true + + if (false) { + localReturnCompleteObjectOnConditionFailureTracker = false; + + } else { + localReturnCompleteObjectOnConditionFailureTracker = true; + } + + this.localReturnCompleteObjectOnConditionFailure=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectExtended.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectExtended", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectExtended", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"GetMetadata", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"GetMetadata"); + } + + } else { + xmlWriter.writeStartElement("GetMetadata"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("GetMetadata cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"GetData", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"GetData"); + } + + } else { + xmlWriter.writeStartElement("GetData"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("GetData cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"InlineData", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"InlineData"); + } + + } else { + xmlWriter.writeStartElement("InlineData"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("InlineData cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); + } + + xmlWriter.writeEndElement(); + if (localByteRangeStartTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ByteRangeStart", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ByteRangeStart"); + } + + } else { + xmlWriter.writeStartElement("ByteRangeStart"); + } + + if (localByteRangeStart==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("ByteRangeStart cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeStart)); + } + + xmlWriter.writeEndElement(); + } if (localByteRangeEndTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ByteRangeEnd", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ByteRangeEnd"); + } + + } else { + xmlWriter.writeStartElement("ByteRangeEnd"); + } + + if (localByteRangeEnd==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("ByteRangeEnd cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeEnd)); + } + + xmlWriter.writeEndElement(); + } if (localIfModifiedSinceTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"IfModifiedSince", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IfModifiedSince"); + } + + } else { + xmlWriter.writeStartElement("IfModifiedSince"); + } + + + if (localIfModifiedSince==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("IfModifiedSince cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfModifiedSince)); + + } + + xmlWriter.writeEndElement(); + } if (localIfUnmodifiedSinceTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"IfUnmodifiedSince", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IfUnmodifiedSince"); + } + + } else { + xmlWriter.writeStartElement("IfUnmodifiedSince"); + } + + + if (localIfUnmodifiedSince==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("IfUnmodifiedSince cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfUnmodifiedSince)); + + } + + xmlWriter.writeEndElement(); + } if (localIfMatchTracker){ + if (localIfMatch!=null) { + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + boolean emptyNamespace = namespace == null || namespace.length() == 0; + prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); + for (int i = 0;i < localIfMatch.length;i++){ + + if (localIfMatch[i] != null){ + + if (!emptyNamespace) { + if (prefix == null) { + java.lang.String prefix2 = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix2,"IfMatch", namespace); + xmlWriter.writeNamespace(prefix2, namespace); + xmlWriter.setPrefix(prefix2, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IfMatch"); + } + + } else { + xmlWriter.writeStartElement("IfMatch"); + } + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfMatch[i])); + + xmlWriter.writeEndElement(); + + } else { + + // we have to do nothing since minOccurs is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("IfMatch cannot be null!!"); + + } + + } if (localIfNoneMatchTracker){ + if (localIfNoneMatch!=null) { + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + boolean emptyNamespace = namespace == null || namespace.length() == 0; + prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); + for (int i = 0;i < localIfNoneMatch.length;i++){ + + if (localIfNoneMatch[i] != null){ + + if (!emptyNamespace) { + if (prefix == null) { + java.lang.String prefix2 = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix2,"IfNoneMatch", namespace); + xmlWriter.writeNamespace(prefix2, namespace); + xmlWriter.setPrefix(prefix2, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IfNoneMatch"); + } + + } else { + xmlWriter.writeStartElement("IfNoneMatch"); + } + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfNoneMatch[i])); + + xmlWriter.writeEndElement(); + + } else { + + // we have to do nothing since minOccurs is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("IfNoneMatch cannot be null!!"); + + } + + } if (localReturnCompleteObjectOnConditionFailureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ReturnCompleteObjectOnConditionFailure", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ReturnCompleteObjectOnConditionFailure"); + } + + } else { + xmlWriter.writeStartElement("ReturnCompleteObjectOnConditionFailure"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("ReturnCompleteObjectOnConditionFailure cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReturnCompleteObjectOnConditionFailure)); + } + + xmlWriter.writeEndElement(); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetMetadata")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetData")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "InlineData")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); + if (localByteRangeStartTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ByteRangeStart")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeStart)); + } if (localByteRangeEndTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ByteRangeEnd")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeEnd)); + } if (localIfModifiedSinceTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IfModifiedSince")); + + if (localIfModifiedSince != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfModifiedSince)); + } else { + throw new org.apache.axis2.databinding.ADBException("IfModifiedSince cannot be null!!"); + } + } if (localIfUnmodifiedSinceTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IfUnmodifiedSince")); + + if (localIfUnmodifiedSince != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfUnmodifiedSince)); + } else { + throw new org.apache.axis2.databinding.ADBException("IfUnmodifiedSince cannot be null!!"); + } + } if (localIfMatchTracker){ + if (localIfMatch!=null){ + for (int i = 0;i < localIfMatch.length;i++){ + + if (localIfMatch[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IfMatch")); + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfMatch[i])); + } else { + + // have to do nothing + + } + + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("IfMatch cannot be null!!"); + + } + + } if (localIfNoneMatchTracker){ + if (localIfNoneMatch!=null){ + for (int i = 0;i < localIfNoneMatch.length;i++){ + + if (localIfNoneMatch[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IfNoneMatch")); + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfNoneMatch[i])); + } else { + + // have to do nothing + + } + + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("IfNoneMatch cannot be null!!"); + + } + + } if (localReturnCompleteObjectOnConditionFailureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ReturnCompleteObjectOnConditionFailure")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReturnCompleteObjectOnConditionFailure)); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectExtended parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectExtended object = + new GetObjectExtended(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectExtended".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectExtended)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list10 = new java.util.ArrayList(); + + java.util.ArrayList list11 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetMetadata").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setGetMetadata( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetData").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setGetData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","InlineData").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setInlineData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ByteRangeStart").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setByteRangeStart( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + object.setByteRangeStart(java.lang.Long.MIN_VALUE); + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ByteRangeEnd").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setByteRangeEnd( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + object.setByteRangeEnd(java.lang.Long.MIN_VALUE); + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfModifiedSince").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setIfModifiedSince( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfUnmodifiedSince").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setIfUnmodifiedSince( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfMatch").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list10.add(reader.getElementText()); + + //loop until we find a start element that is not part of this array + boolean loopDone10 = false; + while(!loopDone10){ + // Ensure we are at the EndElement + while (!reader.isEndElement()){ + reader.next(); + } + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone10 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfMatch").equals(reader.getName())){ + list10.add(reader.getElementText()); + + }else{ + loopDone10 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setIfMatch((java.lang.String[]) + list10.toArray(new java.lang.String[list10.size()])); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfNoneMatch").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list11.add(reader.getElementText()); + + //loop until we find a start element that is not part of this array + boolean loopDone11 = false; + while(!loopDone11){ + // Ensure we are at the EndElement + while (!reader.isEndElement()){ + reader.next(); + } + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone11 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfNoneMatch").equals(reader.getName())){ + list11.add(reader.getElementText()); + + }else{ + loopDone11 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setIfNoneMatch((java.lang.String[]) + list11.toArray(new java.lang.String[list11.size()])); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ReturnCompleteObjectOnConditionFailure").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setReturnCompleteObjectOnConditionFailure( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetObjectExtendedResponse.java b/awsapi/src/com/amazon/s3/GetObjectExtendedResponse.java index 2ae945e4699..c5813bf98e8 100644 --- a/awsapi/src/com/amazon/s3/GetObjectExtendedResponse.java +++ b/awsapi/src/com/amazon/s3/GetObjectExtendedResponse.java @@ -1,453 +1,469 @@ - -/** - * GetObjectExtendedResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetObjectExtendedResponse bean class - */ - - public class GetObjectExtendedResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectExtendedResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for GetObjectResponse - */ - - - protected com.amazon.s3.GetObjectResult localGetObjectResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.GetObjectResult - */ - public com.amazon.s3.GetObjectResult getGetObjectResponse(){ - return localGetObjectResponse; - } - - - - /** - * Auto generated setter method - * @param param GetObjectResponse - */ - public void setGetObjectResponse(com.amazon.s3.GetObjectResult param){ - - this.localGetObjectResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectExtendedResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectExtendedResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectExtendedResponse", - xmlWriter); - } - - - } - - if (localGetObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); - } - localGetObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectResponse")); - - - if (localGetObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); - } - elementList.add(localGetObjectResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectExtendedResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectExtendedResponse object = - new GetObjectExtendedResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectExtendedResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectExtendedResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse").equals(reader.getName())){ - - object.setGetObjectResponse(com.amazon.s3.GetObjectResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetObjectExtendedResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetObjectExtendedResponse bean class + */ + + public class GetObjectExtendedResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectExtendedResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetObjectResponse + */ + + + protected com.amazon.s3.GetObjectResult localGetObjectResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.GetObjectResult + */ + public com.amazon.s3.GetObjectResult getGetObjectResponse(){ + return localGetObjectResponse; + } + + + + /** + * Auto generated setter method + * @param param GetObjectResponse + */ + public void setGetObjectResponse(com.amazon.s3.GetObjectResult param){ + + this.localGetObjectResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectExtendedResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectExtendedResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectExtendedResponse", + xmlWriter); + } + + + } + + if (localGetObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); + } + localGetObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectResponse")); + + + if (localGetObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); + } + elementList.add(localGetObjectResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectExtendedResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectExtendedResponse object = + new GetObjectExtendedResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectExtendedResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectExtendedResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse").equals(reader.getName())){ + + object.setGetObjectResponse(com.amazon.s3.GetObjectResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetObjectResponse.java b/awsapi/src/com/amazon/s3/GetObjectResponse.java index 3c7ce6b0838..b131c0e9b73 100644 --- a/awsapi/src/com/amazon/s3/GetObjectResponse.java +++ b/awsapi/src/com/amazon/s3/GetObjectResponse.java @@ -1,453 +1,469 @@ - -/** - * GetObjectResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetObjectResponse bean class - */ - - public class GetObjectResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for GetObjectResponse - */ - - - protected com.amazon.s3.GetObjectResult localGetObjectResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.GetObjectResult - */ - public com.amazon.s3.GetObjectResult getGetObjectResponse(){ - return localGetObjectResponse; - } - - - - /** - * Auto generated setter method - * @param param GetObjectResponse - */ - public void setGetObjectResponse(com.amazon.s3.GetObjectResult param){ - - this.localGetObjectResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectResponse", - xmlWriter); - } - - - } - - if (localGetObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); - } - localGetObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectResponse")); - - - if (localGetObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); - } - elementList.add(localGetObjectResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectResponse object = - new GetObjectResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse").equals(reader.getName())){ - - object.setGetObjectResponse(com.amazon.s3.GetObjectResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetObjectResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetObjectResponse bean class + */ + + public class GetObjectResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetObjectResponse + */ + + + protected com.amazon.s3.GetObjectResult localGetObjectResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.GetObjectResult + */ + public com.amazon.s3.GetObjectResult getGetObjectResponse(){ + return localGetObjectResponse; + } + + + + /** + * Auto generated setter method + * @param param GetObjectResponse + */ + public void setGetObjectResponse(com.amazon.s3.GetObjectResult param){ + + this.localGetObjectResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectResponse", + xmlWriter); + } + + + } + + if (localGetObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); + } + localGetObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectResponse")); + + + if (localGetObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); + } + elementList.add(localGetObjectResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectResponse object = + new GetObjectResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse").equals(reader.getName())){ + + object.setGetObjectResponse(com.amazon.s3.GetObjectResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/GetObjectResult.java b/awsapi/src/com/amazon/s3/GetObjectResult.java index a9582f2c81f..69aef9b4fa2 100644 --- a/awsapi/src/com/amazon/s3/GetObjectResult.java +++ b/awsapi/src/com/amazon/s3/GetObjectResult.java @@ -1,878 +1,894 @@ - -/** - * GetObjectResult.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * GetObjectResult bean class - */ - - public class GetObjectResult extends com.amazon.s3.Result - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = GetObjectResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Metadata - * This was an Array! - */ - - - protected com.amazon.s3.MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.MetadataEntry[] - */ - public com.amazon.s3.MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(com.amazon.s3.MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.MetadataEntry - */ - public void addMetadata(com.amazon.s3.MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new com.amazon.s3.MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (com.amazon.s3.MetadataEntry[])list.toArray( - new com.amazon.s3.MetadataEntry[list.size()]); - - } - - - /** - * field for Data - */ - - - protected javax.activation.DataHandler localData ; - - - /** - * Auto generated getter method - * @return javax.activation.DataHandler - */ - public javax.activation.DataHandler getData(){ - return localData; - } - - - - /** - * Auto generated setter method - * @param param Data - */ - public void setData(javax.activation.DataHandler param){ - - this.localData=param; - - - } - - - /** - * field for LastModified - */ - - - protected java.util.Calendar localLastModified ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getLastModified(){ - return localLastModified; - } - - - - /** - * Auto generated setter method - * @param param LastModified - */ - public void setLastModified(java.util.Calendar param){ - - this.localLastModified=param; - - - } - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectResult", - xmlWriter); - } - - - if (localStatus==null){ - throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); - } - localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status"), - factory,xmlWriter); - if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Data", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Data"); - } - - } else { - xmlWriter.writeStartElement("Data"); - } - - - if (localData!=null) - { - xmlWriter.writeDataHandler(localData); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"LastModified", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"LastModified"); - } - - } else { - xmlWriter.writeStartElement("LastModified"); - } - - - if (localLastModified==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); - attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResult")); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Status")); - - - if (localStatus==null){ - throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); - } - elementList.add(localStatus); - if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Data")); - - elementList.add(localData); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LastModified")); - - if (localLastModified != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - } else { - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectResult object = - new GetObjectResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectResult)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list2 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status").equals(reader.getName())){ - - object.setStatus(com.amazon.s3.Status.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list2.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone2 = false; - while(!loopDone2){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone2 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list2.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone2 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((com.amazon.s3.MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.MetadataEntry.class, - list2)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Data").equals(reader.getName())){ - reader.next(); - if (isReaderMTOMAware(reader) - && - java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))) - { - //MTOM aware reader - get the datahandler directly and put it in the object - object.setData( - (javax.activation.DataHandler) reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER)); - } else { - if (reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT && reader.getName().equals(new javax.xml.namespace.QName(org.apache.axiom.om.impl.MTOMConstants.XOP_NAMESPACE_URI, org.apache.axiom.om.impl.MTOMConstants.XOP_INCLUDE))) - { - java.lang.String id = org.apache.axiom.om.util.ElementHelper.getContentID(reader, "UTF-8"); - object.setData(((org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder) ((org.apache.axiom.om.impl.llom.OMStAXWrapper) reader).getBuilder()).getDataHandler(id)); - reader.next(); - - reader.next(); - - } else if(reader.hasText()) { - //Do the usual conversion - java.lang.String content = reader.getText(); - object.setData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBase64Binary(content)); - - reader.next(); - - } - } - - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLastModified( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * GetObjectResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * GetObjectResult bean class + */ + + public class GetObjectResult extends com.amazon.s3.Result + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = GetObjectResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Metadata + * This was an Array! + */ + + + protected com.amazon.s3.MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.MetadataEntry[] + */ + public com.amazon.s3.MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(com.amazon.s3.MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.MetadataEntry + */ + public void addMetadata(com.amazon.s3.MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new com.amazon.s3.MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (com.amazon.s3.MetadataEntry[])list.toArray( + new com.amazon.s3.MetadataEntry[list.size()]); + + } + + + /** + * field for Data + */ + + + protected javax.activation.DataHandler localData ; + + + /** + * Auto generated getter method + * @return javax.activation.DataHandler + */ + public javax.activation.DataHandler getData(){ + return localData; + } + + + + /** + * Auto generated setter method + * @param param Data + */ + public void setData(javax.activation.DataHandler param){ + + this.localData=param; + + + } + + + /** + * field for LastModified + */ + + + protected java.util.Calendar localLastModified ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getLastModified(){ + return localLastModified; + } + + + + /** + * Auto generated setter method + * @param param LastModified + */ + public void setLastModified(java.util.Calendar param){ + + this.localLastModified=param; + + + } + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectResult", + xmlWriter); + } + + + if (localStatus==null){ + throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); + } + localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status"), + factory,xmlWriter); + if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Data", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Data"); + } + + } else { + xmlWriter.writeStartElement("Data"); + } + + + if (localData!=null) + { + xmlWriter.writeDataHandler(localData); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"LastModified", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"LastModified"); + } + + } else { + xmlWriter.writeStartElement("LastModified"); + } + + + if (localLastModified==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); + attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResult")); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Status")); + + + if (localStatus==null){ + throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); + } + elementList.add(localStatus); + if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Data")); + + elementList.add(localData); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LastModified")); + + if (localLastModified != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + } else { + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectResult object = + new GetObjectResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectResult)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list2 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status").equals(reader.getName())){ + + object.setStatus(com.amazon.s3.Status.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list2.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone2 = false; + while(!loopDone2){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone2 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list2.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone2 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((com.amazon.s3.MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.MetadataEntry.class, + list2)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Data").equals(reader.getName())){ + reader.next(); + if (isReaderMTOMAware(reader) + && + java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))) + { + //MTOM aware reader - get the datahandler directly and put it in the object + object.setData( + (javax.activation.DataHandler) reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER)); + } else { + if (reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT && reader.getName().equals(new javax.xml.namespace.QName(org.apache.axiom.om.impl.MTOMConstants.XOP_NAMESPACE_URI, org.apache.axiom.om.impl.MTOMConstants.XOP_INCLUDE))) + { + java.lang.String id = org.apache.axiom.om.util.ElementHelper.getContentID(reader, "UTF-8"); + object.setData(((org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder) ((org.apache.axiom.om.impl.llom.OMStAXWrapper) reader).getBuilder()).getDataHandler(id)); + reader.next(); + + reader.next(); + + } else if(reader.hasText()) { + //Do the usual conversion + java.lang.String content = reader.getText(); + object.setData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBase64Binary(content)); + + reader.next(); + + } + } + + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLastModified( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/Grant.java b/awsapi/src/com/amazon/s3/Grant.java index aa65c640edc..ff151307c16 100644 --- a/awsapi/src/com/amazon/s3/Grant.java +++ b/awsapi/src/com/amazon/s3/Grant.java @@ -1,513 +1,529 @@ - -/** - * Grant.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * Grant bean class - */ - - public class Grant - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = Grant - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Grantee - */ - - - protected com.amazon.s3.Grantee localGrantee ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.Grantee - */ - public com.amazon.s3.Grantee getGrantee(){ - return localGrantee; - } - - - - /** - * Auto generated setter method - * @param param Grantee - */ - public void setGrantee(com.amazon.s3.Grantee param){ - - this.localGrantee=param; - - - } - - - /** - * field for Permission - */ - - - protected com.amazon.s3.Permission localPermission ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.Permission - */ - public com.amazon.s3.Permission getPermission(){ - return localPermission; - } - - - - /** - * Auto generated setter method - * @param param Permission - */ - public void setPermission(com.amazon.s3.Permission param){ - - this.localPermission=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Grant.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Grant", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Grant", - xmlWriter); - } - - - } - - if (localGrantee==null){ - throw new org.apache.axis2.databinding.ADBException("Grantee cannot be null!!"); - } - localGrantee.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grantee"), - factory,xmlWriter); - - if (localPermission==null){ - throw new org.apache.axis2.databinding.ADBException("Permission cannot be null!!"); - } - localPermission.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Permission"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Grantee")); - - - if (localGrantee==null){ - throw new org.apache.axis2.databinding.ADBException("Grantee cannot be null!!"); - } - elementList.add(localGrantee); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Permission")); - - - if (localPermission==null){ - throw new org.apache.axis2.databinding.ADBException("Permission cannot be null!!"); - } - elementList.add(localPermission); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Grant parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Grant object = - new Grant(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"Grant".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Grant)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grantee").equals(reader.getName())){ - - object.setGrantee(com.amazon.s3.Grantee.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Permission").equals(reader.getName())){ - - object.setPermission(com.amazon.s3.Permission.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * Grant.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * Grant bean class + */ + + public class Grant + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = Grant + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Grantee + */ + + + protected com.amazon.s3.Grantee localGrantee ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.Grantee + */ + public com.amazon.s3.Grantee getGrantee(){ + return localGrantee; + } + + + + /** + * Auto generated setter method + * @param param Grantee + */ + public void setGrantee(com.amazon.s3.Grantee param){ + + this.localGrantee=param; + + + } + + + /** + * field for Permission + */ + + + protected com.amazon.s3.Permission localPermission ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.Permission + */ + public com.amazon.s3.Permission getPermission(){ + return localPermission; + } + + + + /** + * Auto generated setter method + * @param param Permission + */ + public void setPermission(com.amazon.s3.Permission param){ + + this.localPermission=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Grant.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Grant", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Grant", + xmlWriter); + } + + + } + + if (localGrantee==null){ + throw new org.apache.axis2.databinding.ADBException("Grantee cannot be null!!"); + } + localGrantee.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grantee"), + factory,xmlWriter); + + if (localPermission==null){ + throw new org.apache.axis2.databinding.ADBException("Permission cannot be null!!"); + } + localPermission.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Permission"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Grantee")); + + + if (localGrantee==null){ + throw new org.apache.axis2.databinding.ADBException("Grantee cannot be null!!"); + } + elementList.add(localGrantee); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Permission")); + + + if (localPermission==null){ + throw new org.apache.axis2.databinding.ADBException("Permission cannot be null!!"); + } + elementList.add(localPermission); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Grant parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Grant object = + new Grant(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"Grant".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (Grant)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grantee").equals(reader.getName())){ + + object.setGrantee(com.amazon.s3.Grantee.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Permission").equals(reader.getName())){ + + object.setPermission(com.amazon.s3.Permission.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/Grantee.java b/awsapi/src/com/amazon/s3/Grantee.java index aa286bc11a2..4d73f56770d 100644 --- a/awsapi/src/com/amazon/s3/Grantee.java +++ b/awsapi/src/com/amazon/s3/Grantee.java @@ -1,386 +1,402 @@ - -/** - * Grantee.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * Grantee bean class - */ - - public abstract class Grantee - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = Grantee - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Grantee.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Grantee", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Grantee", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Grantee parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Grantee object = - null; - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"Grantee".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Grantee)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - throw new org.apache.axis2.databinding.ADBException("The an abstract class can not be instantiated !!!"); - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * Grantee.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * Grantee bean class + */ + + public abstract class Grantee + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = Grantee + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Grantee.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Grantee", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Grantee", + xmlWriter); + } + + + } + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Grantee parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Grantee object = + null; + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"Grantee".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (Grantee)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + throw new org.apache.axis2.databinding.ADBException("The an abstract class can not be instantiated !!!"); + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/Group.java b/awsapi/src/com/amazon/s3/Group.java index d6166f12b96..7c34aa9cacf 100644 --- a/awsapi/src/com/amazon/s3/Group.java +++ b/awsapi/src/com/amazon/s3/Group.java @@ -1,482 +1,498 @@ - -/** - * Group.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * Group bean class - */ - - public class Group extends com.amazon.s3.Grantee - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = Group - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for URI - */ - - - protected java.lang.String localURI ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getURI(){ - return localURI; - } - - - - /** - * Auto generated setter method - * @param param URI - */ - public void setURI(java.lang.String param){ - - this.localURI=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Group.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Group", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Group", - xmlWriter); - } - - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"URI", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"URI"); - } - - } else { - xmlWriter.writeStartElement("URI"); - } - - - if (localURI==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("URI cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localURI); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); - attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Group")); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "URI")); - - if (localURI != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localURI)); - } else { - throw new org.apache.axis2.databinding.ADBException("URI cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Group parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Group object = - new Group(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"Group".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Group)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","URI").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setURI( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * Group.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * Group bean class + */ + + public class Group extends com.amazon.s3.Grantee + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = Group + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for URI + */ + + + protected java.lang.String localURI ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getURI(){ + return localURI; + } + + + + /** + * Auto generated setter method + * @param param URI + */ + public void setURI(java.lang.String param){ + + this.localURI=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Group.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Group", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Group", + xmlWriter); + } + + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"URI", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"URI"); + } + + } else { + xmlWriter.writeStartElement("URI"); + } + + + if (localURI==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("URI cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localURI); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); + attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Group")); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "URI")); + + if (localURI != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localURI)); + } else { + throw new org.apache.axis2.databinding.ADBException("URI cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Group parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Group object = + new Group(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"Group".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (Group)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","URI").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setURI( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListAllMyBuckets.java b/awsapi/src/com/amazon/s3/ListAllMyBuckets.java index c29951a0d81..aee47417b7f 100644 --- a/awsapi/src/com/amazon/s3/ListAllMyBuckets.java +++ b/awsapi/src/com/amazon/s3/ListAllMyBuckets.java @@ -1,707 +1,723 @@ - -/** - * ListAllMyBuckets.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListAllMyBuckets bean class - */ - - public class ListAllMyBuckets - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "ListAllMyBuckets", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListAllMyBuckets.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListAllMyBuckets", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListAllMyBuckets", - xmlWriter); - } - - - } - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListAllMyBuckets parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListAllMyBuckets object = - new ListAllMyBuckets(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListAllMyBuckets".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListAllMyBuckets)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListAllMyBuckets.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListAllMyBuckets bean class + */ + + public class ListAllMyBuckets + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "ListAllMyBuckets", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListAllMyBuckets.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListAllMyBuckets", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListAllMyBuckets", + xmlWriter); + } + + + } + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListAllMyBuckets parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListAllMyBuckets object = + new ListAllMyBuckets(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListAllMyBuckets".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListAllMyBuckets)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListAllMyBucketsEntry.java b/awsapi/src/com/amazon/s3/ListAllMyBucketsEntry.java index af212a6129f..e2d2c29da68 100644 --- a/awsapi/src/com/amazon/s3/ListAllMyBucketsEntry.java +++ b/awsapi/src/com/amazon/s3/ListAllMyBucketsEntry.java @@ -1,575 +1,591 @@ - -/** - * ListAllMyBucketsEntry.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListAllMyBucketsEntry bean class - */ - - public class ListAllMyBucketsEntry - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListAllMyBucketsEntry - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Name - */ - - - protected java.lang.String localName ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getName(){ - return localName; - } - - - - /** - * Auto generated setter method - * @param param Name - */ - public void setName(java.lang.String param){ - - this.localName=param; - - - } - - - /** - * field for CreationDate - */ - - - protected java.util.Calendar localCreationDate ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getCreationDate(){ - return localCreationDate; - } - - - - /** - * Auto generated setter method - * @param param CreationDate - */ - public void setCreationDate(java.util.Calendar param){ - - this.localCreationDate=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListAllMyBucketsEntry.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListAllMyBucketsEntry", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListAllMyBucketsEntry", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Name", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Name"); - } - - } else { - xmlWriter.writeStartElement("Name"); - } - - - if (localName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localName); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"CreationDate", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"CreationDate"); - } - - } else { - xmlWriter.writeStartElement("CreationDate"); - } - - - if (localCreationDate==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("CreationDate cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCreationDate)); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Name")); - - if (localName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CreationDate")); - - if (localCreationDate != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCreationDate)); - } else { - throw new org.apache.axis2.databinding.ADBException("CreationDate cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListAllMyBucketsEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListAllMyBucketsEntry object = - new ListAllMyBucketsEntry(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListAllMyBucketsEntry".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListAllMyBucketsEntry)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreationDate").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCreationDate( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListAllMyBucketsEntry.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListAllMyBucketsEntry bean class + */ + + public class ListAllMyBucketsEntry + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListAllMyBucketsEntry + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Name + */ + + + protected java.lang.String localName ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getName(){ + return localName; + } + + + + /** + * Auto generated setter method + * @param param Name + */ + public void setName(java.lang.String param){ + + this.localName=param; + + + } + + + /** + * field for CreationDate + */ + + + protected java.util.Calendar localCreationDate ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getCreationDate(){ + return localCreationDate; + } + + + + /** + * Auto generated setter method + * @param param CreationDate + */ + public void setCreationDate(java.util.Calendar param){ + + this.localCreationDate=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListAllMyBucketsEntry.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListAllMyBucketsEntry", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListAllMyBucketsEntry", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Name", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Name"); + } + + } else { + xmlWriter.writeStartElement("Name"); + } + + + if (localName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localName); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"CreationDate", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"CreationDate"); + } + + } else { + xmlWriter.writeStartElement("CreationDate"); + } + + + if (localCreationDate==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("CreationDate cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCreationDate)); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Name")); + + if (localName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); + } else { + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CreationDate")); + + if (localCreationDate != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCreationDate)); + } else { + throw new org.apache.axis2.databinding.ADBException("CreationDate cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListAllMyBucketsEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListAllMyBucketsEntry object = + new ListAllMyBucketsEntry(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListAllMyBucketsEntry".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListAllMyBucketsEntry)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreationDate").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCreationDate( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListAllMyBucketsList.java b/awsapi/src/com/amazon/s3/ListAllMyBucketsList.java index f6140dfe749..84a64de1d10 100644 --- a/awsapi/src/com/amazon/s3/ListAllMyBucketsList.java +++ b/awsapi/src/com/amazon/s3/ListAllMyBucketsList.java @@ -1,560 +1,576 @@ - -/** - * ListAllMyBucketsList.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListAllMyBucketsList bean class - */ - - public class ListAllMyBucketsList - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListAllMyBucketsList - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - * This was an Array! - */ - - - protected com.amazon.s3.ListAllMyBucketsEntry[] localBucket ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localBucketTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.ListAllMyBucketsEntry[] - */ - public com.amazon.s3.ListAllMyBucketsEntry[] getBucket(){ - return localBucket; - } - - - - - - - /** - * validate the array for Bucket - */ - protected void validateBucket(com.amazon.s3.ListAllMyBucketsEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(com.amazon.s3.ListAllMyBucketsEntry[] param){ - - validateBucket(param); - - - if (param != null){ - //update the setting tracker - localBucketTracker = true; - } else { - localBucketTracker = false; - - } - - this.localBucket=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.ListAllMyBucketsEntry - */ - public void addBucket(com.amazon.s3.ListAllMyBucketsEntry param){ - if (localBucket == null){ - localBucket = new com.amazon.s3.ListAllMyBucketsEntry[]{}; - } - - - //update the setting tracker - localBucketTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localBucket); - list.add(param); - this.localBucket = - (com.amazon.s3.ListAllMyBucketsEntry[])list.toArray( - new com.amazon.s3.ListAllMyBucketsEntry[list.size()]); - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListAllMyBucketsList.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListAllMyBucketsList", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListAllMyBucketsList", - xmlWriter); - } - - - } - if (localBucketTracker){ - if (localBucket!=null){ - for (int i = 0;i < localBucket.length;i++){ - if (localBucket[i] != null){ - localBucket[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localBucketTracker){ - if (localBucket!=null) { - for (int i = 0;i < localBucket.length;i++){ - - if (localBucket[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - elementList.add(localBucket[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListAllMyBucketsList parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListAllMyBucketsList object = - new ListAllMyBucketsList(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListAllMyBucketsList".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListAllMyBucketsList)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list1.add(com.amazon.s3.ListAllMyBucketsEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while(!loopDone1){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - list1.add(com.amazon.s3.ListAllMyBucketsEntry.Factory.parse(reader)); - - }else{ - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setBucket((com.amazon.s3.ListAllMyBucketsEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.ListAllMyBucketsEntry.class, - list1)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListAllMyBucketsList.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListAllMyBucketsList bean class + */ + + public class ListAllMyBucketsList + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListAllMyBucketsList + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + * This was an Array! + */ + + + protected com.amazon.s3.ListAllMyBucketsEntry[] localBucket ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localBucketTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.ListAllMyBucketsEntry[] + */ + public com.amazon.s3.ListAllMyBucketsEntry[] getBucket(){ + return localBucket; + } + + + + + + + /** + * validate the array for Bucket + */ + protected void validateBucket(com.amazon.s3.ListAllMyBucketsEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(com.amazon.s3.ListAllMyBucketsEntry[] param){ + + validateBucket(param); + + + if (param != null){ + //update the setting tracker + localBucketTracker = true; + } else { + localBucketTracker = false; + + } + + this.localBucket=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.ListAllMyBucketsEntry + */ + public void addBucket(com.amazon.s3.ListAllMyBucketsEntry param){ + if (localBucket == null){ + localBucket = new com.amazon.s3.ListAllMyBucketsEntry[]{}; + } + + + //update the setting tracker + localBucketTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localBucket); + list.add(param); + this.localBucket = + (com.amazon.s3.ListAllMyBucketsEntry[])list.toArray( + new com.amazon.s3.ListAllMyBucketsEntry[list.size()]); + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListAllMyBucketsList.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListAllMyBucketsList", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListAllMyBucketsList", + xmlWriter); + } + + + } + if (localBucketTracker){ + if (localBucket!=null){ + for (int i = 0;i < localBucket.length;i++){ + if (localBucket[i] != null){ + localBucket[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + } + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localBucketTracker){ + if (localBucket!=null) { + for (int i = 0;i < localBucket.length;i++){ + + if (localBucket[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + elementList.add(localBucket[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + } + + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListAllMyBucketsList parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListAllMyBucketsList object = + new ListAllMyBucketsList(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListAllMyBucketsList".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListAllMyBucketsList)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list1 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list1.add(com.amazon.s3.ListAllMyBucketsEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone1 = false; + while(!loopDone1){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone1 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + list1.add(com.amazon.s3.ListAllMyBucketsEntry.Factory.parse(reader)); + + }else{ + loopDone1 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setBucket((com.amazon.s3.ListAllMyBucketsEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.ListAllMyBucketsEntry.class, + list1)); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListAllMyBucketsResponse.java b/awsapi/src/com/amazon/s3/ListAllMyBucketsResponse.java index 1cf0a8728c9..469a41b796c 100644 --- a/awsapi/src/com/amazon/s3/ListAllMyBucketsResponse.java +++ b/awsapi/src/com/amazon/s3/ListAllMyBucketsResponse.java @@ -1,453 +1,469 @@ - -/** - * ListAllMyBucketsResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListAllMyBucketsResponse bean class - */ - - public class ListAllMyBucketsResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "ListAllMyBucketsResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for ListAllMyBucketsResponse - */ - - - protected com.amazon.s3.ListAllMyBucketsResult localListAllMyBucketsResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.ListAllMyBucketsResult - */ - public com.amazon.s3.ListAllMyBucketsResult getListAllMyBucketsResponse(){ - return localListAllMyBucketsResponse; - } - - - - /** - * Auto generated setter method - * @param param ListAllMyBucketsResponse - */ - public void setListAllMyBucketsResponse(com.amazon.s3.ListAllMyBucketsResult param){ - - this.localListAllMyBucketsResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListAllMyBucketsResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListAllMyBucketsResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListAllMyBucketsResponse", - xmlWriter); - } - - - } - - if (localListAllMyBucketsResponse==null){ - throw new org.apache.axis2.databinding.ADBException("ListAllMyBucketsResponse cannot be null!!"); - } - localListAllMyBucketsResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListAllMyBucketsResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ListAllMyBucketsResponse")); - - - if (localListAllMyBucketsResponse==null){ - throw new org.apache.axis2.databinding.ADBException("ListAllMyBucketsResponse cannot be null!!"); - } - elementList.add(localListAllMyBucketsResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListAllMyBucketsResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListAllMyBucketsResponse object = - new ListAllMyBucketsResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListAllMyBucketsResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListAllMyBucketsResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListAllMyBucketsResponse").equals(reader.getName())){ - - object.setListAllMyBucketsResponse(com.amazon.s3.ListAllMyBucketsResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListAllMyBucketsResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListAllMyBucketsResponse bean class + */ + + public class ListAllMyBucketsResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "ListAllMyBucketsResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for ListAllMyBucketsResponse + */ + + + protected com.amazon.s3.ListAllMyBucketsResult localListAllMyBucketsResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.ListAllMyBucketsResult + */ + public com.amazon.s3.ListAllMyBucketsResult getListAllMyBucketsResponse(){ + return localListAllMyBucketsResponse; + } + + + + /** + * Auto generated setter method + * @param param ListAllMyBucketsResponse + */ + public void setListAllMyBucketsResponse(com.amazon.s3.ListAllMyBucketsResult param){ + + this.localListAllMyBucketsResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListAllMyBucketsResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListAllMyBucketsResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListAllMyBucketsResponse", + xmlWriter); + } + + + } + + if (localListAllMyBucketsResponse==null){ + throw new org.apache.axis2.databinding.ADBException("ListAllMyBucketsResponse cannot be null!!"); + } + localListAllMyBucketsResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListAllMyBucketsResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ListAllMyBucketsResponse")); + + + if (localListAllMyBucketsResponse==null){ + throw new org.apache.axis2.databinding.ADBException("ListAllMyBucketsResponse cannot be null!!"); + } + elementList.add(localListAllMyBucketsResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListAllMyBucketsResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListAllMyBucketsResponse object = + new ListAllMyBucketsResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListAllMyBucketsResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListAllMyBucketsResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListAllMyBucketsResponse").equals(reader.getName())){ + + object.setListAllMyBucketsResponse(com.amazon.s3.ListAllMyBucketsResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListAllMyBucketsResult.java b/awsapi/src/com/amazon/s3/ListAllMyBucketsResult.java index 70abd02ba34..02ae481df92 100644 --- a/awsapi/src/com/amazon/s3/ListAllMyBucketsResult.java +++ b/awsapi/src/com/amazon/s3/ListAllMyBucketsResult.java @@ -1,513 +1,529 @@ - -/** - * ListAllMyBucketsResult.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListAllMyBucketsResult bean class - */ - - public class ListAllMyBucketsResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListAllMyBucketsResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Owner - */ - - - protected com.amazon.s3.CanonicalUser localOwner ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.CanonicalUser - */ - public com.amazon.s3.CanonicalUser getOwner(){ - return localOwner; - } - - - - /** - * Auto generated setter method - * @param param Owner - */ - public void setOwner(com.amazon.s3.CanonicalUser param){ - - this.localOwner=param; - - - } - - - /** - * field for Buckets - */ - - - protected com.amazon.s3.ListAllMyBucketsList localBuckets ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.ListAllMyBucketsList - */ - public com.amazon.s3.ListAllMyBucketsList getBuckets(){ - return localBuckets; - } - - - - /** - * Auto generated setter method - * @param param Buckets - */ - public void setBuckets(com.amazon.s3.ListAllMyBucketsList param){ - - this.localBuckets=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListAllMyBucketsResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListAllMyBucketsResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListAllMyBucketsResult", - xmlWriter); - } - - - } - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), - factory,xmlWriter); - - if (localBuckets==null){ - throw new org.apache.axis2.databinding.ADBException("Buckets cannot be null!!"); - } - localBuckets.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Buckets"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Owner")); - - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - elementList.add(localOwner); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Buckets")); - - - if (localBuckets==null){ - throw new org.apache.axis2.databinding.ADBException("Buckets cannot be null!!"); - } - elementList.add(localBuckets); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListAllMyBucketsResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListAllMyBucketsResult object = - new ListAllMyBucketsResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListAllMyBucketsResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListAllMyBucketsResult)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ - - object.setOwner(com.amazon.s3.CanonicalUser.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Buckets").equals(reader.getName())){ - - object.setBuckets(com.amazon.s3.ListAllMyBucketsList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListAllMyBucketsResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListAllMyBucketsResult bean class + */ + + public class ListAllMyBucketsResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListAllMyBucketsResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Owner + */ + + + protected com.amazon.s3.CanonicalUser localOwner ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.CanonicalUser + */ + public com.amazon.s3.CanonicalUser getOwner(){ + return localOwner; + } + + + + /** + * Auto generated setter method + * @param param Owner + */ + public void setOwner(com.amazon.s3.CanonicalUser param){ + + this.localOwner=param; + + + } + + + /** + * field for Buckets + */ + + + protected com.amazon.s3.ListAllMyBucketsList localBuckets ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.ListAllMyBucketsList + */ + public com.amazon.s3.ListAllMyBucketsList getBuckets(){ + return localBuckets; + } + + + + /** + * Auto generated setter method + * @param param Buckets + */ + public void setBuckets(com.amazon.s3.ListAllMyBucketsList param){ + + this.localBuckets=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListAllMyBucketsResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListAllMyBucketsResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListAllMyBucketsResult", + xmlWriter); + } + + + } + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), + factory,xmlWriter); + + if (localBuckets==null){ + throw new org.apache.axis2.databinding.ADBException("Buckets cannot be null!!"); + } + localBuckets.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Buckets"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Owner")); + + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + elementList.add(localOwner); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Buckets")); + + + if (localBuckets==null){ + throw new org.apache.axis2.databinding.ADBException("Buckets cannot be null!!"); + } + elementList.add(localBuckets); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListAllMyBucketsResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListAllMyBucketsResult object = + new ListAllMyBucketsResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListAllMyBucketsResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListAllMyBucketsResult)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ + + object.setOwner(com.amazon.s3.CanonicalUser.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Buckets").equals(reader.getName())){ + + object.setBuckets(com.amazon.s3.ListAllMyBucketsList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListBucket.java b/awsapi/src/com/amazon/s3/ListBucket.java index 17ffd92109e..f6e360ef827 100644 --- a/awsapi/src/com/amazon/s3/ListBucket.java +++ b/awsapi/src/com/amazon/s3/ListBucket.java @@ -1,1319 +1,1335 @@ - -/** - * ListBucket.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListBucket bean class - */ - - public class ListBucket - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "ListBucket", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Prefix - */ - - - protected java.lang.String localPrefix ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localPrefixTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getPrefix(){ - return localPrefix; - } - - - - /** - * Auto generated setter method - * @param param Prefix - */ - public void setPrefix(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localPrefixTracker = true; - } else { - localPrefixTracker = false; - - } - - this.localPrefix=param; - - - } - - - /** - * field for Marker - */ - - - protected java.lang.String localMarker ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMarkerTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getMarker(){ - return localMarker; - } - - - - /** - * Auto generated setter method - * @param param Marker - */ - public void setMarker(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localMarkerTracker = true; - } else { - localMarkerTracker = false; - - } - - this.localMarker=param; - - - } - - - /** - * field for MaxKeys - */ - - - protected int localMaxKeys ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMaxKeysTracker = false ; - - - /** - * Auto generated getter method - * @return int - */ - public int getMaxKeys(){ - return localMaxKeys; - } - - - - /** - * Auto generated setter method - * @param param MaxKeys - */ - public void setMaxKeys(int param){ - - // setting primitive attribute tracker to true - - if (param==java.lang.Integer.MIN_VALUE) { - localMaxKeysTracker = false; - - } else { - localMaxKeysTracker = true; - } - - this.localMaxKeys=param; - - - } - - - /** - * field for Delimiter - */ - - - protected java.lang.String localDelimiter ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localDelimiterTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDelimiter(){ - return localDelimiter; - } - - - - /** - * Auto generated setter method - * @param param Delimiter - */ - public void setDelimiter(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localDelimiterTracker = true; - } else { - localDelimiterTracker = false; - - } - - this.localDelimiter=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListBucket.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListBucket", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListBucket", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localPrefixTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Prefix", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Prefix"); - } - - } else { - xmlWriter.writeStartElement("Prefix"); - } - - - if (localPrefix==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localPrefix); - - } - - xmlWriter.writeEndElement(); - } if (localMarkerTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Marker", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Marker"); - } - - } else { - xmlWriter.writeStartElement("Marker"); - } - - - if (localMarker==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localMarker); - - } - - xmlWriter.writeEndElement(); - } if (localMaxKeysTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"MaxKeys", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"MaxKeys"); - } - - } else { - xmlWriter.writeStartElement("MaxKeys"); - } - - if (localMaxKeys==java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); - } - - xmlWriter.writeEndElement(); - } if (localDelimiterTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Delimiter", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Delimiter"); - } - - } else { - xmlWriter.writeStartElement("Delimiter"); - } - - - if (localDelimiter==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDelimiter); - - } - - xmlWriter.writeEndElement(); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localPrefixTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Prefix")); - - if (localPrefix != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); - } else { - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - } - } if (localMarkerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Marker")); - - if (localMarker != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMarker)); - } else { - throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); - } - } if (localMaxKeysTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "MaxKeys")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); - } if (localDelimiterTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Delimiter")); - - if (localDelimiter != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); - } else { - throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); - } - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListBucket object = - new ListBucket(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListBucket".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListBucket)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setPrefix( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Marker").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setMarker( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MaxKeys").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setMaxKeys( - org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setMaxKeys(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Delimiter").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDelimiter( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListBucket.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListBucket bean class + */ + + public class ListBucket + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "ListBucket", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Prefix + */ + + + protected java.lang.String localPrefix ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localPrefixTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getPrefix(){ + return localPrefix; + } + + + + /** + * Auto generated setter method + * @param param Prefix + */ + public void setPrefix(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localPrefixTracker = true; + } else { + localPrefixTracker = false; + + } + + this.localPrefix=param; + + + } + + + /** + * field for Marker + */ + + + protected java.lang.String localMarker ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMarkerTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getMarker(){ + return localMarker; + } + + + + /** + * Auto generated setter method + * @param param Marker + */ + public void setMarker(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localMarkerTracker = true; + } else { + localMarkerTracker = false; + + } + + this.localMarker=param; + + + } + + + /** + * field for MaxKeys + */ + + + protected int localMaxKeys ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMaxKeysTracker = false ; + + + /** + * Auto generated getter method + * @return int + */ + public int getMaxKeys(){ + return localMaxKeys; + } + + + + /** + * Auto generated setter method + * @param param MaxKeys + */ + public void setMaxKeys(int param){ + + // setting primitive attribute tracker to true + + if (param==java.lang.Integer.MIN_VALUE) { + localMaxKeysTracker = false; + + } else { + localMaxKeysTracker = true; + } + + this.localMaxKeys=param; + + + } + + + /** + * field for Delimiter + */ + + + protected java.lang.String localDelimiter ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localDelimiterTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDelimiter(){ + return localDelimiter; + } + + + + /** + * Auto generated setter method + * @param param Delimiter + */ + public void setDelimiter(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localDelimiterTracker = true; + } else { + localDelimiterTracker = false; + + } + + this.localDelimiter=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListBucket.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListBucket", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListBucket", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localPrefixTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Prefix", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Prefix"); + } + + } else { + xmlWriter.writeStartElement("Prefix"); + } + + + if (localPrefix==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localPrefix); + + } + + xmlWriter.writeEndElement(); + } if (localMarkerTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Marker", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Marker"); + } + + } else { + xmlWriter.writeStartElement("Marker"); + } + + + if (localMarker==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localMarker); + + } + + xmlWriter.writeEndElement(); + } if (localMaxKeysTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"MaxKeys", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"MaxKeys"); + } + + } else { + xmlWriter.writeStartElement("MaxKeys"); + } + + if (localMaxKeys==java.lang.Integer.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); + } + + xmlWriter.writeEndElement(); + } if (localDelimiterTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Delimiter", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Delimiter"); + } + + } else { + xmlWriter.writeStartElement("Delimiter"); + } + + + if (localDelimiter==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDelimiter); + + } + + xmlWriter.writeEndElement(); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localPrefixTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Prefix")); + + if (localPrefix != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); + } else { + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + } + } if (localMarkerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Marker")); + + if (localMarker != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMarker)); + } else { + throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); + } + } if (localMaxKeysTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "MaxKeys")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); + } if (localDelimiterTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Delimiter")); + + if (localDelimiter != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); + } else { + throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); + } + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListBucket object = + new ListBucket(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListBucket".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListBucket)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setPrefix( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Marker").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setMarker( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MaxKeys").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setMaxKeys( + org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + object.setMaxKeys(java.lang.Integer.MIN_VALUE); + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Delimiter").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDelimiter( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListBucketResponse.java b/awsapi/src/com/amazon/s3/ListBucketResponse.java index cc00c574432..2fa238a9ce7 100644 --- a/awsapi/src/com/amazon/s3/ListBucketResponse.java +++ b/awsapi/src/com/amazon/s3/ListBucketResponse.java @@ -1,453 +1,469 @@ - -/** - * ListBucketResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListBucketResponse bean class - */ - - public class ListBucketResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "ListBucketResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for ListBucketResponse - */ - - - protected com.amazon.s3.ListBucketResult localListBucketResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.ListBucketResult - */ - public com.amazon.s3.ListBucketResult getListBucketResponse(){ - return localListBucketResponse; - } - - - - /** - * Auto generated setter method - * @param param ListBucketResponse - */ - public void setListBucketResponse(com.amazon.s3.ListBucketResult param){ - - this.localListBucketResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListBucketResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListBucketResponse", - xmlWriter); - } - - - } - - if (localListBucketResponse==null){ - throw new org.apache.axis2.databinding.ADBException("ListBucketResponse cannot be null!!"); - } - localListBucketResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListBucketResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ListBucketResponse")); - - - if (localListBucketResponse==null){ - throw new org.apache.axis2.databinding.ADBException("ListBucketResponse cannot be null!!"); - } - elementList.add(localListBucketResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListBucketResponse object = - new ListBucketResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListBucketResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListBucketResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListBucketResponse").equals(reader.getName())){ - - object.setListBucketResponse(com.amazon.s3.ListBucketResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListBucketResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListBucketResponse bean class + */ + + public class ListBucketResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "ListBucketResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for ListBucketResponse + */ + + + protected com.amazon.s3.ListBucketResult localListBucketResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.ListBucketResult + */ + public com.amazon.s3.ListBucketResult getListBucketResponse(){ + return localListBucketResponse; + } + + + + /** + * Auto generated setter method + * @param param ListBucketResponse + */ + public void setListBucketResponse(com.amazon.s3.ListBucketResult param){ + + this.localListBucketResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListBucketResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListBucketResponse", + xmlWriter); + } + + + } + + if (localListBucketResponse==null){ + throw new org.apache.axis2.databinding.ADBException("ListBucketResponse cannot be null!!"); + } + localListBucketResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListBucketResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ListBucketResponse")); + + + if (localListBucketResponse==null){ + throw new org.apache.axis2.databinding.ADBException("ListBucketResponse cannot be null!!"); + } + elementList.add(localListBucketResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListBucketResponse object = + new ListBucketResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListBucketResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListBucketResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListBucketResponse").equals(reader.getName())){ + + object.setListBucketResponse(com.amazon.s3.ListBucketResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListBucketResult.java b/awsapi/src/com/amazon/s3/ListBucketResult.java index 6b3b5c38e15..592e12fa047 100644 --- a/awsapi/src/com/amazon/s3/ListBucketResult.java +++ b/awsapi/src/com/amazon/s3/ListBucketResult.java @@ -1,1552 +1,1568 @@ - -/** - * ListBucketResult.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListBucketResult bean class - */ - - public class ListBucketResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListBucketResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Metadata - * This was an Array! - */ - - - protected com.amazon.s3.MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.MetadataEntry[] - */ - public com.amazon.s3.MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(com.amazon.s3.MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.MetadataEntry - */ - public void addMetadata(com.amazon.s3.MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new com.amazon.s3.MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (com.amazon.s3.MetadataEntry[])list.toArray( - new com.amazon.s3.MetadataEntry[list.size()]); - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getName(){ - return localName; - } - - - - /** - * Auto generated setter method - * @param param Name - */ - public void setName(java.lang.String param){ - - this.localName=param; - - - } - - - /** - * field for Prefix - */ - - - protected java.lang.String localPrefix ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getPrefix(){ - return localPrefix; - } - - - - /** - * Auto generated setter method - * @param param Prefix - */ - public void setPrefix(java.lang.String param){ - - this.localPrefix=param; - - - } - - - /** - * field for Marker - */ - - - protected java.lang.String localMarker ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getMarker(){ - return localMarker; - } - - - - /** - * Auto generated setter method - * @param param Marker - */ - public void setMarker(java.lang.String param){ - - this.localMarker=param; - - - } - - - /** - * field for NextMarker - */ - - - protected java.lang.String localNextMarker ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localNextMarkerTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getNextMarker(){ - return localNextMarker; - } - - - - /** - * Auto generated setter method - * @param param NextMarker - */ - public void setNextMarker(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localNextMarkerTracker = true; - } else { - localNextMarkerTracker = false; - - } - - this.localNextMarker=param; - - - } - - - /** - * field for MaxKeys - */ - - - protected int localMaxKeys ; - - - /** - * Auto generated getter method - * @return int - */ - public int getMaxKeys(){ - return localMaxKeys; - } - - - - /** - * Auto generated setter method - * @param param MaxKeys - */ - public void setMaxKeys(int param){ - - this.localMaxKeys=param; - - - } - - - /** - * field for Delimiter - */ - - - protected java.lang.String localDelimiter ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localDelimiterTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDelimiter(){ - return localDelimiter; - } - - - - /** - * Auto generated setter method - * @param param Delimiter - */ - public void setDelimiter(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localDelimiterTracker = true; - } else { - localDelimiterTracker = false; - - } - - this.localDelimiter=param; - - - } - - - /** - * field for IsTruncated - */ - - - protected boolean localIsTruncated ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getIsTruncated(){ - return localIsTruncated; - } - - - - /** - * Auto generated setter method - * @param param IsTruncated - */ - public void setIsTruncated(boolean param){ - - this.localIsTruncated=param; - - - } - - - /** - * field for Contents - * This was an Array! - */ - - - protected com.amazon.s3.ListEntry[] localContents ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localContentsTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.ListEntry[] - */ - public com.amazon.s3.ListEntry[] getContents(){ - return localContents; - } - - - - - - - /** - * validate the array for Contents - */ - protected void validateContents(com.amazon.s3.ListEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param Contents - */ - public void setContents(com.amazon.s3.ListEntry[] param){ - - validateContents(param); - - - if (param != null){ - //update the setting tracker - localContentsTracker = true; - } else { - localContentsTracker = false; - - } - - this.localContents=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.ListEntry - */ - public void addContents(com.amazon.s3.ListEntry param){ - if (localContents == null){ - localContents = new com.amazon.s3.ListEntry[]{}; - } - - - //update the setting tracker - localContentsTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localContents); - list.add(param); - this.localContents = - (com.amazon.s3.ListEntry[])list.toArray( - new com.amazon.s3.ListEntry[list.size()]); - - } - - - /** - * field for CommonPrefixes - * This was an Array! - */ - - - protected com.amazon.s3.PrefixEntry[] localCommonPrefixes ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCommonPrefixesTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.PrefixEntry[] - */ - public com.amazon.s3.PrefixEntry[] getCommonPrefixes(){ - return localCommonPrefixes; - } - - - - - - - /** - * validate the array for CommonPrefixes - */ - protected void validateCommonPrefixes(com.amazon.s3.PrefixEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param CommonPrefixes - */ - public void setCommonPrefixes(com.amazon.s3.PrefixEntry[] param){ - - validateCommonPrefixes(param); - - - if (param != null){ - //update the setting tracker - localCommonPrefixesTracker = true; - } else { - localCommonPrefixesTracker = false; - - } - - this.localCommonPrefixes=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.PrefixEntry - */ - public void addCommonPrefixes(com.amazon.s3.PrefixEntry param){ - if (localCommonPrefixes == null){ - localCommonPrefixes = new com.amazon.s3.PrefixEntry[]{}; - } - - - //update the setting tracker - localCommonPrefixesTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localCommonPrefixes); - list.add(param); - this.localCommonPrefixes = - (com.amazon.s3.PrefixEntry[])list.toArray( - new com.amazon.s3.PrefixEntry[list.size()]); - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListBucketResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListBucketResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListBucketResult", - xmlWriter); - } - - - } - if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Name", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Name"); - } - - } else { - xmlWriter.writeStartElement("Name"); - } - - - if (localName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localName); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Prefix", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Prefix"); - } - - } else { - xmlWriter.writeStartElement("Prefix"); - } - - - if (localPrefix==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localPrefix); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Marker", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Marker"); - } - - } else { - xmlWriter.writeStartElement("Marker"); - } - - - if (localMarker==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localMarker); - - } - - xmlWriter.writeEndElement(); - if (localNextMarkerTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"NextMarker", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"NextMarker"); - } - - } else { - xmlWriter.writeStartElement("NextMarker"); - } - - - if (localNextMarker==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("NextMarker cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localNextMarker); - - } - - xmlWriter.writeEndElement(); - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"MaxKeys", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"MaxKeys"); - } - - } else { - xmlWriter.writeStartElement("MaxKeys"); - } - - if (localMaxKeys==java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); - } - - xmlWriter.writeEndElement(); - if (localDelimiterTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Delimiter", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Delimiter"); - } - - } else { - xmlWriter.writeStartElement("Delimiter"); - } - - - if (localDelimiter==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDelimiter); - - } - - xmlWriter.writeEndElement(); - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"IsTruncated", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IsTruncated"); - } - - } else { - xmlWriter.writeStartElement("IsTruncated"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("IsTruncated cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); - } - - xmlWriter.writeEndElement(); - if (localContentsTracker){ - if (localContents!=null){ - for (int i = 0;i < localContents.length;i++){ - if (localContents[i] != null){ - localContents[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Contents cannot be null!!"); - - } - } if (localCommonPrefixesTracker){ - if (localCommonPrefixes!=null){ - for (int i = 0;i < localCommonPrefixes.length;i++){ - if (localCommonPrefixes[i] != null){ - localCommonPrefixes[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Name")); - - if (localName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Prefix")); - - if (localPrefix != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); - } else { - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Marker")); - - if (localMarker != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMarker)); - } else { - throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); - } - if (localNextMarkerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "NextMarker")); - - if (localNextMarker != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNextMarker)); - } else { - throw new org.apache.axis2.databinding.ADBException("NextMarker cannot be null!!"); - } - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "MaxKeys")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); - if (localDelimiterTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Delimiter")); - - if (localDelimiter != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); - } else { - throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); - } - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IsTruncated")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); - if (localContentsTracker){ - if (localContents!=null) { - for (int i = 0;i < localContents.length;i++){ - - if (localContents[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Contents")); - elementList.add(localContents[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Contents cannot be null!!"); - - } - - } if (localCommonPrefixesTracker){ - if (localCommonPrefixes!=null) { - for (int i = 0;i < localCommonPrefixes.length;i++){ - - if (localCommonPrefixes[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CommonPrefixes")); - elementList.add(localCommonPrefixes[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListBucketResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListBucketResult object = - new ListBucketResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListBucketResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListBucketResult)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list1 = new java.util.ArrayList(); - - java.util.ArrayList list9 = new java.util.ArrayList(); - - java.util.ArrayList list10 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list1.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while(!loopDone1){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list1.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((com.amazon.s3.MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.MetadataEntry.class, - list1)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setPrefix( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Marker").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setMarker( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","NextMarker").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setNextMarker( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MaxKeys").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setMaxKeys( - org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Delimiter").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDelimiter( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IsTruncated").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setIsTruncated( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list9.add(com.amazon.s3.ListEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone9 = false; - while(!loopDone9){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone9 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents").equals(reader.getName())){ - list9.add(com.amazon.s3.ListEntry.Factory.parse(reader)); - - }else{ - loopDone9 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setContents((com.amazon.s3.ListEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.ListEntry.class, - list9)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list10.add(com.amazon.s3.PrefixEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone10 = false; - while(!loopDone10){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone10 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ - list10.add(com.amazon.s3.PrefixEntry.Factory.parse(reader)); - - }else{ - loopDone10 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCommonPrefixes((com.amazon.s3.PrefixEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.PrefixEntry.class, - list10)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListBucketResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListBucketResult bean class + */ + + public class ListBucketResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListBucketResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Metadata + * This was an Array! + */ + + + protected com.amazon.s3.MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.MetadataEntry[] + */ + public com.amazon.s3.MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(com.amazon.s3.MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.MetadataEntry + */ + public void addMetadata(com.amazon.s3.MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new com.amazon.s3.MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (com.amazon.s3.MetadataEntry[])list.toArray( + new com.amazon.s3.MetadataEntry[list.size()]); + + } + + + /** + * field for Name + */ + + + protected java.lang.String localName ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getName(){ + return localName; + } + + + + /** + * Auto generated setter method + * @param param Name + */ + public void setName(java.lang.String param){ + + this.localName=param; + + + } + + + /** + * field for Prefix + */ + + + protected java.lang.String localPrefix ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getPrefix(){ + return localPrefix; + } + + + + /** + * Auto generated setter method + * @param param Prefix + */ + public void setPrefix(java.lang.String param){ + + this.localPrefix=param; + + + } + + + /** + * field for Marker + */ + + + protected java.lang.String localMarker ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getMarker(){ + return localMarker; + } + + + + /** + * Auto generated setter method + * @param param Marker + */ + public void setMarker(java.lang.String param){ + + this.localMarker=param; + + + } + + + /** + * field for NextMarker + */ + + + protected java.lang.String localNextMarker ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localNextMarkerTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getNextMarker(){ + return localNextMarker; + } + + + + /** + * Auto generated setter method + * @param param NextMarker + */ + public void setNextMarker(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localNextMarkerTracker = true; + } else { + localNextMarkerTracker = false; + + } + + this.localNextMarker=param; + + + } + + + /** + * field for MaxKeys + */ + + + protected int localMaxKeys ; + + + /** + * Auto generated getter method + * @return int + */ + public int getMaxKeys(){ + return localMaxKeys; + } + + + + /** + * Auto generated setter method + * @param param MaxKeys + */ + public void setMaxKeys(int param){ + + this.localMaxKeys=param; + + + } + + + /** + * field for Delimiter + */ + + + protected java.lang.String localDelimiter ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localDelimiterTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDelimiter(){ + return localDelimiter; + } + + + + /** + * Auto generated setter method + * @param param Delimiter + */ + public void setDelimiter(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localDelimiterTracker = true; + } else { + localDelimiterTracker = false; + + } + + this.localDelimiter=param; + + + } + + + /** + * field for IsTruncated + */ + + + protected boolean localIsTruncated ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getIsTruncated(){ + return localIsTruncated; + } + + + + /** + * Auto generated setter method + * @param param IsTruncated + */ + public void setIsTruncated(boolean param){ + + this.localIsTruncated=param; + + + } + + + /** + * field for Contents + * This was an Array! + */ + + + protected com.amazon.s3.ListEntry[] localContents ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localContentsTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.ListEntry[] + */ + public com.amazon.s3.ListEntry[] getContents(){ + return localContents; + } + + + + + + + /** + * validate the array for Contents + */ + protected void validateContents(com.amazon.s3.ListEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param Contents + */ + public void setContents(com.amazon.s3.ListEntry[] param){ + + validateContents(param); + + + if (param != null){ + //update the setting tracker + localContentsTracker = true; + } else { + localContentsTracker = false; + + } + + this.localContents=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.ListEntry + */ + public void addContents(com.amazon.s3.ListEntry param){ + if (localContents == null){ + localContents = new com.amazon.s3.ListEntry[]{}; + } + + + //update the setting tracker + localContentsTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localContents); + list.add(param); + this.localContents = + (com.amazon.s3.ListEntry[])list.toArray( + new com.amazon.s3.ListEntry[list.size()]); + + } + + + /** + * field for CommonPrefixes + * This was an Array! + */ + + + protected com.amazon.s3.PrefixEntry[] localCommonPrefixes ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCommonPrefixesTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.PrefixEntry[] + */ + public com.amazon.s3.PrefixEntry[] getCommonPrefixes(){ + return localCommonPrefixes; + } + + + + + + + /** + * validate the array for CommonPrefixes + */ + protected void validateCommonPrefixes(com.amazon.s3.PrefixEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param CommonPrefixes + */ + public void setCommonPrefixes(com.amazon.s3.PrefixEntry[] param){ + + validateCommonPrefixes(param); + + + if (param != null){ + //update the setting tracker + localCommonPrefixesTracker = true; + } else { + localCommonPrefixesTracker = false; + + } + + this.localCommonPrefixes=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.PrefixEntry + */ + public void addCommonPrefixes(com.amazon.s3.PrefixEntry param){ + if (localCommonPrefixes == null){ + localCommonPrefixes = new com.amazon.s3.PrefixEntry[]{}; + } + + + //update the setting tracker + localCommonPrefixesTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localCommonPrefixes); + list.add(param); + this.localCommonPrefixes = + (com.amazon.s3.PrefixEntry[])list.toArray( + new com.amazon.s3.PrefixEntry[list.size()]); + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListBucketResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListBucketResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListBucketResult", + xmlWriter); + } + + + } + if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Name", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Name"); + } + + } else { + xmlWriter.writeStartElement("Name"); + } + + + if (localName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localName); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Prefix", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Prefix"); + } + + } else { + xmlWriter.writeStartElement("Prefix"); + } + + + if (localPrefix==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localPrefix); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Marker", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Marker"); + } + + } else { + xmlWriter.writeStartElement("Marker"); + } + + + if (localMarker==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localMarker); + + } + + xmlWriter.writeEndElement(); + if (localNextMarkerTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"NextMarker", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"NextMarker"); + } + + } else { + xmlWriter.writeStartElement("NextMarker"); + } + + + if (localNextMarker==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("NextMarker cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localNextMarker); + + } + + xmlWriter.writeEndElement(); + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"MaxKeys", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"MaxKeys"); + } + + } else { + xmlWriter.writeStartElement("MaxKeys"); + } + + if (localMaxKeys==java.lang.Integer.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); + } + + xmlWriter.writeEndElement(); + if (localDelimiterTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Delimiter", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Delimiter"); + } + + } else { + xmlWriter.writeStartElement("Delimiter"); + } + + + if (localDelimiter==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDelimiter); + + } + + xmlWriter.writeEndElement(); + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"IsTruncated", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IsTruncated"); + } + + } else { + xmlWriter.writeStartElement("IsTruncated"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("IsTruncated cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); + } + + xmlWriter.writeEndElement(); + if (localContentsTracker){ + if (localContents!=null){ + for (int i = 0;i < localContents.length;i++){ + if (localContents[i] != null){ + localContents[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Contents cannot be null!!"); + + } + } if (localCommonPrefixesTracker){ + if (localCommonPrefixes!=null){ + for (int i = 0;i < localCommonPrefixes.length;i++){ + if (localCommonPrefixes[i] != null){ + localCommonPrefixes[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); + + } + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Name")); + + if (localName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); + } else { + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Prefix")); + + if (localPrefix != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); + } else { + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Marker")); + + if (localMarker != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMarker)); + } else { + throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); + } + if (localNextMarkerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "NextMarker")); + + if (localNextMarker != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNextMarker)); + } else { + throw new org.apache.axis2.databinding.ADBException("NextMarker cannot be null!!"); + } + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "MaxKeys")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); + if (localDelimiterTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Delimiter")); + + if (localDelimiter != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); + } else { + throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); + } + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IsTruncated")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); + if (localContentsTracker){ + if (localContents!=null) { + for (int i = 0;i < localContents.length;i++){ + + if (localContents[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Contents")); + elementList.add(localContents[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Contents cannot be null!!"); + + } + + } if (localCommonPrefixesTracker){ + if (localCommonPrefixes!=null) { + for (int i = 0;i < localCommonPrefixes.length;i++){ + + if (localCommonPrefixes[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CommonPrefixes")); + elementList.add(localCommonPrefixes[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); + + } + + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListBucketResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListBucketResult object = + new ListBucketResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListBucketResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListBucketResult)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list1 = new java.util.ArrayList(); + + java.util.ArrayList list9 = new java.util.ArrayList(); + + java.util.ArrayList list10 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list1.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone1 = false; + while(!loopDone1){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone1 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list1.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone1 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((com.amazon.s3.MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.MetadataEntry.class, + list1)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setPrefix( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Marker").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setMarker( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","NextMarker").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setNextMarker( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MaxKeys").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setMaxKeys( + org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Delimiter").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDelimiter( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IsTruncated").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setIsTruncated( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list9.add(com.amazon.s3.ListEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone9 = false; + while(!loopDone9){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone9 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents").equals(reader.getName())){ + list9.add(com.amazon.s3.ListEntry.Factory.parse(reader)); + + }else{ + loopDone9 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setContents((com.amazon.s3.ListEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.ListEntry.class, + list9)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list10.add(com.amazon.s3.PrefixEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone10 = false; + while(!loopDone10){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone10 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ + list10.add(com.amazon.s3.PrefixEntry.Factory.parse(reader)); + + }else{ + loopDone10 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setCommonPrefixes((com.amazon.s3.PrefixEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.PrefixEntry.class, + list10)); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListEntry.java b/awsapi/src/com/amazon/s3/ListEntry.java index b071608b9db..3a7bbedd4d5 100644 --- a/awsapi/src/com/amazon/s3/ListEntry.java +++ b/awsapi/src/com/amazon/s3/ListEntry.java @@ -1,886 +1,902 @@ - -/** - * ListEntry.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListEntry bean class - */ - - public class ListEntry - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListEntry - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for LastModified - */ - - - protected java.util.Calendar localLastModified ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getLastModified(){ - return localLastModified; - } - - - - /** - * Auto generated setter method - * @param param LastModified - */ - public void setLastModified(java.util.Calendar param){ - - this.localLastModified=param; - - - } - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * field for Size - */ - - - protected long localSize ; - - - /** - * Auto generated getter method - * @return long - */ - public long getSize(){ - return localSize; - } - - - - /** - * Auto generated setter method - * @param param Size - */ - public void setSize(long param){ - - this.localSize=param; - - - } - - - /** - * field for Owner - */ - - - protected com.amazon.s3.CanonicalUser localOwner ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localOwnerTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.CanonicalUser - */ - public com.amazon.s3.CanonicalUser getOwner(){ - return localOwner; - } - - - - /** - * Auto generated setter method - * @param param Owner - */ - public void setOwner(com.amazon.s3.CanonicalUser param){ - - if (param != null){ - //update the setting tracker - localOwnerTracker = true; - } else { - localOwnerTracker = false; - - } - - this.localOwner=param; - - - } - - - /** - * field for StorageClass - */ - - - protected com.amazon.s3.StorageClass localStorageClass ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.StorageClass - */ - public com.amazon.s3.StorageClass getStorageClass(){ - return localStorageClass; - } - - - - /** - * Auto generated setter method - * @param param StorageClass - */ - public void setStorageClass(com.amazon.s3.StorageClass param){ - - this.localStorageClass=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListEntry.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListEntry", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListEntry", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"LastModified", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"LastModified"); - } - - } else { - xmlWriter.writeStartElement("LastModified"); - } - - - if (localLastModified==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Size", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Size"); - } - - } else { - xmlWriter.writeStartElement("Size"); - } - - if (localSize==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("Size cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); - } - - xmlWriter.writeEndElement(); - if (localOwnerTracker){ - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), - factory,xmlWriter); - } - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LastModified")); - - if (localLastModified != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - } else { - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Size")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); - if (localOwnerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Owner")); - - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - elementList.add(localOwner); - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass")); - - - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - elementList.add(localStorageClass); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListEntry object = - new ListEntry(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListEntry".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListEntry)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLastModified( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Size").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSize( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ - - object.setOwner(com.amazon.s3.CanonicalUser.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ - - object.setStorageClass(com.amazon.s3.StorageClass.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListEntry.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListEntry bean class + */ + + public class ListEntry + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListEntry + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for LastModified + */ + + + protected java.util.Calendar localLastModified ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getLastModified(){ + return localLastModified; + } + + + + /** + * Auto generated setter method + * @param param LastModified + */ + public void setLastModified(java.util.Calendar param){ + + this.localLastModified=param; + + + } + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * field for Size + */ + + + protected long localSize ; + + + /** + * Auto generated getter method + * @return long + */ + public long getSize(){ + return localSize; + } + + + + /** + * Auto generated setter method + * @param param Size + */ + public void setSize(long param){ + + this.localSize=param; + + + } + + + /** + * field for Owner + */ + + + protected com.amazon.s3.CanonicalUser localOwner ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localOwnerTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.CanonicalUser + */ + public com.amazon.s3.CanonicalUser getOwner(){ + return localOwner; + } + + + + /** + * Auto generated setter method + * @param param Owner + */ + public void setOwner(com.amazon.s3.CanonicalUser param){ + + if (param != null){ + //update the setting tracker + localOwnerTracker = true; + } else { + localOwnerTracker = false; + + } + + this.localOwner=param; + + + } + + + /** + * field for StorageClass + */ + + + protected com.amazon.s3.StorageClass localStorageClass ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.StorageClass + */ + public com.amazon.s3.StorageClass getStorageClass(){ + return localStorageClass; + } + + + + /** + * Auto generated setter method + * @param param StorageClass + */ + public void setStorageClass(com.amazon.s3.StorageClass param){ + + this.localStorageClass=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListEntry.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListEntry", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListEntry", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"LastModified", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"LastModified"); + } + + } else { + xmlWriter.writeStartElement("LastModified"); + } + + + if (localLastModified==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Size", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Size"); + } + + } else { + xmlWriter.writeStartElement("Size"); + } + + if (localSize==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("Size cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); + } + + xmlWriter.writeEndElement(); + if (localOwnerTracker){ + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), + factory,xmlWriter); + } + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LastModified")); + + if (localLastModified != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + } else { + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Size")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); + if (localOwnerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Owner")); + + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + elementList.add(localOwner); + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass")); + + + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + elementList.add(localStorageClass); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListEntry object = + new ListEntry(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListEntry".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListEntry)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLastModified( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Size").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSize( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ + + object.setOwner(com.amazon.s3.CanonicalUser.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ + + object.setStorageClass(com.amazon.s3.StorageClass.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListVersionsResponse.java b/awsapi/src/com/amazon/s3/ListVersionsResponse.java index b40c09ecdc8..98728043b4b 100644 --- a/awsapi/src/com/amazon/s3/ListVersionsResponse.java +++ b/awsapi/src/com/amazon/s3/ListVersionsResponse.java @@ -1,453 +1,469 @@ - -/** - * ListVersionsResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListVersionsResponse bean class - */ - - public class ListVersionsResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "ListVersionsResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for ListVersionsResponse - */ - - - protected com.amazon.s3.ListVersionsResult localListVersionsResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.ListVersionsResult - */ - public com.amazon.s3.ListVersionsResult getListVersionsResponse(){ - return localListVersionsResponse; - } - - - - /** - * Auto generated setter method - * @param param ListVersionsResponse - */ - public void setListVersionsResponse(com.amazon.s3.ListVersionsResult param){ - - this.localListVersionsResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListVersionsResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListVersionsResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListVersionsResponse", - xmlWriter); - } - - - } - - if (localListVersionsResponse==null){ - throw new org.apache.axis2.databinding.ADBException("ListVersionsResponse cannot be null!!"); - } - localListVersionsResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListVersionsResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ListVersionsResponse")); - - - if (localListVersionsResponse==null){ - throw new org.apache.axis2.databinding.ADBException("ListVersionsResponse cannot be null!!"); - } - elementList.add(localListVersionsResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListVersionsResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListVersionsResponse object = - new ListVersionsResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListVersionsResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListVersionsResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListVersionsResponse").equals(reader.getName())){ - - object.setListVersionsResponse(com.amazon.s3.ListVersionsResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListVersionsResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListVersionsResponse bean class + */ + + public class ListVersionsResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "ListVersionsResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for ListVersionsResponse + */ + + + protected com.amazon.s3.ListVersionsResult localListVersionsResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.ListVersionsResult + */ + public com.amazon.s3.ListVersionsResult getListVersionsResponse(){ + return localListVersionsResponse; + } + + + + /** + * Auto generated setter method + * @param param ListVersionsResponse + */ + public void setListVersionsResponse(com.amazon.s3.ListVersionsResult param){ + + this.localListVersionsResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListVersionsResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListVersionsResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListVersionsResponse", + xmlWriter); + } + + + } + + if (localListVersionsResponse==null){ + throw new org.apache.axis2.databinding.ADBException("ListVersionsResponse cannot be null!!"); + } + localListVersionsResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListVersionsResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ListVersionsResponse")); + + + if (localListVersionsResponse==null){ + throw new org.apache.axis2.databinding.ADBException("ListVersionsResponse cannot be null!!"); + } + elementList.add(localListVersionsResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListVersionsResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListVersionsResponse object = + new ListVersionsResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListVersionsResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListVersionsResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListVersionsResponse").equals(reader.getName())){ + + object.setListVersionsResponse(com.amazon.s3.ListVersionsResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListVersionsResult.java b/awsapi/src/com/amazon/s3/ListVersionsResult.java index c4b9d61ef64..70867ae38cb 100644 --- a/awsapi/src/com/amazon/s3/ListVersionsResult.java +++ b/awsapi/src/com/amazon/s3/ListVersionsResult.java @@ -1,1743 +1,1759 @@ - -/** - * ListVersionsResult.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListVersionsResult bean class - */ - - public class ListVersionsResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListVersionsResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Metadata - * This was an Array! - */ - - - protected com.amazon.s3.MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.MetadataEntry[] - */ - public com.amazon.s3.MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(com.amazon.s3.MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.MetadataEntry - */ - public void addMetadata(com.amazon.s3.MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new com.amazon.s3.MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (com.amazon.s3.MetadataEntry[])list.toArray( - new com.amazon.s3.MetadataEntry[list.size()]); - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getName(){ - return localName; - } - - - - /** - * Auto generated setter method - * @param param Name - */ - public void setName(java.lang.String param){ - - this.localName=param; - - - } - - - /** - * field for Prefix - */ - - - protected java.lang.String localPrefix ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getPrefix(){ - return localPrefix; - } - - - - /** - * Auto generated setter method - * @param param Prefix - */ - public void setPrefix(java.lang.String param){ - - this.localPrefix=param; - - - } - - - /** - * field for KeyMarker - */ - - - protected java.lang.String localKeyMarker ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKeyMarker(){ - return localKeyMarker; - } - - - - /** - * Auto generated setter method - * @param param KeyMarker - */ - public void setKeyMarker(java.lang.String param){ - - this.localKeyMarker=param; - - - } - - - /** - * field for VersionIdMarker - */ - - - protected java.lang.String localVersionIdMarker ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getVersionIdMarker(){ - return localVersionIdMarker; - } - - - - /** - * Auto generated setter method - * @param param VersionIdMarker - */ - public void setVersionIdMarker(java.lang.String param){ - - this.localVersionIdMarker=param; - - - } - - - /** - * field for NextKeyMarker - */ - - - protected java.lang.String localNextKeyMarker ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localNextKeyMarkerTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getNextKeyMarker(){ - return localNextKeyMarker; - } - - - - /** - * Auto generated setter method - * @param param NextKeyMarker - */ - public void setNextKeyMarker(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localNextKeyMarkerTracker = true; - } else { - localNextKeyMarkerTracker = false; - - } - - this.localNextKeyMarker=param; - - - } - - - /** - * field for NextVersionIdMarker - */ - - - protected java.lang.String localNextVersionIdMarker ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localNextVersionIdMarkerTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getNextVersionIdMarker(){ - return localNextVersionIdMarker; - } - - - - /** - * Auto generated setter method - * @param param NextVersionIdMarker - */ - public void setNextVersionIdMarker(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localNextVersionIdMarkerTracker = true; - } else { - localNextVersionIdMarkerTracker = false; - - } - - this.localNextVersionIdMarker=param; - - - } - - - /** - * field for MaxKeys - */ - - - protected int localMaxKeys ; - - - /** - * Auto generated getter method - * @return int - */ - public int getMaxKeys(){ - return localMaxKeys; - } - - - - /** - * Auto generated setter method - * @param param MaxKeys - */ - public void setMaxKeys(int param){ - - this.localMaxKeys=param; - - - } - - - /** - * field for Delimiter - */ - - - protected java.lang.String localDelimiter ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localDelimiterTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDelimiter(){ - return localDelimiter; - } - - - - /** - * Auto generated setter method - * @param param Delimiter - */ - public void setDelimiter(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localDelimiterTracker = true; - } else { - localDelimiterTracker = false; - - } - - this.localDelimiter=param; - - - } - - - /** - * field for IsTruncated - */ - - - protected boolean localIsTruncated ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getIsTruncated(){ - return localIsTruncated; - } - - - - /** - * Auto generated setter method - * @param param IsTruncated - */ - public void setIsTruncated(boolean param){ - - this.localIsTruncated=param; - - - } - - - /** - * field for ListVersionsResultChoice_type0 - * This was an Array! - */ - - - protected com.amazon.s3.ListVersionsResultChoice_type0[] localListVersionsResultChoice_type0 ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localListVersionsResultChoice_type0Tracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.ListVersionsResultChoice_type0[] - */ - public com.amazon.s3.ListVersionsResultChoice_type0[] getListVersionsResultChoice_type0(){ - return localListVersionsResultChoice_type0; - } - - - - - - - /** - * validate the array for ListVersionsResultChoice_type0 - */ - protected void validateListVersionsResultChoice_type0(com.amazon.s3.ListVersionsResultChoice_type0[] param){ - - } - - - /** - * Auto generated setter method - * @param param ListVersionsResultChoice_type0 - */ - public void setListVersionsResultChoice_type0(com.amazon.s3.ListVersionsResultChoice_type0[] param){ - - validateListVersionsResultChoice_type0(param); - - - if (param != null){ - //update the setting tracker - localListVersionsResultChoice_type0Tracker = true; - } else { - localListVersionsResultChoice_type0Tracker = false; - - } - - this.localListVersionsResultChoice_type0=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.ListVersionsResultChoice_type0 - */ - public void addListVersionsResultChoice_type0(com.amazon.s3.ListVersionsResultChoice_type0 param){ - if (localListVersionsResultChoice_type0 == null){ - localListVersionsResultChoice_type0 = new com.amazon.s3.ListVersionsResultChoice_type0[]{}; - } - - - //update the setting tracker - localListVersionsResultChoice_type0Tracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localListVersionsResultChoice_type0); - list.add(param); - this.localListVersionsResultChoice_type0 = - (com.amazon.s3.ListVersionsResultChoice_type0[])list.toArray( - new com.amazon.s3.ListVersionsResultChoice_type0[list.size()]); - - } - - - /** - * field for CommonPrefixes - * This was an Array! - */ - - - protected com.amazon.s3.PrefixEntry[] localCommonPrefixes ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCommonPrefixesTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.PrefixEntry[] - */ - public com.amazon.s3.PrefixEntry[] getCommonPrefixes(){ - return localCommonPrefixes; - } - - - - - - - /** - * validate the array for CommonPrefixes - */ - protected void validateCommonPrefixes(com.amazon.s3.PrefixEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param CommonPrefixes - */ - public void setCommonPrefixes(com.amazon.s3.PrefixEntry[] param){ - - validateCommonPrefixes(param); - - - if (param != null){ - //update the setting tracker - localCommonPrefixesTracker = true; - } else { - localCommonPrefixesTracker = false; - - } - - this.localCommonPrefixes=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.PrefixEntry - */ - public void addCommonPrefixes(com.amazon.s3.PrefixEntry param){ - if (localCommonPrefixes == null){ - localCommonPrefixes = new com.amazon.s3.PrefixEntry[]{}; - } - - - //update the setting tracker - localCommonPrefixesTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localCommonPrefixes); - list.add(param); - this.localCommonPrefixes = - (com.amazon.s3.PrefixEntry[])list.toArray( - new com.amazon.s3.PrefixEntry[list.size()]); - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListVersionsResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListVersionsResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListVersionsResult", - xmlWriter); - } - - - } - if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Name", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Name"); - } - - } else { - xmlWriter.writeStartElement("Name"); - } - - - if (localName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localName); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Prefix", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Prefix"); - } - - } else { - xmlWriter.writeStartElement("Prefix"); - } - - - if (localPrefix==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localPrefix); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"KeyMarker", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"KeyMarker"); - } - - } else { - xmlWriter.writeStartElement("KeyMarker"); - } - - - if (localKeyMarker==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("KeyMarker cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKeyMarker); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"VersionIdMarker", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"VersionIdMarker"); - } - - } else { - xmlWriter.writeStartElement("VersionIdMarker"); - } - - - if (localVersionIdMarker==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("VersionIdMarker cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localVersionIdMarker); - - } - - xmlWriter.writeEndElement(); - if (localNextKeyMarkerTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"NextKeyMarker", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"NextKeyMarker"); - } - - } else { - xmlWriter.writeStartElement("NextKeyMarker"); - } - - - if (localNextKeyMarker==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("NextKeyMarker cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localNextKeyMarker); - - } - - xmlWriter.writeEndElement(); - } if (localNextVersionIdMarkerTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"NextVersionIdMarker", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"NextVersionIdMarker"); - } - - } else { - xmlWriter.writeStartElement("NextVersionIdMarker"); - } - - - if (localNextVersionIdMarker==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("NextVersionIdMarker cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localNextVersionIdMarker); - - } - - xmlWriter.writeEndElement(); - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"MaxKeys", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"MaxKeys"); - } - - } else { - xmlWriter.writeStartElement("MaxKeys"); - } - - if (localMaxKeys==java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); - } - - xmlWriter.writeEndElement(); - if (localDelimiterTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Delimiter", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Delimiter"); - } - - } else { - xmlWriter.writeStartElement("Delimiter"); - } - - - if (localDelimiter==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDelimiter); - - } - - xmlWriter.writeEndElement(); - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"IsTruncated", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IsTruncated"); - } - - } else { - xmlWriter.writeStartElement("IsTruncated"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("IsTruncated cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); - } - - xmlWriter.writeEndElement(); - if (localListVersionsResultChoice_type0Tracker){ - - if (localListVersionsResultChoice_type0!=null){ - for (int i = 0;i < localListVersionsResultChoice_type0.length;i++){ - if (localListVersionsResultChoice_type0[i] != null){ - localListVersionsResultChoice_type0[i].serialize(null,factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - throw new org.apache.axis2.databinding.ADBException("ListVersionsResultChoice_type0 cannot be null!!"); - } - } if (localCommonPrefixesTracker){ - if (localCommonPrefixes!=null){ - for (int i = 0;i < localCommonPrefixes.length;i++){ - if (localCommonPrefixes[i] != null){ - localCommonPrefixes[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Name")); - - if (localName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Prefix")); - - if (localPrefix != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); - } else { - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "KeyMarker")); - - if (localKeyMarker != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKeyMarker)); - } else { - throw new org.apache.axis2.databinding.ADBException("KeyMarker cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "VersionIdMarker")); - - if (localVersionIdMarker != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localVersionIdMarker)); - } else { - throw new org.apache.axis2.databinding.ADBException("VersionIdMarker cannot be null!!"); - } - if (localNextKeyMarkerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "NextKeyMarker")); - - if (localNextKeyMarker != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNextKeyMarker)); - } else { - throw new org.apache.axis2.databinding.ADBException("NextKeyMarker cannot be null!!"); - } - } if (localNextVersionIdMarkerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "NextVersionIdMarker")); - - if (localNextVersionIdMarker != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNextVersionIdMarker)); - } else { - throw new org.apache.axis2.databinding.ADBException("NextVersionIdMarker cannot be null!!"); - } - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "MaxKeys")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); - if (localDelimiterTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Delimiter")); - - if (localDelimiter != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); - } else { - throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); - } - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IsTruncated")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); - if (localListVersionsResultChoice_type0Tracker){ - if (localListVersionsResultChoice_type0!=null) { - for (int i = 0;i < localListVersionsResultChoice_type0.length;i++){ - - if (localListVersionsResultChoice_type0[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ListVersionsResultChoice_type0")); - elementList.add(localListVersionsResultChoice_type0[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("ListVersionsResultChoice_type0 cannot be null!!"); - - } - - } if (localCommonPrefixesTracker){ - if (localCommonPrefixes!=null) { - for (int i = 0;i < localCommonPrefixes.length;i++){ - - if (localCommonPrefixes[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CommonPrefixes")); - elementList.add(localCommonPrefixes[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListVersionsResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListVersionsResult object = - new ListVersionsResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListVersionsResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListVersionsResult)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list1 = new java.util.ArrayList(); - - java.util.ArrayList list11 = new java.util.ArrayList(); - - java.util.ArrayList list12 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list1.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while(!loopDone1){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list1.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((com.amazon.s3.MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.MetadataEntry.class, - list1)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setPrefix( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","KeyMarker").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKeyMarker( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","VersionIdMarker").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setVersionIdMarker( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","NextKeyMarker").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setNextKeyMarker( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","NextVersionIdMarker").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setNextVersionIdMarker( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MaxKeys").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setMaxKeys( - org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Delimiter").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDelimiter( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IsTruncated").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setIsTruncated( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - - try{ - - if (reader.isStartElement() ){ - - - - // Process the array and step past its final element's end. - list11.add(com.amazon.s3.ListVersionsResultChoice_type0.Factory.parse(reader)); - //loop until we find a start element that is not part of this array - boolean loopDone11 = false; - while(!loopDone11){ - - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone11 = true; - } else { - list11.add(com.amazon.s3.ListVersionsResultChoice_type0.Factory.parse(reader)); - } - } - // call the converter utility to convert and set the array - object.setListVersionsResultChoice_type0((com.amazon.s3.ListVersionsResultChoice_type0[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.ListVersionsResultChoice_type0.class, - list11)); - - - } // End of if for expected property start element - - else { - - } - - - } catch (java.lang.Exception e) {} - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list12.add(com.amazon.s3.PrefixEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone12 = false; - while(!loopDone12){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone12 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ - list12.add(com.amazon.s3.PrefixEntry.Factory.parse(reader)); - - }else{ - loopDone12 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCommonPrefixes((com.amazon.s3.PrefixEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.PrefixEntry.class, - list12)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListVersionsResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListVersionsResult bean class + */ + + public class ListVersionsResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListVersionsResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Metadata + * This was an Array! + */ + + + protected com.amazon.s3.MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.MetadataEntry[] + */ + public com.amazon.s3.MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(com.amazon.s3.MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.MetadataEntry + */ + public void addMetadata(com.amazon.s3.MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new com.amazon.s3.MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (com.amazon.s3.MetadataEntry[])list.toArray( + new com.amazon.s3.MetadataEntry[list.size()]); + + } + + + /** + * field for Name + */ + + + protected java.lang.String localName ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getName(){ + return localName; + } + + + + /** + * Auto generated setter method + * @param param Name + */ + public void setName(java.lang.String param){ + + this.localName=param; + + + } + + + /** + * field for Prefix + */ + + + protected java.lang.String localPrefix ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getPrefix(){ + return localPrefix; + } + + + + /** + * Auto generated setter method + * @param param Prefix + */ + public void setPrefix(java.lang.String param){ + + this.localPrefix=param; + + + } + + + /** + * field for KeyMarker + */ + + + protected java.lang.String localKeyMarker ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKeyMarker(){ + return localKeyMarker; + } + + + + /** + * Auto generated setter method + * @param param KeyMarker + */ + public void setKeyMarker(java.lang.String param){ + + this.localKeyMarker=param; + + + } + + + /** + * field for VersionIdMarker + */ + + + protected java.lang.String localVersionIdMarker ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getVersionIdMarker(){ + return localVersionIdMarker; + } + + + + /** + * Auto generated setter method + * @param param VersionIdMarker + */ + public void setVersionIdMarker(java.lang.String param){ + + this.localVersionIdMarker=param; + + + } + + + /** + * field for NextKeyMarker + */ + + + protected java.lang.String localNextKeyMarker ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localNextKeyMarkerTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getNextKeyMarker(){ + return localNextKeyMarker; + } + + + + /** + * Auto generated setter method + * @param param NextKeyMarker + */ + public void setNextKeyMarker(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localNextKeyMarkerTracker = true; + } else { + localNextKeyMarkerTracker = false; + + } + + this.localNextKeyMarker=param; + + + } + + + /** + * field for NextVersionIdMarker + */ + + + protected java.lang.String localNextVersionIdMarker ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localNextVersionIdMarkerTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getNextVersionIdMarker(){ + return localNextVersionIdMarker; + } + + + + /** + * Auto generated setter method + * @param param NextVersionIdMarker + */ + public void setNextVersionIdMarker(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localNextVersionIdMarkerTracker = true; + } else { + localNextVersionIdMarkerTracker = false; + + } + + this.localNextVersionIdMarker=param; + + + } + + + /** + * field for MaxKeys + */ + + + protected int localMaxKeys ; + + + /** + * Auto generated getter method + * @return int + */ + public int getMaxKeys(){ + return localMaxKeys; + } + + + + /** + * Auto generated setter method + * @param param MaxKeys + */ + public void setMaxKeys(int param){ + + this.localMaxKeys=param; + + + } + + + /** + * field for Delimiter + */ + + + protected java.lang.String localDelimiter ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localDelimiterTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDelimiter(){ + return localDelimiter; + } + + + + /** + * Auto generated setter method + * @param param Delimiter + */ + public void setDelimiter(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localDelimiterTracker = true; + } else { + localDelimiterTracker = false; + + } + + this.localDelimiter=param; + + + } + + + /** + * field for IsTruncated + */ + + + protected boolean localIsTruncated ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getIsTruncated(){ + return localIsTruncated; + } + + + + /** + * Auto generated setter method + * @param param IsTruncated + */ + public void setIsTruncated(boolean param){ + + this.localIsTruncated=param; + + + } + + + /** + * field for ListVersionsResultChoice_type0 + * This was an Array! + */ + + + protected com.amazon.s3.ListVersionsResultChoice_type0[] localListVersionsResultChoice_type0 ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localListVersionsResultChoice_type0Tracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.ListVersionsResultChoice_type0[] + */ + public com.amazon.s3.ListVersionsResultChoice_type0[] getListVersionsResultChoice_type0(){ + return localListVersionsResultChoice_type0; + } + + + + + + + /** + * validate the array for ListVersionsResultChoice_type0 + */ + protected void validateListVersionsResultChoice_type0(com.amazon.s3.ListVersionsResultChoice_type0[] param){ + + } + + + /** + * Auto generated setter method + * @param param ListVersionsResultChoice_type0 + */ + public void setListVersionsResultChoice_type0(com.amazon.s3.ListVersionsResultChoice_type0[] param){ + + validateListVersionsResultChoice_type0(param); + + + if (param != null){ + //update the setting tracker + localListVersionsResultChoice_type0Tracker = true; + } else { + localListVersionsResultChoice_type0Tracker = false; + + } + + this.localListVersionsResultChoice_type0=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.ListVersionsResultChoice_type0 + */ + public void addListVersionsResultChoice_type0(com.amazon.s3.ListVersionsResultChoice_type0 param){ + if (localListVersionsResultChoice_type0 == null){ + localListVersionsResultChoice_type0 = new com.amazon.s3.ListVersionsResultChoice_type0[]{}; + } + + + //update the setting tracker + localListVersionsResultChoice_type0Tracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localListVersionsResultChoice_type0); + list.add(param); + this.localListVersionsResultChoice_type0 = + (com.amazon.s3.ListVersionsResultChoice_type0[])list.toArray( + new com.amazon.s3.ListVersionsResultChoice_type0[list.size()]); + + } + + + /** + * field for CommonPrefixes + * This was an Array! + */ + + + protected com.amazon.s3.PrefixEntry[] localCommonPrefixes ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCommonPrefixesTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.PrefixEntry[] + */ + public com.amazon.s3.PrefixEntry[] getCommonPrefixes(){ + return localCommonPrefixes; + } + + + + + + + /** + * validate the array for CommonPrefixes + */ + protected void validateCommonPrefixes(com.amazon.s3.PrefixEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param CommonPrefixes + */ + public void setCommonPrefixes(com.amazon.s3.PrefixEntry[] param){ + + validateCommonPrefixes(param); + + + if (param != null){ + //update the setting tracker + localCommonPrefixesTracker = true; + } else { + localCommonPrefixesTracker = false; + + } + + this.localCommonPrefixes=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.PrefixEntry + */ + public void addCommonPrefixes(com.amazon.s3.PrefixEntry param){ + if (localCommonPrefixes == null){ + localCommonPrefixes = new com.amazon.s3.PrefixEntry[]{}; + } + + + //update the setting tracker + localCommonPrefixesTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localCommonPrefixes); + list.add(param); + this.localCommonPrefixes = + (com.amazon.s3.PrefixEntry[])list.toArray( + new com.amazon.s3.PrefixEntry[list.size()]); + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListVersionsResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListVersionsResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListVersionsResult", + xmlWriter); + } + + + } + if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Name", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Name"); + } + + } else { + xmlWriter.writeStartElement("Name"); + } + + + if (localName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localName); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Prefix", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Prefix"); + } + + } else { + xmlWriter.writeStartElement("Prefix"); + } + + + if (localPrefix==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localPrefix); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"KeyMarker", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"KeyMarker"); + } + + } else { + xmlWriter.writeStartElement("KeyMarker"); + } + + + if (localKeyMarker==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("KeyMarker cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKeyMarker); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"VersionIdMarker", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"VersionIdMarker"); + } + + } else { + xmlWriter.writeStartElement("VersionIdMarker"); + } + + + if (localVersionIdMarker==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("VersionIdMarker cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localVersionIdMarker); + + } + + xmlWriter.writeEndElement(); + if (localNextKeyMarkerTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"NextKeyMarker", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"NextKeyMarker"); + } + + } else { + xmlWriter.writeStartElement("NextKeyMarker"); + } + + + if (localNextKeyMarker==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("NextKeyMarker cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localNextKeyMarker); + + } + + xmlWriter.writeEndElement(); + } if (localNextVersionIdMarkerTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"NextVersionIdMarker", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"NextVersionIdMarker"); + } + + } else { + xmlWriter.writeStartElement("NextVersionIdMarker"); + } + + + if (localNextVersionIdMarker==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("NextVersionIdMarker cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localNextVersionIdMarker); + + } + + xmlWriter.writeEndElement(); + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"MaxKeys", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"MaxKeys"); + } + + } else { + xmlWriter.writeStartElement("MaxKeys"); + } + + if (localMaxKeys==java.lang.Integer.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); + } + + xmlWriter.writeEndElement(); + if (localDelimiterTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Delimiter", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Delimiter"); + } + + } else { + xmlWriter.writeStartElement("Delimiter"); + } + + + if (localDelimiter==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDelimiter); + + } + + xmlWriter.writeEndElement(); + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"IsTruncated", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IsTruncated"); + } + + } else { + xmlWriter.writeStartElement("IsTruncated"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("IsTruncated cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); + } + + xmlWriter.writeEndElement(); + if (localListVersionsResultChoice_type0Tracker){ + + if (localListVersionsResultChoice_type0!=null){ + for (int i = 0;i < localListVersionsResultChoice_type0.length;i++){ + if (localListVersionsResultChoice_type0[i] != null){ + localListVersionsResultChoice_type0[i].serialize(null,factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + throw new org.apache.axis2.databinding.ADBException("ListVersionsResultChoice_type0 cannot be null!!"); + } + } if (localCommonPrefixesTracker){ + if (localCommonPrefixes!=null){ + for (int i = 0;i < localCommonPrefixes.length;i++){ + if (localCommonPrefixes[i] != null){ + localCommonPrefixes[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); + + } + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Name")); + + if (localName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); + } else { + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Prefix")); + + if (localPrefix != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); + } else { + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "KeyMarker")); + + if (localKeyMarker != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKeyMarker)); + } else { + throw new org.apache.axis2.databinding.ADBException("KeyMarker cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "VersionIdMarker")); + + if (localVersionIdMarker != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localVersionIdMarker)); + } else { + throw new org.apache.axis2.databinding.ADBException("VersionIdMarker cannot be null!!"); + } + if (localNextKeyMarkerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "NextKeyMarker")); + + if (localNextKeyMarker != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNextKeyMarker)); + } else { + throw new org.apache.axis2.databinding.ADBException("NextKeyMarker cannot be null!!"); + } + } if (localNextVersionIdMarkerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "NextVersionIdMarker")); + + if (localNextVersionIdMarker != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNextVersionIdMarker)); + } else { + throw new org.apache.axis2.databinding.ADBException("NextVersionIdMarker cannot be null!!"); + } + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "MaxKeys")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); + if (localDelimiterTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Delimiter")); + + if (localDelimiter != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); + } else { + throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); + } + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IsTruncated")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); + if (localListVersionsResultChoice_type0Tracker){ + if (localListVersionsResultChoice_type0!=null) { + for (int i = 0;i < localListVersionsResultChoice_type0.length;i++){ + + if (localListVersionsResultChoice_type0[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ListVersionsResultChoice_type0")); + elementList.add(localListVersionsResultChoice_type0[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("ListVersionsResultChoice_type0 cannot be null!!"); + + } + + } if (localCommonPrefixesTracker){ + if (localCommonPrefixes!=null) { + for (int i = 0;i < localCommonPrefixes.length;i++){ + + if (localCommonPrefixes[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CommonPrefixes")); + elementList.add(localCommonPrefixes[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); + + } + + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListVersionsResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListVersionsResult object = + new ListVersionsResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListVersionsResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListVersionsResult)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list1 = new java.util.ArrayList(); + + java.util.ArrayList list11 = new java.util.ArrayList(); + + java.util.ArrayList list12 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list1.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone1 = false; + while(!loopDone1){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone1 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list1.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone1 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((com.amazon.s3.MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.MetadataEntry.class, + list1)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setPrefix( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","KeyMarker").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKeyMarker( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","VersionIdMarker").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setVersionIdMarker( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","NextKeyMarker").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setNextKeyMarker( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","NextVersionIdMarker").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setNextVersionIdMarker( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MaxKeys").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setMaxKeys( + org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Delimiter").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDelimiter( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IsTruncated").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setIsTruncated( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + + try{ + + if (reader.isStartElement() ){ + + + + // Process the array and step past its final element's end. + list11.add(com.amazon.s3.ListVersionsResultChoice_type0.Factory.parse(reader)); + //loop until we find a start element that is not part of this array + boolean loopDone11 = false; + while(!loopDone11){ + + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone11 = true; + } else { + list11.add(com.amazon.s3.ListVersionsResultChoice_type0.Factory.parse(reader)); + } + } + // call the converter utility to convert and set the array + object.setListVersionsResultChoice_type0((com.amazon.s3.ListVersionsResultChoice_type0[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.ListVersionsResultChoice_type0.class, + list11)); + + + } // End of if for expected property start element + + else { + + } + + + } catch (java.lang.Exception e) {} + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list12.add(com.amazon.s3.PrefixEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone12 = false; + while(!loopDone12){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone12 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ + list12.add(com.amazon.s3.PrefixEntry.Factory.parse(reader)); + + }else{ + loopDone12 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setCommonPrefixes((com.amazon.s3.PrefixEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.PrefixEntry.class, + list12)); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/ListVersionsResultChoice_type0.java b/awsapi/src/com/amazon/s3/ListVersionsResultChoice_type0.java index 7ea93525b4c..bbe39cd83f9 100644 --- a/awsapi/src/com/amazon/s3/ListVersionsResultChoice_type0.java +++ b/awsapi/src/com/amazon/s3/ListVersionsResultChoice_type0.java @@ -1,483 +1,499 @@ - -/** - * ListVersionsResultChoice_type0.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * ListVersionsResultChoice_type0 bean class - */ - - public class ListVersionsResultChoice_type0 - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListVersionsResultChoice_type0 - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - /** Whenever a new property is set ensure all others are unset - * There can be only one choice and the last one wins - */ - private void clearAllSettingTrackers() { - - localVersionTracker = false; - - localDeleteMarkerTracker = false; - - } - - - /** - * field for Version - */ - - - protected com.amazon.s3.VersionEntry localVersion ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localVersionTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.VersionEntry - */ - public com.amazon.s3.VersionEntry getVersion(){ - return localVersion; - } - - - - /** - * Auto generated setter method - * @param param Version - */ - public void setVersion(com.amazon.s3.VersionEntry param){ - - clearAllSettingTrackers(); - - if (param != null){ - //update the setting tracker - localVersionTracker = true; - } else { - localVersionTracker = false; - - } - - this.localVersion=param; - - - } - - - /** - * field for DeleteMarker - */ - - - protected com.amazon.s3.DeleteMarkerEntry localDeleteMarker ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localDeleteMarkerTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.DeleteMarkerEntry - */ - public com.amazon.s3.DeleteMarkerEntry getDeleteMarker(){ - return localDeleteMarker; - } - - - - /** - * Auto generated setter method - * @param param DeleteMarker - */ - public void setDeleteMarker(com.amazon.s3.DeleteMarkerEntry param){ - - clearAllSettingTrackers(); - - if (param != null){ - //update the setting tracker - localDeleteMarkerTracker = true; - } else { - localDeleteMarkerTracker = false; - - } - - this.localDeleteMarker=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListVersionsResultChoice_type0.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListVersionsResultChoice_type0", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListVersionsResultChoice_type0", - xmlWriter); - } - - - } - if (localVersionTracker){ - if (localVersion==null){ - throw new org.apache.axis2.databinding.ADBException("Version cannot be null!!"); - } - localVersion.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Version"), - factory,xmlWriter); - } if (localDeleteMarkerTracker){ - if (localDeleteMarker==null){ - throw new org.apache.axis2.databinding.ADBException("DeleteMarker cannot be null!!"); - } - localDeleteMarker.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteMarker"), - factory,xmlWriter); - } - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localVersionTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Version")); - - - if (localVersion==null){ - throw new org.apache.axis2.databinding.ADBException("Version cannot be null!!"); - } - elementList.add(localVersion); - } if (localDeleteMarkerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteMarker")); - - - if (localDeleteMarker==null){ - throw new org.apache.axis2.databinding.ADBException("DeleteMarker cannot be null!!"); - } - elementList.add(localDeleteMarker); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListVersionsResultChoice_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListVersionsResultChoice_type0 object = - new ListVersionsResultChoice_type0(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Version").equals(reader.getName())){ - - object.setVersion(com.amazon.s3.VersionEntry.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteMarker").equals(reader.getName())){ - - object.setDeleteMarker(com.amazon.s3.DeleteMarkerEntry.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * ListVersionsResultChoice_type0.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * ListVersionsResultChoice_type0 bean class + */ + + public class ListVersionsResultChoice_type0 + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListVersionsResultChoice_type0 + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + /** Whenever a new property is set ensure all others are unset + * There can be only one choice and the last one wins + */ + private void clearAllSettingTrackers() { + + localVersionTracker = false; + + localDeleteMarkerTracker = false; + + } + + + /** + * field for Version + */ + + + protected com.amazon.s3.VersionEntry localVersion ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localVersionTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.VersionEntry + */ + public com.amazon.s3.VersionEntry getVersion(){ + return localVersion; + } + + + + /** + * Auto generated setter method + * @param param Version + */ + public void setVersion(com.amazon.s3.VersionEntry param){ + + clearAllSettingTrackers(); + + if (param != null){ + //update the setting tracker + localVersionTracker = true; + } else { + localVersionTracker = false; + + } + + this.localVersion=param; + + + } + + + /** + * field for DeleteMarker + */ + + + protected com.amazon.s3.DeleteMarkerEntry localDeleteMarker ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localDeleteMarkerTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.DeleteMarkerEntry + */ + public com.amazon.s3.DeleteMarkerEntry getDeleteMarker(){ + return localDeleteMarker; + } + + + + /** + * Auto generated setter method + * @param param DeleteMarker + */ + public void setDeleteMarker(com.amazon.s3.DeleteMarkerEntry param){ + + clearAllSettingTrackers(); + + if (param != null){ + //update the setting tracker + localDeleteMarkerTracker = true; + } else { + localDeleteMarkerTracker = false; + + } + + this.localDeleteMarker=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListVersionsResultChoice_type0.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListVersionsResultChoice_type0", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListVersionsResultChoice_type0", + xmlWriter); + } + + + } + if (localVersionTracker){ + if (localVersion==null){ + throw new org.apache.axis2.databinding.ADBException("Version cannot be null!!"); + } + localVersion.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Version"), + factory,xmlWriter); + } if (localDeleteMarkerTracker){ + if (localDeleteMarker==null){ + throw new org.apache.axis2.databinding.ADBException("DeleteMarker cannot be null!!"); + } + localDeleteMarker.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteMarker"), + factory,xmlWriter); + } + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localVersionTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Version")); + + + if (localVersion==null){ + throw new org.apache.axis2.databinding.ADBException("Version cannot be null!!"); + } + elementList.add(localVersion); + } if (localDeleteMarkerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteMarker")); + + + if (localDeleteMarker==null){ + throw new org.apache.axis2.databinding.ADBException("DeleteMarker cannot be null!!"); + } + elementList.add(localDeleteMarker); + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListVersionsResultChoice_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListVersionsResultChoice_type0 object = + new ListVersionsResultChoice_type0(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Version").equals(reader.getName())){ + + object.setVersion(com.amazon.s3.VersionEntry.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteMarker").equals(reader.getName())){ + + object.setDeleteMarker(com.amazon.s3.DeleteMarkerEntry.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/LocationConstraint.java b/awsapi/src/com/amazon/s3/LocationConstraint.java index 38367c14e43..7dbdd90f382 100644 --- a/awsapi/src/com/amazon/s3/LocationConstraint.java +++ b/awsapi/src/com/amazon/s3/LocationConstraint.java @@ -1,485 +1,501 @@ - -/** - * LocationConstraint.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * LocationConstraint bean class - */ - - public class LocationConstraint - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = LocationConstraint - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for String - */ - - - protected java.lang.String localString ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getString(){ - return localString; - } - - - - /** - * Auto generated setter method - * @param param String - */ - public void setString(java.lang.String param){ - - this.localString=param; - - - } - - - public java.lang.String toString(){ - - return localString.toString(); - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - LocationConstraint.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":LocationConstraint", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "LocationConstraint", - xmlWriter); - } - - - } - - - if (localString==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("string cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localString); - - } - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - - elementList.add(org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT); - - if (localString != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localString)); - } else { - throw new org.apache.axis2.databinding.ADBException("string cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - public static LocationConstraint fromString(java.lang.String value, - java.lang.String namespaceURI){ - LocationConstraint returnValue = new LocationConstraint(); - - returnValue.setString( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - return returnValue; - } - - public static LocationConstraint fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, - java.lang.String content) { - if (content.indexOf(":") > -1){ - java.lang.String prefix = content.substring(0,content.indexOf(":")); - java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return LocationConstraint.Factory.fromString(content,namespaceUri); - } else { - return LocationConstraint.Factory.fromString(content,""); - } - } - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static LocationConstraint parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - LocationConstraint object = - new LocationConstraint(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"LocationConstraint".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LocationConstraint)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - while(!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()){ - - if (reader.isStartElement() || reader.hasText()){ - - java.lang.String content = reader.getElementText(); - - object.setString( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - } else { - reader.next(); - } - } // end of while loop - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * LocationConstraint.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * LocationConstraint bean class + */ + + public class LocationConstraint + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = LocationConstraint + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for String + */ + + + protected java.lang.String localString ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getString(){ + return localString; + } + + + + /** + * Auto generated setter method + * @param param String + */ + public void setString(java.lang.String param){ + + this.localString=param; + + + } + + + public java.lang.String toString(){ + + return localString.toString(); + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + LocationConstraint.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":LocationConstraint", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "LocationConstraint", + xmlWriter); + } + + + } + + + if (localString==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("string cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localString); + + } + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + + elementList.add(org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT); + + if (localString != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localString)); + } else { + throw new org.apache.axis2.databinding.ADBException("string cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + public static LocationConstraint fromString(java.lang.String value, + java.lang.String namespaceURI){ + LocationConstraint returnValue = new LocationConstraint(); + + returnValue.setString( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); + + + return returnValue; + } + + public static LocationConstraint fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, + java.lang.String content) { + if (content.indexOf(":") > -1){ + java.lang.String prefix = content.substring(0,content.indexOf(":")); + java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); + return LocationConstraint.Factory.fromString(content,namespaceUri); + } else { + return LocationConstraint.Factory.fromString(content,""); + } + } + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static LocationConstraint parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + LocationConstraint object = + new LocationConstraint(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"LocationConstraint".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (LocationConstraint)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + while(!reader.isEndElement()) { + if (reader.isStartElement() || reader.hasText()){ + + if (reader.isStartElement() || reader.hasText()){ + + java.lang.String content = reader.getElementText(); + + object.setString( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + } else { + reader.next(); + } + } // end of while loop + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/LoggingSettings.java b/awsapi/src/com/amazon/s3/LoggingSettings.java index 62a9c9916cd..eaded7e709b 100644 --- a/awsapi/src/com/amazon/s3/LoggingSettings.java +++ b/awsapi/src/com/amazon/s3/LoggingSettings.java @@ -1,649 +1,665 @@ - -/** - * LoggingSettings.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * LoggingSettings bean class - */ - - public class LoggingSettings - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = LoggingSettings - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for TargetBucket - */ - - - protected java.lang.String localTargetBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getTargetBucket(){ - return localTargetBucket; - } - - - - /** - * Auto generated setter method - * @param param TargetBucket - */ - public void setTargetBucket(java.lang.String param){ - - this.localTargetBucket=param; - - - } - - - /** - * field for TargetPrefix - */ - - - protected java.lang.String localTargetPrefix ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getTargetPrefix(){ - return localTargetPrefix; - } - - - - /** - * Auto generated setter method - * @param param TargetPrefix - */ - public void setTargetPrefix(java.lang.String param){ - - this.localTargetPrefix=param; - - - } - - - /** - * field for TargetGrants - */ - - - protected com.amazon.s3.AccessControlList localTargetGrants ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTargetGrantsTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.AccessControlList - */ - public com.amazon.s3.AccessControlList getTargetGrants(){ - return localTargetGrants; - } - - - - /** - * Auto generated setter method - * @param param TargetGrants - */ - public void setTargetGrants(com.amazon.s3.AccessControlList param){ - - if (param != null){ - //update the setting tracker - localTargetGrantsTracker = true; - } else { - localTargetGrantsTracker = false; - - } - - this.localTargetGrants=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - LoggingSettings.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":LoggingSettings", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "LoggingSettings", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"TargetBucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"TargetBucket"); - } - - } else { - xmlWriter.writeStartElement("TargetBucket"); - } - - - if (localTargetBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("TargetBucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localTargetBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"TargetPrefix", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"TargetPrefix"); - } - - } else { - xmlWriter.writeStartElement("TargetPrefix"); - } - - - if (localTargetPrefix==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("TargetPrefix cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localTargetPrefix); - - } - - xmlWriter.writeEndElement(); - if (localTargetGrantsTracker){ - if (localTargetGrants==null){ - throw new org.apache.axis2.databinding.ADBException("TargetGrants cannot be null!!"); - } - localTargetGrants.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetGrants"), - factory,xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "TargetBucket")); - - if (localTargetBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTargetBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("TargetBucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "TargetPrefix")); - - if (localTargetPrefix != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTargetPrefix)); - } else { - throw new org.apache.axis2.databinding.ADBException("TargetPrefix cannot be null!!"); - } - if (localTargetGrantsTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "TargetGrants")); - - - if (localTargetGrants==null){ - throw new org.apache.axis2.databinding.ADBException("TargetGrants cannot be null!!"); - } - elementList.add(localTargetGrants); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static LoggingSettings parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - LoggingSettings object = - new LoggingSettings(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"LoggingSettings".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LoggingSettings)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetBucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTargetBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetPrefix").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTargetPrefix( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetGrants").equals(reader.getName())){ - - object.setTargetGrants(com.amazon.s3.AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * LoggingSettings.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * LoggingSettings bean class + */ + + public class LoggingSettings + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = LoggingSettings + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for TargetBucket + */ + + + protected java.lang.String localTargetBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getTargetBucket(){ + return localTargetBucket; + } + + + + /** + * Auto generated setter method + * @param param TargetBucket + */ + public void setTargetBucket(java.lang.String param){ + + this.localTargetBucket=param; + + + } + + + /** + * field for TargetPrefix + */ + + + protected java.lang.String localTargetPrefix ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getTargetPrefix(){ + return localTargetPrefix; + } + + + + /** + * Auto generated setter method + * @param param TargetPrefix + */ + public void setTargetPrefix(java.lang.String param){ + + this.localTargetPrefix=param; + + + } + + + /** + * field for TargetGrants + */ + + + protected com.amazon.s3.AccessControlList localTargetGrants ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTargetGrantsTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.AccessControlList + */ + public com.amazon.s3.AccessControlList getTargetGrants(){ + return localTargetGrants; + } + + + + /** + * Auto generated setter method + * @param param TargetGrants + */ + public void setTargetGrants(com.amazon.s3.AccessControlList param){ + + if (param != null){ + //update the setting tracker + localTargetGrantsTracker = true; + } else { + localTargetGrantsTracker = false; + + } + + this.localTargetGrants=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + LoggingSettings.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":LoggingSettings", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "LoggingSettings", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"TargetBucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"TargetBucket"); + } + + } else { + xmlWriter.writeStartElement("TargetBucket"); + } + + + if (localTargetBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("TargetBucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localTargetBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"TargetPrefix", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"TargetPrefix"); + } + + } else { + xmlWriter.writeStartElement("TargetPrefix"); + } + + + if (localTargetPrefix==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("TargetPrefix cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localTargetPrefix); + + } + + xmlWriter.writeEndElement(); + if (localTargetGrantsTracker){ + if (localTargetGrants==null){ + throw new org.apache.axis2.databinding.ADBException("TargetGrants cannot be null!!"); + } + localTargetGrants.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetGrants"), + factory,xmlWriter); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "TargetBucket")); + + if (localTargetBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTargetBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("TargetBucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "TargetPrefix")); + + if (localTargetPrefix != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTargetPrefix)); + } else { + throw new org.apache.axis2.databinding.ADBException("TargetPrefix cannot be null!!"); + } + if (localTargetGrantsTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "TargetGrants")); + + + if (localTargetGrants==null){ + throw new org.apache.axis2.databinding.ADBException("TargetGrants cannot be null!!"); + } + elementList.add(localTargetGrants); + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static LoggingSettings parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + LoggingSettings object = + new LoggingSettings(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"LoggingSettings".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (LoggingSettings)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetBucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTargetBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetPrefix").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTargetPrefix( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetGrants").equals(reader.getName())){ + + object.setTargetGrants(com.amazon.s3.AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/MetadataDirective.java b/awsapi/src/com/amazon/s3/MetadataDirective.java index 75b54d5478c..1daf81a12cf 100644 --- a/awsapi/src/com/amazon/s3/MetadataDirective.java +++ b/awsapi/src/com/amazon/s3/MetadataDirective.java @@ -1,466 +1,482 @@ - -/** - * MetadataDirective.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * MetadataDirective bean class - */ - - public class MetadataDirective - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "MetadataDirective", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for MetadataDirective - */ - - - protected java.lang.String localMetadataDirective ; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected MetadataDirective(java.lang.String value, boolean isRegisterValue) { - localMetadataDirective = value; - if (isRegisterValue){ - - _table_.put(localMetadataDirective, this); - - } - - } - - public static final java.lang.String _COPY = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("COPY"); - - public static final java.lang.String _REPLACE = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("REPLACE"); - - public static final MetadataDirective COPY = - new MetadataDirective(_COPY,true); - - public static final MetadataDirective REPLACE = - new MetadataDirective(_REPLACE,true); - - - public java.lang.String getValue() { return localMetadataDirective;} - - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { - - return localMetadataDirective.toString(); - - - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - MetadataDirective.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - //We can safely assume an element has only one type associated with it - - java.lang.String namespace = parentQName.getNamespaceURI(); - java.lang.String localName = parentQName.getLocalPart(); - - if (! namespace.equals("")) { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix, localName, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace, localName); - } - - } else { - xmlWriter.writeStartElement(localName); - } - - // add the type details if this is used in a simple type - if (serializeType){ - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":MetadataDirective", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "MetadataDirective", - xmlWriter); - } - } - - if (localMetadataDirective==null){ - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); - - }else{ - - xmlWriter.writeCharacters(localMetadataDirective); - - } - - xmlWriter.writeEndElement(); - - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - - //We can safely assume an element has only one type associated with it - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, - new java.lang.Object[]{ - org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMetadataDirective) - }, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - public static MetadataDirective fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - MetadataDirective enumeration = (MetadataDirective) - - _table_.get(value); - - - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static MetadataDirective fromString(java.lang.String value,java.lang.String namespaceURI) - throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } catch (java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static MetadataDirective fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, - java.lang.String content) { - if (content.indexOf(":") > -1){ - java.lang.String prefix = content.substring(0,content.indexOf(":")); - java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return MetadataDirective.Factory.fromString(content,namespaceUri); - } else { - return MetadataDirective.Factory.fromString(content,""); - } - } - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static MetadataDirective parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - MetadataDirective object = null; - // initialize a hash map to keep values - java.util.Map attributeMap = new java.util.HashMap(); - java.util.List extraAttributeList = new java.util.ArrayList(); - - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - while(!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()){ - - java.lang.String content = reader.getElementText(); - - if (content.indexOf(":") > 0) { - // this seems to be a Qname so find the namespace and send - prefix = content.substring(0, content.indexOf(":")); - namespaceuri = reader.getNamespaceURI(prefix); - object = MetadataDirective.Factory.fromString(content,namespaceuri); - } else { - // this seems to be not a qname send and empty namespace incase of it is - // check is done in fromString method - object = MetadataDirective.Factory.fromString(content,""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * MetadataDirective.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * MetadataDirective bean class + */ + + public class MetadataDirective + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "MetadataDirective", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for MetadataDirective + */ + + + protected java.lang.String localMetadataDirective ; + + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + + protected MetadataDirective(java.lang.String value, boolean isRegisterValue) { + localMetadataDirective = value; + if (isRegisterValue){ + + _table_.put(localMetadataDirective, this); + + } + + } + + public static final java.lang.String _COPY = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("COPY"); + + public static final java.lang.String _REPLACE = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("REPLACE"); + + public static final MetadataDirective COPY = + new MetadataDirective(_COPY,true); + + public static final MetadataDirective REPLACE = + new MetadataDirective(_REPLACE,true); + + + public java.lang.String getValue() { return localMetadataDirective;} + + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { + + return localMetadataDirective.toString(); + + + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + MetadataDirective.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + //We can safely assume an element has only one type associated with it + + java.lang.String namespace = parentQName.getNamespaceURI(); + java.lang.String localName = parentQName.getLocalPart(); + + if (! namespace.equals("")) { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix, localName, namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace, localName); + } + + } else { + xmlWriter.writeStartElement(localName); + } + + // add the type details if this is used in a simple type + if (serializeType){ + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":MetadataDirective", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "MetadataDirective", + xmlWriter); + } + } + + if (localMetadataDirective==null){ + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); + + }else{ + + xmlWriter.writeCharacters(localMetadataDirective); + + } + + xmlWriter.writeEndElement(); + + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + + //We can safely assume an element has only one type associated with it + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, + new java.lang.Object[]{ + org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMetadataDirective) + }, + null); + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + public static MetadataDirective fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + MetadataDirective enumeration = (MetadataDirective) + + _table_.get(value); + + + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static MetadataDirective fromString(java.lang.String value,java.lang.String namespaceURI) + throws java.lang.IllegalArgumentException { + try { + + return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); + + + } catch (java.lang.Exception e) { + throw new java.lang.IllegalArgumentException(); + } + } + + public static MetadataDirective fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, + java.lang.String content) { + if (content.indexOf(":") > -1){ + java.lang.String prefix = content.substring(0,content.indexOf(":")); + java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); + return MetadataDirective.Factory.fromString(content,namespaceUri); + } else { + return MetadataDirective.Factory.fromString(content,""); + } + } + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static MetadataDirective parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + MetadataDirective object = null; + // initialize a hash map to keep values + java.util.Map attributeMap = new java.util.HashMap(); + java.util.List extraAttributeList = new java.util.ArrayList(); + + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + while(!reader.isEndElement()) { + if (reader.isStartElement() || reader.hasText()){ + + java.lang.String content = reader.getElementText(); + + if (content.indexOf(":") > 0) { + // this seems to be a Qname so find the namespace and send + prefix = content.substring(0, content.indexOf(":")); + namespaceuri = reader.getNamespaceURI(prefix); + object = MetadataDirective.Factory.fromString(content,namespaceuri); + } else { + // this seems to be not a qname send and empty namespace incase of it is + // check is done in fromString method + object = MetadataDirective.Factory.fromString(content,""); + } + + + } else { + reader.next(); + } + } // end of while loop + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/MetadataEntry.java b/awsapi/src/com/amazon/s3/MetadataEntry.java index 3555c8138bf..d37ddc2255a 100644 --- a/awsapi/src/com/amazon/s3/MetadataEntry.java +++ b/awsapi/src/com/amazon/s3/MetadataEntry.java @@ -1,575 +1,591 @@ - -/** - * MetadataEntry.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * MetadataEntry bean class - */ - - public class MetadataEntry - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = MetadataEntry - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Name - */ - - - protected java.lang.String localName ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getName(){ - return localName; - } - - - - /** - * Auto generated setter method - * @param param Name - */ - public void setName(java.lang.String param){ - - this.localName=param; - - - } - - - /** - * field for Value - */ - - - protected java.lang.String localValue ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getValue(){ - return localValue; - } - - - - /** - * Auto generated setter method - * @param param Value - */ - public void setValue(java.lang.String param){ - - this.localValue=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - MetadataEntry.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":MetadataEntry", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "MetadataEntry", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Name", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Name"); - } - - } else { - xmlWriter.writeStartElement("Name"); - } - - - if (localName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localName); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Value", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Value"); - } - - } else { - xmlWriter.writeStartElement("Value"); - } - - - if (localValue==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localValue); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Name")); - - if (localName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Value")); - - if (localValue != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue)); - } else { - throw new org.apache.axis2.databinding.ADBException("Value cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static MetadataEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - MetadataEntry object = - new MetadataEntry(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"MetadataEntry".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (MetadataEntry)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Value").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setValue( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * MetadataEntry.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * MetadataEntry bean class + */ + + public class MetadataEntry + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = MetadataEntry + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Name + */ + + + protected java.lang.String localName ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getName(){ + return localName; + } + + + + /** + * Auto generated setter method + * @param param Name + */ + public void setName(java.lang.String param){ + + this.localName=param; + + + } + + + /** + * field for Value + */ + + + protected java.lang.String localValue ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getValue(){ + return localValue; + } + + + + /** + * Auto generated setter method + * @param param Value + */ + public void setValue(java.lang.String param){ + + this.localValue=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + MetadataEntry.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":MetadataEntry", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "MetadataEntry", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Name", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Name"); + } + + } else { + xmlWriter.writeStartElement("Name"); + } + + + if (localName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localName); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Value", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Value"); + } + + } else { + xmlWriter.writeStartElement("Value"); + } + + + if (localValue==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localValue); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Name")); + + if (localName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); + } else { + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Value")); + + if (localValue != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue)); + } else { + throw new org.apache.axis2.databinding.ADBException("Value cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static MetadataEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + MetadataEntry object = + new MetadataEntry(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"MetadataEntry".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (MetadataEntry)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Value").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setValue( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/MfaDeleteStatus.java b/awsapi/src/com/amazon/s3/MfaDeleteStatus.java index f9094678258..dc395325504 100644 --- a/awsapi/src/com/amazon/s3/MfaDeleteStatus.java +++ b/awsapi/src/com/amazon/s3/MfaDeleteStatus.java @@ -1,466 +1,482 @@ - -/** - * MfaDeleteStatus.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * MfaDeleteStatus bean class - */ - - public class MfaDeleteStatus - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "MfaDeleteStatus", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for MfaDeleteStatus - */ - - - protected java.lang.String localMfaDeleteStatus ; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected MfaDeleteStatus(java.lang.String value, boolean isRegisterValue) { - localMfaDeleteStatus = value; - if (isRegisterValue){ - - _table_.put(localMfaDeleteStatus, this); - - } - - } - - public static final java.lang.String _Enabled = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("Enabled"); - - public static final java.lang.String _Disabled = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("Disabled"); - - public static final MfaDeleteStatus Enabled = - new MfaDeleteStatus(_Enabled,true); - - public static final MfaDeleteStatus Disabled = - new MfaDeleteStatus(_Disabled,true); - - - public java.lang.String getValue() { return localMfaDeleteStatus;} - - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { - - return localMfaDeleteStatus.toString(); - - - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - MfaDeleteStatus.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - //We can safely assume an element has only one type associated with it - - java.lang.String namespace = parentQName.getNamespaceURI(); - java.lang.String localName = parentQName.getLocalPart(); - - if (! namespace.equals("")) { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix, localName, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace, localName); - } - - } else { - xmlWriter.writeStartElement(localName); - } - - // add the type details if this is used in a simple type - if (serializeType){ - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":MfaDeleteStatus", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "MfaDeleteStatus", - xmlWriter); - } - } - - if (localMfaDeleteStatus==null){ - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); - - }else{ - - xmlWriter.writeCharacters(localMfaDeleteStatus); - - } - - xmlWriter.writeEndElement(); - - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - - //We can safely assume an element has only one type associated with it - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, - new java.lang.Object[]{ - org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMfaDeleteStatus) - }, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - public static MfaDeleteStatus fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - MfaDeleteStatus enumeration = (MfaDeleteStatus) - - _table_.get(value); - - - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static MfaDeleteStatus fromString(java.lang.String value,java.lang.String namespaceURI) - throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } catch (java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static MfaDeleteStatus fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, - java.lang.String content) { - if (content.indexOf(":") > -1){ - java.lang.String prefix = content.substring(0,content.indexOf(":")); - java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return MfaDeleteStatus.Factory.fromString(content,namespaceUri); - } else { - return MfaDeleteStatus.Factory.fromString(content,""); - } - } - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static MfaDeleteStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - MfaDeleteStatus object = null; - // initialize a hash map to keep values - java.util.Map attributeMap = new java.util.HashMap(); - java.util.List extraAttributeList = new java.util.ArrayList(); - - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - while(!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()){ - - java.lang.String content = reader.getElementText(); - - if (content.indexOf(":") > 0) { - // this seems to be a Qname so find the namespace and send - prefix = content.substring(0, content.indexOf(":")); - namespaceuri = reader.getNamespaceURI(prefix); - object = MfaDeleteStatus.Factory.fromString(content,namespaceuri); - } else { - // this seems to be not a qname send and empty namespace incase of it is - // check is done in fromString method - object = MfaDeleteStatus.Factory.fromString(content,""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * MfaDeleteStatus.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * MfaDeleteStatus bean class + */ + + public class MfaDeleteStatus + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "MfaDeleteStatus", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for MfaDeleteStatus + */ + + + protected java.lang.String localMfaDeleteStatus ; + + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + + protected MfaDeleteStatus(java.lang.String value, boolean isRegisterValue) { + localMfaDeleteStatus = value; + if (isRegisterValue){ + + _table_.put(localMfaDeleteStatus, this); + + } + + } + + public static final java.lang.String _Enabled = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("Enabled"); + + public static final java.lang.String _Disabled = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("Disabled"); + + public static final MfaDeleteStatus Enabled = + new MfaDeleteStatus(_Enabled,true); + + public static final MfaDeleteStatus Disabled = + new MfaDeleteStatus(_Disabled,true); + + + public java.lang.String getValue() { return localMfaDeleteStatus;} + + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { + + return localMfaDeleteStatus.toString(); + + + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + MfaDeleteStatus.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + //We can safely assume an element has only one type associated with it + + java.lang.String namespace = parentQName.getNamespaceURI(); + java.lang.String localName = parentQName.getLocalPart(); + + if (! namespace.equals("")) { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix, localName, namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace, localName); + } + + } else { + xmlWriter.writeStartElement(localName); + } + + // add the type details if this is used in a simple type + if (serializeType){ + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":MfaDeleteStatus", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "MfaDeleteStatus", + xmlWriter); + } + } + + if (localMfaDeleteStatus==null){ + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); + + }else{ + + xmlWriter.writeCharacters(localMfaDeleteStatus); + + } + + xmlWriter.writeEndElement(); + + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + + //We can safely assume an element has only one type associated with it + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, + new java.lang.Object[]{ + org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMfaDeleteStatus) + }, + null); + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + public static MfaDeleteStatus fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + MfaDeleteStatus enumeration = (MfaDeleteStatus) + + _table_.get(value); + + + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static MfaDeleteStatus fromString(java.lang.String value,java.lang.String namespaceURI) + throws java.lang.IllegalArgumentException { + try { + + return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); + + + } catch (java.lang.Exception e) { + throw new java.lang.IllegalArgumentException(); + } + } + + public static MfaDeleteStatus fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, + java.lang.String content) { + if (content.indexOf(":") > -1){ + java.lang.String prefix = content.substring(0,content.indexOf(":")); + java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); + return MfaDeleteStatus.Factory.fromString(content,namespaceUri); + } else { + return MfaDeleteStatus.Factory.fromString(content,""); + } + } + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static MfaDeleteStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + MfaDeleteStatus object = null; + // initialize a hash map to keep values + java.util.Map attributeMap = new java.util.HashMap(); + java.util.List extraAttributeList = new java.util.ArrayList(); + + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + while(!reader.isEndElement()) { + if (reader.isStartElement() || reader.hasText()){ + + java.lang.String content = reader.getElementText(); + + if (content.indexOf(":") > 0) { + // this seems to be a Qname so find the namespace and send + prefix = content.substring(0, content.indexOf(":")); + namespaceuri = reader.getNamespaceURI(prefix); + object = MfaDeleteStatus.Factory.fromString(content,namespaceuri); + } else { + // this seems to be not a qname send and empty namespace incase of it is + // check is done in fromString method + object = MfaDeleteStatus.Factory.fromString(content,""); + } + + + } else { + reader.next(); + } + } // end of while loop + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/NotificationConfiguration.java b/awsapi/src/com/amazon/s3/NotificationConfiguration.java index aece2417290..3ca75ac7f94 100644 --- a/awsapi/src/com/amazon/s3/NotificationConfiguration.java +++ b/awsapi/src/com/amazon/s3/NotificationConfiguration.java @@ -1,560 +1,576 @@ - -/** - * NotificationConfiguration.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * NotificationConfiguration bean class - */ - - public class NotificationConfiguration - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = NotificationConfiguration - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for TopicConfiguration - * This was an Array! - */ - - - protected com.amazon.s3.TopicConfiguration[] localTopicConfiguration ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTopicConfigurationTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.TopicConfiguration[] - */ - public com.amazon.s3.TopicConfiguration[] getTopicConfiguration(){ - return localTopicConfiguration; - } - - - - - - - /** - * validate the array for TopicConfiguration - */ - protected void validateTopicConfiguration(com.amazon.s3.TopicConfiguration[] param){ - - } - - - /** - * Auto generated setter method - * @param param TopicConfiguration - */ - public void setTopicConfiguration(com.amazon.s3.TopicConfiguration[] param){ - - validateTopicConfiguration(param); - - - if (param != null){ - //update the setting tracker - localTopicConfigurationTracker = true; - } else { - localTopicConfigurationTracker = false; - - } - - this.localTopicConfiguration=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.TopicConfiguration - */ - public void addTopicConfiguration(com.amazon.s3.TopicConfiguration param){ - if (localTopicConfiguration == null){ - localTopicConfiguration = new com.amazon.s3.TopicConfiguration[]{}; - } - - - //update the setting tracker - localTopicConfigurationTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localTopicConfiguration); - list.add(param); - this.localTopicConfiguration = - (com.amazon.s3.TopicConfiguration[])list.toArray( - new com.amazon.s3.TopicConfiguration[list.size()]); - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - NotificationConfiguration.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":NotificationConfiguration", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "NotificationConfiguration", - xmlWriter); - } - - - } - if (localTopicConfigurationTracker){ - if (localTopicConfiguration!=null){ - for (int i = 0;i < localTopicConfiguration.length;i++){ - if (localTopicConfiguration[i] != null){ - localTopicConfiguration[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TopicConfiguration"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("TopicConfiguration cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localTopicConfigurationTracker){ - if (localTopicConfiguration!=null) { - for (int i = 0;i < localTopicConfiguration.length;i++){ - - if (localTopicConfiguration[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "TopicConfiguration")); - elementList.add(localTopicConfiguration[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("TopicConfiguration cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static NotificationConfiguration parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - NotificationConfiguration object = - new NotificationConfiguration(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"NotificationConfiguration".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (NotificationConfiguration)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TopicConfiguration").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list1.add(com.amazon.s3.TopicConfiguration.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while(!loopDone1){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TopicConfiguration").equals(reader.getName())){ - list1.add(com.amazon.s3.TopicConfiguration.Factory.parse(reader)); - - }else{ - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setTopicConfiguration((com.amazon.s3.TopicConfiguration[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.TopicConfiguration.class, - list1)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * NotificationConfiguration.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * NotificationConfiguration bean class + */ + + public class NotificationConfiguration + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = NotificationConfiguration + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for TopicConfiguration + * This was an Array! + */ + + + protected com.amazon.s3.TopicConfiguration[] localTopicConfiguration ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTopicConfigurationTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.TopicConfiguration[] + */ + public com.amazon.s3.TopicConfiguration[] getTopicConfiguration(){ + return localTopicConfiguration; + } + + + + + + + /** + * validate the array for TopicConfiguration + */ + protected void validateTopicConfiguration(com.amazon.s3.TopicConfiguration[] param){ + + } + + + /** + * Auto generated setter method + * @param param TopicConfiguration + */ + public void setTopicConfiguration(com.amazon.s3.TopicConfiguration[] param){ + + validateTopicConfiguration(param); + + + if (param != null){ + //update the setting tracker + localTopicConfigurationTracker = true; + } else { + localTopicConfigurationTracker = false; + + } + + this.localTopicConfiguration=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.TopicConfiguration + */ + public void addTopicConfiguration(com.amazon.s3.TopicConfiguration param){ + if (localTopicConfiguration == null){ + localTopicConfiguration = new com.amazon.s3.TopicConfiguration[]{}; + } + + + //update the setting tracker + localTopicConfigurationTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localTopicConfiguration); + list.add(param); + this.localTopicConfiguration = + (com.amazon.s3.TopicConfiguration[])list.toArray( + new com.amazon.s3.TopicConfiguration[list.size()]); + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + NotificationConfiguration.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":NotificationConfiguration", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "NotificationConfiguration", + xmlWriter); + } + + + } + if (localTopicConfigurationTracker){ + if (localTopicConfiguration!=null){ + for (int i = 0;i < localTopicConfiguration.length;i++){ + if (localTopicConfiguration[i] != null){ + localTopicConfiguration[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TopicConfiguration"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("TopicConfiguration cannot be null!!"); + + } + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localTopicConfigurationTracker){ + if (localTopicConfiguration!=null) { + for (int i = 0;i < localTopicConfiguration.length;i++){ + + if (localTopicConfiguration[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "TopicConfiguration")); + elementList.add(localTopicConfiguration[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("TopicConfiguration cannot be null!!"); + + } + + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static NotificationConfiguration parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + NotificationConfiguration object = + new NotificationConfiguration(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"NotificationConfiguration".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (NotificationConfiguration)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list1 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TopicConfiguration").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list1.add(com.amazon.s3.TopicConfiguration.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone1 = false; + while(!loopDone1){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone1 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TopicConfiguration").equals(reader.getName())){ + list1.add(com.amazon.s3.TopicConfiguration.Factory.parse(reader)); + + }else{ + loopDone1 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setTopicConfiguration((com.amazon.s3.TopicConfiguration[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.TopicConfiguration.class, + list1)); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/Payer.java b/awsapi/src/com/amazon/s3/Payer.java index 0c4bee92716..7c7bda8c9de 100644 --- a/awsapi/src/com/amazon/s3/Payer.java +++ b/awsapi/src/com/amazon/s3/Payer.java @@ -1,466 +1,482 @@ - -/** - * Payer.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * Payer bean class - */ - - public class Payer - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "Payer", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Payer - */ - - - protected java.lang.String localPayer ; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected Payer(java.lang.String value, boolean isRegisterValue) { - localPayer = value; - if (isRegisterValue){ - - _table_.put(localPayer, this); - - } - - } - - public static final java.lang.String _BucketOwner = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("BucketOwner"); - - public static final java.lang.String _Requester = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("Requester"); - - public static final Payer BucketOwner = - new Payer(_BucketOwner,true); - - public static final Payer Requester = - new Payer(_Requester,true); - - - public java.lang.String getValue() { return localPayer;} - - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { - - return localPayer.toString(); - - - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Payer.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - //We can safely assume an element has only one type associated with it - - java.lang.String namespace = parentQName.getNamespaceURI(); - java.lang.String localName = parentQName.getLocalPart(); - - if (! namespace.equals("")) { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix, localName, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace, localName); - } - - } else { - xmlWriter.writeStartElement(localName); - } - - // add the type details if this is used in a simple type - if (serializeType){ - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Payer", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Payer", - xmlWriter); - } - } - - if (localPayer==null){ - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); - - }else{ - - xmlWriter.writeCharacters(localPayer); - - } - - xmlWriter.writeEndElement(); - - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - - //We can safely assume an element has only one type associated with it - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, - new java.lang.Object[]{ - org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPayer) - }, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - public static Payer fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - Payer enumeration = (Payer) - - _table_.get(value); - - - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static Payer fromString(java.lang.String value,java.lang.String namespaceURI) - throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } catch (java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static Payer fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, - java.lang.String content) { - if (content.indexOf(":") > -1){ - java.lang.String prefix = content.substring(0,content.indexOf(":")); - java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return Payer.Factory.fromString(content,namespaceUri); - } else { - return Payer.Factory.fromString(content,""); - } - } - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Payer parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Payer object = null; - // initialize a hash map to keep values - java.util.Map attributeMap = new java.util.HashMap(); - java.util.List extraAttributeList = new java.util.ArrayList(); - - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - while(!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()){ - - java.lang.String content = reader.getElementText(); - - if (content.indexOf(":") > 0) { - // this seems to be a Qname so find the namespace and send - prefix = content.substring(0, content.indexOf(":")); - namespaceuri = reader.getNamespaceURI(prefix); - object = Payer.Factory.fromString(content,namespaceuri); - } else { - // this seems to be not a qname send and empty namespace incase of it is - // check is done in fromString method - object = Payer.Factory.fromString(content,""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * Payer.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * Payer bean class + */ + + public class Payer + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "Payer", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Payer + */ + + + protected java.lang.String localPayer ; + + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + + protected Payer(java.lang.String value, boolean isRegisterValue) { + localPayer = value; + if (isRegisterValue){ + + _table_.put(localPayer, this); + + } + + } + + public static final java.lang.String _BucketOwner = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("BucketOwner"); + + public static final java.lang.String _Requester = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("Requester"); + + public static final Payer BucketOwner = + new Payer(_BucketOwner,true); + + public static final Payer Requester = + new Payer(_Requester,true); + + + public java.lang.String getValue() { return localPayer;} + + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { + + return localPayer.toString(); + + + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Payer.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + //We can safely assume an element has only one type associated with it + + java.lang.String namespace = parentQName.getNamespaceURI(); + java.lang.String localName = parentQName.getLocalPart(); + + if (! namespace.equals("")) { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix, localName, namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace, localName); + } + + } else { + xmlWriter.writeStartElement(localName); + } + + // add the type details if this is used in a simple type + if (serializeType){ + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Payer", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Payer", + xmlWriter); + } + } + + if (localPayer==null){ + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); + + }else{ + + xmlWriter.writeCharacters(localPayer); + + } + + xmlWriter.writeEndElement(); + + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + + //We can safely assume an element has only one type associated with it + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, + new java.lang.Object[]{ + org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPayer) + }, + null); + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + public static Payer fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + Payer enumeration = (Payer) + + _table_.get(value); + + + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static Payer fromString(java.lang.String value,java.lang.String namespaceURI) + throws java.lang.IllegalArgumentException { + try { + + return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); + + + } catch (java.lang.Exception e) { + throw new java.lang.IllegalArgumentException(); + } + } + + public static Payer fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, + java.lang.String content) { + if (content.indexOf(":") > -1){ + java.lang.String prefix = content.substring(0,content.indexOf(":")); + java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); + return Payer.Factory.fromString(content,namespaceUri); + } else { + return Payer.Factory.fromString(content,""); + } + } + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Payer parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Payer object = null; + // initialize a hash map to keep values + java.util.Map attributeMap = new java.util.HashMap(); + java.util.List extraAttributeList = new java.util.ArrayList(); + + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + while(!reader.isEndElement()) { + if (reader.isStartElement() || reader.hasText()){ + + java.lang.String content = reader.getElementText(); + + if (content.indexOf(":") > 0) { + // this seems to be a Qname so find the namespace and send + prefix = content.substring(0, content.indexOf(":")); + namespaceuri = reader.getNamespaceURI(prefix); + object = Payer.Factory.fromString(content,namespaceuri); + } else { + // this seems to be not a qname send and empty namespace incase of it is + // check is done in fromString method + object = Payer.Factory.fromString(content,""); + } + + + } else { + reader.next(); + } + } // end of while loop + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/Permission.java b/awsapi/src/com/amazon/s3/Permission.java index cf61ea6ca91..9b24d3bfe5f 100644 --- a/awsapi/src/com/amazon/s3/Permission.java +++ b/awsapi/src/com/amazon/s3/Permission.java @@ -1,484 +1,500 @@ - -/** - * Permission.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * Permission bean class - */ - - public class Permission - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "Permission", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Permission - */ - - - protected java.lang.String localPermission ; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected Permission(java.lang.String value, boolean isRegisterValue) { - localPermission = value; - if (isRegisterValue){ - - _table_.put(localPermission, this); - - } - - } - - public static final java.lang.String _READ = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("READ"); - - public static final java.lang.String _WRITE = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("WRITE"); - - public static final java.lang.String _READ_ACP = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("READ_ACP"); - - public static final java.lang.String _WRITE_ACP = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("WRITE_ACP"); - - public static final java.lang.String _FULL_CONTROL = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FULL_CONTROL"); - - public static final Permission READ = - new Permission(_READ,true); - - public static final Permission WRITE = - new Permission(_WRITE,true); - - public static final Permission READ_ACP = - new Permission(_READ_ACP,true); - - public static final Permission WRITE_ACP = - new Permission(_WRITE_ACP,true); - - public static final Permission FULL_CONTROL = - new Permission(_FULL_CONTROL,true); - - - public java.lang.String getValue() { return localPermission;} - - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { - - return localPermission.toString(); - - - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Permission.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - //We can safely assume an element has only one type associated with it - - java.lang.String namespace = parentQName.getNamespaceURI(); - java.lang.String localName = parentQName.getLocalPart(); - - if (! namespace.equals("")) { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix, localName, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace, localName); - } - - } else { - xmlWriter.writeStartElement(localName); - } - - // add the type details if this is used in a simple type - if (serializeType){ - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Permission", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Permission", - xmlWriter); - } - } - - if (localPermission==null){ - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); - - }else{ - - xmlWriter.writeCharacters(localPermission); - - } - - xmlWriter.writeEndElement(); - - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - - //We can safely assume an element has only one type associated with it - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, - new java.lang.Object[]{ - org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPermission) - }, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - public static Permission fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - Permission enumeration = (Permission) - - _table_.get(value); - - - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static Permission fromString(java.lang.String value,java.lang.String namespaceURI) - throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } catch (java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static Permission fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, - java.lang.String content) { - if (content.indexOf(":") > -1){ - java.lang.String prefix = content.substring(0,content.indexOf(":")); - java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return Permission.Factory.fromString(content,namespaceUri); - } else { - return Permission.Factory.fromString(content,""); - } - } - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Permission parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Permission object = null; - // initialize a hash map to keep values - java.util.Map attributeMap = new java.util.HashMap(); - java.util.List extraAttributeList = new java.util.ArrayList(); - - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - while(!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()){ - - java.lang.String content = reader.getElementText(); - - if (content.indexOf(":") > 0) { - // this seems to be a Qname so find the namespace and send - prefix = content.substring(0, content.indexOf(":")); - namespaceuri = reader.getNamespaceURI(prefix); - object = Permission.Factory.fromString(content,namespaceuri); - } else { - // this seems to be not a qname send and empty namespace incase of it is - // check is done in fromString method - object = Permission.Factory.fromString(content,""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * Permission.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * Permission bean class + */ + + public class Permission + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "Permission", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Permission + */ + + + protected java.lang.String localPermission ; + + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + + protected Permission(java.lang.String value, boolean isRegisterValue) { + localPermission = value; + if (isRegisterValue){ + + _table_.put(localPermission, this); + + } + + } + + public static final java.lang.String _READ = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("READ"); + + public static final java.lang.String _WRITE = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("WRITE"); + + public static final java.lang.String _READ_ACP = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("READ_ACP"); + + public static final java.lang.String _WRITE_ACP = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("WRITE_ACP"); + + public static final java.lang.String _FULL_CONTROL = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FULL_CONTROL"); + + public static final Permission READ = + new Permission(_READ,true); + + public static final Permission WRITE = + new Permission(_WRITE,true); + + public static final Permission READ_ACP = + new Permission(_READ_ACP,true); + + public static final Permission WRITE_ACP = + new Permission(_WRITE_ACP,true); + + public static final Permission FULL_CONTROL = + new Permission(_FULL_CONTROL,true); + + + public java.lang.String getValue() { return localPermission;} + + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { + + return localPermission.toString(); + + + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Permission.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + //We can safely assume an element has only one type associated with it + + java.lang.String namespace = parentQName.getNamespaceURI(); + java.lang.String localName = parentQName.getLocalPart(); + + if (! namespace.equals("")) { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix, localName, namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace, localName); + } + + } else { + xmlWriter.writeStartElement(localName); + } + + // add the type details if this is used in a simple type + if (serializeType){ + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Permission", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Permission", + xmlWriter); + } + } + + if (localPermission==null){ + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); + + }else{ + + xmlWriter.writeCharacters(localPermission); + + } + + xmlWriter.writeEndElement(); + + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + + //We can safely assume an element has only one type associated with it + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, + new java.lang.Object[]{ + org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPermission) + }, + null); + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + public static Permission fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + Permission enumeration = (Permission) + + _table_.get(value); + + + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static Permission fromString(java.lang.String value,java.lang.String namespaceURI) + throws java.lang.IllegalArgumentException { + try { + + return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); + + + } catch (java.lang.Exception e) { + throw new java.lang.IllegalArgumentException(); + } + } + + public static Permission fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, + java.lang.String content) { + if (content.indexOf(":") > -1){ + java.lang.String prefix = content.substring(0,content.indexOf(":")); + java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); + return Permission.Factory.fromString(content,namespaceUri); + } else { + return Permission.Factory.fromString(content,""); + } + } + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Permission parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Permission object = null; + // initialize a hash map to keep values + java.util.Map attributeMap = new java.util.HashMap(); + java.util.List extraAttributeList = new java.util.ArrayList(); + + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + while(!reader.isEndElement()) { + if (reader.isStartElement() || reader.hasText()){ + + java.lang.String content = reader.getElementText(); + + if (content.indexOf(":") > 0) { + // this seems to be a Qname so find the namespace and send + prefix = content.substring(0, content.indexOf(":")); + namespaceuri = reader.getNamespaceURI(prefix); + object = Permission.Factory.fromString(content,namespaceuri); + } else { + // this seems to be not a qname send and empty namespace incase of it is + // check is done in fromString method + object = Permission.Factory.fromString(content,""); + } + + + } else { + reader.next(); + } + } // end of while loop + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/PostResponse.java b/awsapi/src/com/amazon/s3/PostResponse.java index 24ab1dd8656..51318ae29e0 100644 --- a/awsapi/src/com/amazon/s3/PostResponse.java +++ b/awsapi/src/com/amazon/s3/PostResponse.java @@ -1,760 +1,776 @@ - -/** - * PostResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * PostResponse bean class - */ - - public class PostResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "PostResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Location - */ - - - protected org.apache.axis2.databinding.types.URI localLocation ; - - - /** - * Auto generated getter method - * @return org.apache.axis2.databinding.types.URI - */ - public org.apache.axis2.databinding.types.URI getLocation(){ - return localLocation; - } - - - - /** - * Auto generated setter method - * @param param Location - */ - public void setLocation(org.apache.axis2.databinding.types.URI param){ - - this.localLocation=param; - - - } - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PostResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PostResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PostResponse", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Location", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Location"); - } - - } else { - xmlWriter.writeStartElement("Location"); - } - - - if (localLocation==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Location cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocation)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Location")); - - if (localLocation != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocation)); - } else { - throw new org.apache.axis2.databinding.ADBException("Location cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PostResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PostResponse object = - new PostResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PostResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PostResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Location").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLocation( - org.apache.axis2.databinding.utils.ConverterUtil.convertToAnyURI(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * PostResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * PostResponse bean class + */ + + public class PostResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "PostResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Location + */ + + + protected org.apache.axis2.databinding.types.URI localLocation ; + + + /** + * Auto generated getter method + * @return org.apache.axis2.databinding.types.URI + */ + public org.apache.axis2.databinding.types.URI getLocation(){ + return localLocation; + } + + + + /** + * Auto generated setter method + * @param param Location + */ + public void setLocation(org.apache.axis2.databinding.types.URI param){ + + this.localLocation=param; + + + } + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PostResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PostResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PostResponse", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Location", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Location"); + } + + } else { + xmlWriter.writeStartElement("Location"); + } + + + if (localLocation==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Location cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocation)); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Location")); + + if (localLocation != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocation)); + } else { + throw new org.apache.axis2.databinding.ADBException("Location cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PostResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PostResponse object = + new PostResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PostResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PostResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Location").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLocation( + org.apache.axis2.databinding.utils.ConverterUtil.convertToAnyURI(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/PrefixEntry.java b/awsapi/src/com/amazon/s3/PrefixEntry.java index 2c94ddb618e..62107d5c127 100644 --- a/awsapi/src/com/amazon/s3/PrefixEntry.java +++ b/awsapi/src/com/amazon/s3/PrefixEntry.java @@ -1,483 +1,499 @@ - -/** - * PrefixEntry.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * PrefixEntry bean class - */ - - public class PrefixEntry - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = PrefixEntry - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Prefix - */ - - - protected java.lang.String localPrefix ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getPrefix(){ - return localPrefix; - } - - - - /** - * Auto generated setter method - * @param param Prefix - */ - public void setPrefix(java.lang.String param){ - - this.localPrefix=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PrefixEntry.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PrefixEntry", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PrefixEntry", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Prefix", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Prefix"); - } - - } else { - xmlWriter.writeStartElement("Prefix"); - } - - - if (localPrefix==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localPrefix); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Prefix")); - - if (localPrefix != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); - } else { - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PrefixEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PrefixEntry object = - new PrefixEntry(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PrefixEntry".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PrefixEntry)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setPrefix( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * PrefixEntry.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * PrefixEntry bean class + */ + + public class PrefixEntry + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = PrefixEntry + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Prefix + */ + + + protected java.lang.String localPrefix ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getPrefix(){ + return localPrefix; + } + + + + /** + * Auto generated setter method + * @param param Prefix + */ + public void setPrefix(java.lang.String param){ + + this.localPrefix=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PrefixEntry.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PrefixEntry", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PrefixEntry", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Prefix", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Prefix"); + } + + } else { + xmlWriter.writeStartElement("Prefix"); + } + + + if (localPrefix==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localPrefix); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Prefix")); + + if (localPrefix != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); + } else { + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PrefixEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PrefixEntry object = + new PrefixEntry(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PrefixEntry".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PrefixEntry)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setPrefix( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/PutObject.java b/awsapi/src/com/amazon/s3/PutObject.java index 26224af646a..4ba749b75fe 100644 --- a/awsapi/src/com/amazon/s3/PutObject.java +++ b/awsapi/src/com/amazon/s3/PutObject.java @@ -1,1401 +1,1417 @@ - -/** - * PutObject.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * PutObject bean class - */ - - public class PutObject - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "PutObject", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for Metadata - * This was an Array! - */ - - - protected com.amazon.s3.MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.MetadataEntry[] - */ - public com.amazon.s3.MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(com.amazon.s3.MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.MetadataEntry - */ - public void addMetadata(com.amazon.s3.MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new com.amazon.s3.MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (com.amazon.s3.MetadataEntry[])list.toArray( - new com.amazon.s3.MetadataEntry[list.size()]); - - } - - - /** - * field for ContentLength - */ - - - protected long localContentLength ; - - - /** - * Auto generated getter method - * @return long - */ - public long getContentLength(){ - return localContentLength; - } - - - - /** - * Auto generated setter method - * @param param ContentLength - */ - public void setContentLength(long param){ - - this.localContentLength=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected com.amazon.s3.AccessControlList localAccessControlList ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAccessControlListTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.AccessControlList - */ - public com.amazon.s3.AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(com.amazon.s3.AccessControlList param){ - - if (param != null){ - //update the setting tracker - localAccessControlListTracker = true; - } else { - localAccessControlListTracker = false; - - } - - this.localAccessControlList=param; - - - } - - - /** - * field for StorageClass - */ - - - protected com.amazon.s3.StorageClass localStorageClass ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localStorageClassTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.StorageClass - */ - public com.amazon.s3.StorageClass getStorageClass(){ - return localStorageClass; - } - - - - /** - * Auto generated setter method - * @param param StorageClass - */ - public void setStorageClass(com.amazon.s3.StorageClass param){ - - if (param != null){ - //update the setting tracker - localStorageClassTracker = true; - } else { - localStorageClassTracker = false; - - } - - this.localStorageClass=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PutObject.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PutObject", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PutObject", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ContentLength", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ContentLength"); - } - - } else { - xmlWriter.writeStartElement("ContentLength"); - } - - if (localContentLength==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("ContentLength cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); - } - - xmlWriter.writeEndElement(); - if (localAccessControlListTracker){ - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - } if (localStorageClassTracker){ - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), - factory,xmlWriter); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ContentLength")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); - if (localAccessControlListTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - } if (localStorageClassTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass")); - - - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - elementList.add(localStorageClass); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PutObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PutObject object = - new PutObject(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PutObject".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PutObject)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list3 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list3.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone3 = false; - while(!loopDone3){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone3 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list3.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone3 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((com.amazon.s3.MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.MetadataEntry.class, - list3)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ContentLength").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setContentLength( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ - - object.setStorageClass(com.amazon.s3.StorageClass.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * PutObject.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * PutObject bean class + */ + + public class PutObject + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "PutObject", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for Metadata + * This was an Array! + */ + + + protected com.amazon.s3.MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.MetadataEntry[] + */ + public com.amazon.s3.MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(com.amazon.s3.MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.MetadataEntry + */ + public void addMetadata(com.amazon.s3.MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new com.amazon.s3.MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (com.amazon.s3.MetadataEntry[])list.toArray( + new com.amazon.s3.MetadataEntry[list.size()]); + + } + + + /** + * field for ContentLength + */ + + + protected long localContentLength ; + + + /** + * Auto generated getter method + * @return long + */ + public long getContentLength(){ + return localContentLength; + } + + + + /** + * Auto generated setter method + * @param param ContentLength + */ + public void setContentLength(long param){ + + this.localContentLength=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected com.amazon.s3.AccessControlList localAccessControlList ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAccessControlListTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.AccessControlList + */ + public com.amazon.s3.AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(com.amazon.s3.AccessControlList param){ + + if (param != null){ + //update the setting tracker + localAccessControlListTracker = true; + } else { + localAccessControlListTracker = false; + + } + + this.localAccessControlList=param; + + + } + + + /** + * field for StorageClass + */ + + + protected com.amazon.s3.StorageClass localStorageClass ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localStorageClassTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.StorageClass + */ + public com.amazon.s3.StorageClass getStorageClass(){ + return localStorageClass; + } + + + + /** + * Auto generated setter method + * @param param StorageClass + */ + public void setStorageClass(com.amazon.s3.StorageClass param){ + + if (param != null){ + //update the setting tracker + localStorageClassTracker = true; + } else { + localStorageClassTracker = false; + + } + + this.localStorageClass=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PutObject.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PutObject", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PutObject", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ContentLength", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ContentLength"); + } + + } else { + xmlWriter.writeStartElement("ContentLength"); + } + + if (localContentLength==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("ContentLength cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); + } + + xmlWriter.writeEndElement(); + if (localAccessControlListTracker){ + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + } if (localStorageClassTracker){ + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), + factory,xmlWriter); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ContentLength")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); + if (localAccessControlListTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + } if (localStorageClassTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass")); + + + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + elementList.add(localStorageClass); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PutObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PutObject object = + new PutObject(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PutObject".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PutObject)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list3 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list3.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone3 = false; + while(!loopDone3){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone3 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list3.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone3 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((com.amazon.s3.MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.MetadataEntry.class, + list3)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ContentLength").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setContentLength( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ + + object.setStorageClass(com.amazon.s3.StorageClass.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/PutObjectInline.java b/awsapi/src/com/amazon/s3/PutObjectInline.java index 4a9c9068210..e2e240dbeb4 100644 --- a/awsapi/src/com/amazon/s3/PutObjectInline.java +++ b/awsapi/src/com/amazon/s3/PutObjectInline.java @@ -1,1505 +1,1521 @@ - -/** - * PutObjectInline.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * PutObjectInline bean class - */ - - public class PutObjectInline - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "PutObjectInline", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for Metadata - * This was an Array! - */ - - - protected com.amazon.s3.MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.MetadataEntry[] - */ - public com.amazon.s3.MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(com.amazon.s3.MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param com.amazon.s3.MetadataEntry - */ - public void addMetadata(com.amazon.s3.MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new com.amazon.s3.MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (com.amazon.s3.MetadataEntry[])list.toArray( - new com.amazon.s3.MetadataEntry[list.size()]); - - } - - - /** - * field for Data - */ - - - protected javax.activation.DataHandler localData ; - - - /** - * Auto generated getter method - * @return javax.activation.DataHandler - */ - public javax.activation.DataHandler getData(){ - return localData; - } - - - - /** - * Auto generated setter method - * @param param Data - */ - public void setData(javax.activation.DataHandler param){ - - this.localData=param; - - - } - - - /** - * field for ContentLength - */ - - - protected long localContentLength ; - - - /** - * Auto generated getter method - * @return long - */ - public long getContentLength(){ - return localContentLength; - } - - - - /** - * Auto generated setter method - * @param param ContentLength - */ - public void setContentLength(long param){ - - this.localContentLength=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected com.amazon.s3.AccessControlList localAccessControlList ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAccessControlListTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.AccessControlList - */ - public com.amazon.s3.AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(com.amazon.s3.AccessControlList param){ - - if (param != null){ - //update the setting tracker - localAccessControlListTracker = true; - } else { - localAccessControlListTracker = false; - - } - - this.localAccessControlList=param; - - - } - - - /** - * field for StorageClass - */ - - - protected com.amazon.s3.StorageClass localStorageClass ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localStorageClassTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.StorageClass - */ - public com.amazon.s3.StorageClass getStorageClass(){ - return localStorageClass; - } - - - - /** - * Auto generated setter method - * @param param StorageClass - */ - public void setStorageClass(com.amazon.s3.StorageClass param){ - - if (param != null){ - //update the setting tracker - localStorageClassTracker = true; - } else { - localStorageClassTracker = false; - - } - - this.localStorageClass=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PutObjectInline.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PutObjectInline", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PutObjectInline", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Data", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Data"); - } - - } else { - xmlWriter.writeStartElement("Data"); - } - - - if (localData!=null) - { - xmlWriter.writeDataHandler(localData); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ContentLength", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ContentLength"); - } - - } else { - xmlWriter.writeStartElement("ContentLength"); - } - - if (localContentLength==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("ContentLength cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); - } - - xmlWriter.writeEndElement(); - if (localAccessControlListTracker){ - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - } if (localStorageClassTracker){ - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), - factory,xmlWriter); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Data")); - - elementList.add(localData); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ContentLength")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); - if (localAccessControlListTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - } if (localStorageClassTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass")); - - - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - elementList.add(localStorageClass); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PutObjectInline parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PutObjectInline object = - new PutObjectInline(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PutObjectInline".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PutObjectInline)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list3 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list3.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone3 = false; - while(!loopDone3){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone3 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list3.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone3 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((com.amazon.s3.MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - com.amazon.s3.MetadataEntry.class, - list3)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Data").equals(reader.getName())){ - reader.next(); - if (isReaderMTOMAware(reader) - && - java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))) - { - //MTOM aware reader - get the datahandler directly and put it in the object - object.setData( - (javax.activation.DataHandler) reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER)); - } else { - if (reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT && reader.getName().equals(new javax.xml.namespace.QName(org.apache.axiom.om.impl.MTOMConstants.XOP_NAMESPACE_URI, org.apache.axiom.om.impl.MTOMConstants.XOP_INCLUDE))) - { - java.lang.String id = org.apache.axiom.om.util.ElementHelper.getContentID(reader, "UTF-8"); - object.setData(((org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder) ((org.apache.axiom.om.impl.llom.OMStAXWrapper) reader).getBuilder()).getDataHandler(id)); - reader.next(); - - reader.next(); - - } else if(reader.hasText()) { - //Do the usual conversion - java.lang.String content = reader.getText(); - object.setData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBase64Binary(content)); - - reader.next(); - - } - } - - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ContentLength").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setContentLength( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ - - object.setStorageClass(com.amazon.s3.StorageClass.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * PutObjectInline.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * PutObjectInline bean class + */ + + public class PutObjectInline + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "PutObjectInline", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for Metadata + * This was an Array! + */ + + + protected com.amazon.s3.MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.MetadataEntry[] + */ + public com.amazon.s3.MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(com.amazon.s3.MetadataEntry[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(com.amazon.s3.MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param com.amazon.s3.MetadataEntry + */ + public void addMetadata(com.amazon.s3.MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new com.amazon.s3.MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (com.amazon.s3.MetadataEntry[])list.toArray( + new com.amazon.s3.MetadataEntry[list.size()]); + + } + + + /** + * field for Data + */ + + + protected javax.activation.DataHandler localData ; + + + /** + * Auto generated getter method + * @return javax.activation.DataHandler + */ + public javax.activation.DataHandler getData(){ + return localData; + } + + + + /** + * Auto generated setter method + * @param param Data + */ + public void setData(javax.activation.DataHandler param){ + + this.localData=param; + + + } + + + /** + * field for ContentLength + */ + + + protected long localContentLength ; + + + /** + * Auto generated getter method + * @return long + */ + public long getContentLength(){ + return localContentLength; + } + + + + /** + * Auto generated setter method + * @param param ContentLength + */ + public void setContentLength(long param){ + + this.localContentLength=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected com.amazon.s3.AccessControlList localAccessControlList ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAccessControlListTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.AccessControlList + */ + public com.amazon.s3.AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(com.amazon.s3.AccessControlList param){ + + if (param != null){ + //update the setting tracker + localAccessControlListTracker = true; + } else { + localAccessControlListTracker = false; + + } + + this.localAccessControlList=param; + + + } + + + /** + * field for StorageClass + */ + + + protected com.amazon.s3.StorageClass localStorageClass ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localStorageClassTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.StorageClass + */ + public com.amazon.s3.StorageClass getStorageClass(){ + return localStorageClass; + } + + + + /** + * Auto generated setter method + * @param param StorageClass + */ + public void setStorageClass(com.amazon.s3.StorageClass param){ + + if (param != null){ + //update the setting tracker + localStorageClassTracker = true; + } else { + localStorageClassTracker = false; + + } + + this.localStorageClass=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PutObjectInline.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PutObjectInline", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PutObjectInline", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Data", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Data"); + } + + } else { + xmlWriter.writeStartElement("Data"); + } + + + if (localData!=null) + { + xmlWriter.writeDataHandler(localData); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ContentLength", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ContentLength"); + } + + } else { + xmlWriter.writeStartElement("ContentLength"); + } + + if (localContentLength==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("ContentLength cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); + } + + xmlWriter.writeEndElement(); + if (localAccessControlListTracker){ + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + } if (localStorageClassTracker){ + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), + factory,xmlWriter); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Data")); + + elementList.add(localData); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ContentLength")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); + if (localAccessControlListTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + } if (localStorageClassTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass")); + + + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + elementList.add(localStorageClass); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PutObjectInline parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PutObjectInline object = + new PutObjectInline(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PutObjectInline".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PutObjectInline)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list3 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list3.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone3 = false; + while(!loopDone3){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone3 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list3.add(com.amazon.s3.MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone3 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((com.amazon.s3.MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + com.amazon.s3.MetadataEntry.class, + list3)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Data").equals(reader.getName())){ + reader.next(); + if (isReaderMTOMAware(reader) + && + java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))) + { + //MTOM aware reader - get the datahandler directly and put it in the object + object.setData( + (javax.activation.DataHandler) reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER)); + } else { + if (reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT && reader.getName().equals(new javax.xml.namespace.QName(org.apache.axiom.om.impl.MTOMConstants.XOP_NAMESPACE_URI, org.apache.axiom.om.impl.MTOMConstants.XOP_INCLUDE))) + { + java.lang.String id = org.apache.axiom.om.util.ElementHelper.getContentID(reader, "UTF-8"); + object.setData(((org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder) ((org.apache.axiom.om.impl.llom.OMStAXWrapper) reader).getBuilder()).getDataHandler(id)); + reader.next(); + + reader.next(); + + } else if(reader.hasText()) { + //Do the usual conversion + java.lang.String content = reader.getText(); + object.setData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBase64Binary(content)); + + reader.next(); + + } + } + + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ContentLength").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setContentLength( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ + + object.setStorageClass(com.amazon.s3.StorageClass.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/PutObjectInlineResponse.java b/awsapi/src/com/amazon/s3/PutObjectInlineResponse.java index 1aafbacf027..63baf08a1e8 100644 --- a/awsapi/src/com/amazon/s3/PutObjectInlineResponse.java +++ b/awsapi/src/com/amazon/s3/PutObjectInlineResponse.java @@ -1,453 +1,469 @@ - -/** - * PutObjectInlineResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * PutObjectInlineResponse bean class - */ - - public class PutObjectInlineResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "PutObjectInlineResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for PutObjectInlineResponse - */ - - - protected com.amazon.s3.PutObjectResult localPutObjectInlineResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.PutObjectResult - */ - public com.amazon.s3.PutObjectResult getPutObjectInlineResponse(){ - return localPutObjectInlineResponse; - } - - - - /** - * Auto generated setter method - * @param param PutObjectInlineResponse - */ - public void setPutObjectInlineResponse(com.amazon.s3.PutObjectResult param){ - - this.localPutObjectInlineResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PutObjectInlineResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PutObjectInlineResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PutObjectInlineResponse", - xmlWriter); - } - - - } - - if (localPutObjectInlineResponse==null){ - throw new org.apache.axis2.databinding.ADBException("PutObjectInlineResponse cannot be null!!"); - } - localPutObjectInlineResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectInlineResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "PutObjectInlineResponse")); - - - if (localPutObjectInlineResponse==null){ - throw new org.apache.axis2.databinding.ADBException("PutObjectInlineResponse cannot be null!!"); - } - elementList.add(localPutObjectInlineResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PutObjectInlineResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PutObjectInlineResponse object = - new PutObjectInlineResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PutObjectInlineResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PutObjectInlineResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectInlineResponse").equals(reader.getName())){ - - object.setPutObjectInlineResponse(com.amazon.s3.PutObjectResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * PutObjectInlineResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * PutObjectInlineResponse bean class + */ + + public class PutObjectInlineResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "PutObjectInlineResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for PutObjectInlineResponse + */ + + + protected com.amazon.s3.PutObjectResult localPutObjectInlineResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.PutObjectResult + */ + public com.amazon.s3.PutObjectResult getPutObjectInlineResponse(){ + return localPutObjectInlineResponse; + } + + + + /** + * Auto generated setter method + * @param param PutObjectInlineResponse + */ + public void setPutObjectInlineResponse(com.amazon.s3.PutObjectResult param){ + + this.localPutObjectInlineResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PutObjectInlineResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PutObjectInlineResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PutObjectInlineResponse", + xmlWriter); + } + + + } + + if (localPutObjectInlineResponse==null){ + throw new org.apache.axis2.databinding.ADBException("PutObjectInlineResponse cannot be null!!"); + } + localPutObjectInlineResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectInlineResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "PutObjectInlineResponse")); + + + if (localPutObjectInlineResponse==null){ + throw new org.apache.axis2.databinding.ADBException("PutObjectInlineResponse cannot be null!!"); + } + elementList.add(localPutObjectInlineResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PutObjectInlineResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PutObjectInlineResponse object = + new PutObjectInlineResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PutObjectInlineResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PutObjectInlineResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectInlineResponse").equals(reader.getName())){ + + object.setPutObjectInlineResponse(com.amazon.s3.PutObjectResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/PutObjectResponse.java b/awsapi/src/com/amazon/s3/PutObjectResponse.java index 6eb291b8d68..cd7fb213c64 100644 --- a/awsapi/src/com/amazon/s3/PutObjectResponse.java +++ b/awsapi/src/com/amazon/s3/PutObjectResponse.java @@ -1,453 +1,469 @@ - -/** - * PutObjectResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * PutObjectResponse bean class - */ - - public class PutObjectResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "PutObjectResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for PutObjectResponse - */ - - - protected com.amazon.s3.PutObjectResult localPutObjectResponse ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.PutObjectResult - */ - public com.amazon.s3.PutObjectResult getPutObjectResponse(){ - return localPutObjectResponse; - } - - - - /** - * Auto generated setter method - * @param param PutObjectResponse - */ - public void setPutObjectResponse(com.amazon.s3.PutObjectResult param){ - - this.localPutObjectResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PutObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PutObjectResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PutObjectResponse", - xmlWriter); - } - - - } - - if (localPutObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("PutObjectResponse cannot be null!!"); - } - localPutObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "PutObjectResponse")); - - - if (localPutObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("PutObjectResponse cannot be null!!"); - } - elementList.add(localPutObjectResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PutObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PutObjectResponse object = - new PutObjectResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PutObjectResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PutObjectResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectResponse").equals(reader.getName())){ - - object.setPutObjectResponse(com.amazon.s3.PutObjectResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * PutObjectResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * PutObjectResponse bean class + */ + + public class PutObjectResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "PutObjectResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for PutObjectResponse + */ + + + protected com.amazon.s3.PutObjectResult localPutObjectResponse ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.PutObjectResult + */ + public com.amazon.s3.PutObjectResult getPutObjectResponse(){ + return localPutObjectResponse; + } + + + + /** + * Auto generated setter method + * @param param PutObjectResponse + */ + public void setPutObjectResponse(com.amazon.s3.PutObjectResult param){ + + this.localPutObjectResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PutObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PutObjectResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PutObjectResponse", + xmlWriter); + } + + + } + + if (localPutObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("PutObjectResponse cannot be null!!"); + } + localPutObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "PutObjectResponse")); + + + if (localPutObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("PutObjectResponse cannot be null!!"); + } + elementList.add(localPutObjectResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PutObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PutObjectResponse object = + new PutObjectResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PutObjectResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PutObjectResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectResponse").equals(reader.getName())){ + + object.setPutObjectResponse(com.amazon.s3.PutObjectResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/PutObjectResult.java b/awsapi/src/com/amazon/s3/PutObjectResult.java index ea6dc5048bc..e4a3fffd6b0 100644 --- a/awsapi/src/com/amazon/s3/PutObjectResult.java +++ b/awsapi/src/com/amazon/s3/PutObjectResult.java @@ -1,575 +1,591 @@ - -/** - * PutObjectResult.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * PutObjectResult bean class - */ - - public class PutObjectResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = PutObjectResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * field for LastModified - */ - - - protected java.util.Calendar localLastModified ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getLastModified(){ - return localLastModified; - } - - - - /** - * Auto generated setter method - * @param param LastModified - */ - public void setLastModified(java.util.Calendar param){ - - this.localLastModified=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PutObjectResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PutObjectResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PutObjectResult", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"LastModified", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"LastModified"); - } - - } else { - xmlWriter.writeStartElement("LastModified"); - } - - - if (localLastModified==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LastModified")); - - if (localLastModified != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - } else { - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PutObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PutObjectResult object = - new PutObjectResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PutObjectResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PutObjectResult)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLastModified( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * PutObjectResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * PutObjectResult bean class + */ + + public class PutObjectResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = PutObjectResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * field for LastModified + */ + + + protected java.util.Calendar localLastModified ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getLastModified(){ + return localLastModified; + } + + + + /** + * Auto generated setter method + * @param param LastModified + */ + public void setLastModified(java.util.Calendar param){ + + this.localLastModified=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PutObjectResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PutObjectResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PutObjectResult", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"LastModified", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"LastModified"); + } + + } else { + xmlWriter.writeStartElement("LastModified"); + } + + + if (localLastModified==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LastModified")); + + if (localLastModified != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + } else { + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PutObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PutObjectResult object = + new PutObjectResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PutObjectResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PutObjectResult)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLastModified( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/RequestPaymentConfiguration.java b/awsapi/src/com/amazon/s3/RequestPaymentConfiguration.java index 16a13c4bfad..8cc0cb24bfa 100644 --- a/awsapi/src/com/amazon/s3/RequestPaymentConfiguration.java +++ b/awsapi/src/com/amazon/s3/RequestPaymentConfiguration.java @@ -1,452 +1,468 @@ - -/** - * RequestPaymentConfiguration.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * RequestPaymentConfiguration bean class - */ - - public class RequestPaymentConfiguration - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = RequestPaymentConfiguration - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Payer - */ - - - protected com.amazon.s3.Payer localPayer ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.Payer - */ - public com.amazon.s3.Payer getPayer(){ - return localPayer; - } - - - - /** - * Auto generated setter method - * @param param Payer - */ - public void setPayer(com.amazon.s3.Payer param){ - - this.localPayer=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - RequestPaymentConfiguration.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":RequestPaymentConfiguration", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "RequestPaymentConfiguration", - xmlWriter); - } - - - } - - if (localPayer==null){ - throw new org.apache.axis2.databinding.ADBException("Payer cannot be null!!"); - } - localPayer.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Payer"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Payer")); - - - if (localPayer==null){ - throw new org.apache.axis2.databinding.ADBException("Payer cannot be null!!"); - } - elementList.add(localPayer); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static RequestPaymentConfiguration parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - RequestPaymentConfiguration object = - new RequestPaymentConfiguration(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"RequestPaymentConfiguration".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (RequestPaymentConfiguration)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Payer").equals(reader.getName())){ - - object.setPayer(com.amazon.s3.Payer.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * RequestPaymentConfiguration.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * RequestPaymentConfiguration bean class + */ + + public class RequestPaymentConfiguration + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = RequestPaymentConfiguration + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Payer + */ + + + protected com.amazon.s3.Payer localPayer ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.Payer + */ + public com.amazon.s3.Payer getPayer(){ + return localPayer; + } + + + + /** + * Auto generated setter method + * @param param Payer + */ + public void setPayer(com.amazon.s3.Payer param){ + + this.localPayer=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + RequestPaymentConfiguration.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":RequestPaymentConfiguration", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "RequestPaymentConfiguration", + xmlWriter); + } + + + } + + if (localPayer==null){ + throw new org.apache.axis2.databinding.ADBException("Payer cannot be null!!"); + } + localPayer.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Payer"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Payer")); + + + if (localPayer==null){ + throw new org.apache.axis2.databinding.ADBException("Payer cannot be null!!"); + } + elementList.add(localPayer); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static RequestPaymentConfiguration parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + RequestPaymentConfiguration object = + new RequestPaymentConfiguration(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"RequestPaymentConfiguration".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (RequestPaymentConfiguration)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Payer").equals(reader.getName())){ + + object.setPayer(com.amazon.s3.Payer.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/Result.java b/awsapi/src/com/amazon/s3/Result.java index ad1e0ebe630..c827db9f4db 100644 --- a/awsapi/src/com/amazon/s3/Result.java +++ b/awsapi/src/com/amazon/s3/Result.java @@ -1,452 +1,468 @@ - -/** - * Result.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * Result bean class - */ - - public class Result - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = Result - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Status - */ - - - protected com.amazon.s3.Status localStatus ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.Status - */ - public com.amazon.s3.Status getStatus(){ - return localStatus; - } - - - - /** - * Auto generated setter method - * @param param Status - */ - public void setStatus(com.amazon.s3.Status param){ - - this.localStatus=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Result.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Result", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Result", - xmlWriter); - } - - - } - - if (localStatus==null){ - throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); - } - localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Status")); - - - if (localStatus==null){ - throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); - } - elementList.add(localStatus); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Result parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Result object = - new Result(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"Result".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Result)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status").equals(reader.getName())){ - - object.setStatus(com.amazon.s3.Status.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * Result.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * Result bean class + */ + + public class Result + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = Result + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Status + */ + + + protected com.amazon.s3.Status localStatus ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.Status + */ + public com.amazon.s3.Status getStatus(){ + return localStatus; + } + + + + /** + * Auto generated setter method + * @param param Status + */ + public void setStatus(com.amazon.s3.Status param){ + + this.localStatus=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Result.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Result", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Result", + xmlWriter); + } + + + } + + if (localStatus==null){ + throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); + } + localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Status")); + + + if (localStatus==null){ + throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); + } + elementList.add(localStatus); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Result parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Result object = + new Result(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"Result".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (Result)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status").equals(reader.getName())){ + + object.setStatus(com.amazon.s3.Status.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/SetBucketAccessControlPolicy.java b/awsapi/src/com/amazon/s3/SetBucketAccessControlPolicy.java index 0625009e2ed..dcce71c8e16 100644 --- a/awsapi/src/com/amazon/s3/SetBucketAccessControlPolicy.java +++ b/awsapi/src/com/amazon/s3/SetBucketAccessControlPolicy.java @@ -1,978 +1,994 @@ - -/** - * SetBucketAccessControlPolicy.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * SetBucketAccessControlPolicy bean class - */ - - public class SetBucketAccessControlPolicy - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetBucketAccessControlPolicy", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected com.amazon.s3.AccessControlList localAccessControlList ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAccessControlListTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.AccessControlList - */ - public com.amazon.s3.AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(com.amazon.s3.AccessControlList param){ - - if (param != null){ - //update the setting tracker - localAccessControlListTracker = true; - } else { - localAccessControlListTracker = false; - - } - - this.localAccessControlList=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetBucketAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetBucketAccessControlPolicy", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetBucketAccessControlPolicy", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAccessControlListTracker){ - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAccessControlListTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetBucketAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetBucketAccessControlPolicy object = - new SetBucketAccessControlPolicy(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetBucketAccessControlPolicy".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetBucketAccessControlPolicy)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * SetBucketAccessControlPolicy.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * SetBucketAccessControlPolicy bean class + */ + + public class SetBucketAccessControlPolicy + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetBucketAccessControlPolicy", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected com.amazon.s3.AccessControlList localAccessControlList ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAccessControlListTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.AccessControlList + */ + public com.amazon.s3.AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(com.amazon.s3.AccessControlList param){ + + if (param != null){ + //update the setting tracker + localAccessControlListTracker = true; + } else { + localAccessControlListTracker = false; + + } + + this.localAccessControlList=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetBucketAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetBucketAccessControlPolicy", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetBucketAccessControlPolicy", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAccessControlListTracker){ + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAccessControlListTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetBucketAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetBucketAccessControlPolicy object = + new SetBucketAccessControlPolicy(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetBucketAccessControlPolicy".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetBucketAccessControlPolicy)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/SetBucketAccessControlPolicyResponse.java b/awsapi/src/com/amazon/s3/SetBucketAccessControlPolicyResponse.java index c73f3468dfb..8dd9034859d 100644 --- a/awsapi/src/com/amazon/s3/SetBucketAccessControlPolicyResponse.java +++ b/awsapi/src/com/amazon/s3/SetBucketAccessControlPolicyResponse.java @@ -1,392 +1,408 @@ - -/** - * SetBucketAccessControlPolicyResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * SetBucketAccessControlPolicyResponse bean class - */ - - public class SetBucketAccessControlPolicyResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetBucketAccessControlPolicyResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetBucketAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetBucketAccessControlPolicyResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetBucketAccessControlPolicyResponse", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetBucketAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetBucketAccessControlPolicyResponse object = - new SetBucketAccessControlPolicyResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetBucketAccessControlPolicyResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetBucketAccessControlPolicyResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * SetBucketAccessControlPolicyResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * SetBucketAccessControlPolicyResponse bean class + */ + + public class SetBucketAccessControlPolicyResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetBucketAccessControlPolicyResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetBucketAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetBucketAccessControlPolicyResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetBucketAccessControlPolicyResponse", + xmlWriter); + } + + + } + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetBucketAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetBucketAccessControlPolicyResponse object = + new SetBucketAccessControlPolicyResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetBucketAccessControlPolicyResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetBucketAccessControlPolicyResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/SetBucketLoggingStatus.java b/awsapi/src/com/amazon/s3/SetBucketLoggingStatus.java index 0fb07717c5f..5a9cf148273 100644 --- a/awsapi/src/com/amazon/s3/SetBucketLoggingStatus.java +++ b/awsapi/src/com/amazon/s3/SetBucketLoggingStatus.java @@ -1,965 +1,981 @@ - -/** - * SetBucketLoggingStatus.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * SetBucketLoggingStatus bean class - */ - - public class SetBucketLoggingStatus - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetBucketLoggingStatus", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * field for BucketLoggingStatus - */ - - - protected com.amazon.s3.BucketLoggingStatus localBucketLoggingStatus ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.BucketLoggingStatus - */ - public com.amazon.s3.BucketLoggingStatus getBucketLoggingStatus(){ - return localBucketLoggingStatus; - } - - - - /** - * Auto generated setter method - * @param param BucketLoggingStatus - */ - public void setBucketLoggingStatus(com.amazon.s3.BucketLoggingStatus param){ - - this.localBucketLoggingStatus=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetBucketLoggingStatus.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetBucketLoggingStatus", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetBucketLoggingStatus", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - if (localBucketLoggingStatus==null){ - throw new org.apache.axis2.databinding.ADBException("BucketLoggingStatus cannot be null!!"); - } - localBucketLoggingStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketLoggingStatus"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "BucketLoggingStatus")); - - - if (localBucketLoggingStatus==null){ - throw new org.apache.axis2.databinding.ADBException("BucketLoggingStatus cannot be null!!"); - } - elementList.add(localBucketLoggingStatus); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetBucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetBucketLoggingStatus object = - new SetBucketLoggingStatus(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetBucketLoggingStatus".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetBucketLoggingStatus)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketLoggingStatus").equals(reader.getName())){ - - object.setBucketLoggingStatus(com.amazon.s3.BucketLoggingStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * SetBucketLoggingStatus.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * SetBucketLoggingStatus bean class + */ + + public class SetBucketLoggingStatus + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetBucketLoggingStatus", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * field for BucketLoggingStatus + */ + + + protected com.amazon.s3.BucketLoggingStatus localBucketLoggingStatus ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.BucketLoggingStatus + */ + public com.amazon.s3.BucketLoggingStatus getBucketLoggingStatus(){ + return localBucketLoggingStatus; + } + + + + /** + * Auto generated setter method + * @param param BucketLoggingStatus + */ + public void setBucketLoggingStatus(com.amazon.s3.BucketLoggingStatus param){ + + this.localBucketLoggingStatus=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetBucketLoggingStatus.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetBucketLoggingStatus", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetBucketLoggingStatus", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + if (localBucketLoggingStatus==null){ + throw new org.apache.axis2.databinding.ADBException("BucketLoggingStatus cannot be null!!"); + } + localBucketLoggingStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketLoggingStatus"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "BucketLoggingStatus")); + + + if (localBucketLoggingStatus==null){ + throw new org.apache.axis2.databinding.ADBException("BucketLoggingStatus cannot be null!!"); + } + elementList.add(localBucketLoggingStatus); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetBucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetBucketLoggingStatus object = + new SetBucketLoggingStatus(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetBucketLoggingStatus".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetBucketLoggingStatus)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketLoggingStatus").equals(reader.getName())){ + + object.setBucketLoggingStatus(com.amazon.s3.BucketLoggingStatus.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/SetBucketLoggingStatusResponse.java b/awsapi/src/com/amazon/s3/SetBucketLoggingStatusResponse.java index e3c2a755032..fb7f99e32b8 100644 --- a/awsapi/src/com/amazon/s3/SetBucketLoggingStatusResponse.java +++ b/awsapi/src/com/amazon/s3/SetBucketLoggingStatusResponse.java @@ -1,392 +1,408 @@ - -/** - * SetBucketLoggingStatusResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * SetBucketLoggingStatusResponse bean class - */ - - public class SetBucketLoggingStatusResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetBucketLoggingStatusResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetBucketLoggingStatusResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetBucketLoggingStatusResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetBucketLoggingStatusResponse", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetBucketLoggingStatusResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetBucketLoggingStatusResponse object = - new SetBucketLoggingStatusResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetBucketLoggingStatusResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetBucketLoggingStatusResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * SetBucketLoggingStatusResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * SetBucketLoggingStatusResponse bean class + */ + + public class SetBucketLoggingStatusResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetBucketLoggingStatusResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetBucketLoggingStatusResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetBucketLoggingStatusResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetBucketLoggingStatusResponse", + xmlWriter); + } + + + } + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetBucketLoggingStatusResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetBucketLoggingStatusResponse object = + new SetBucketLoggingStatusResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetBucketLoggingStatusResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetBucketLoggingStatusResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/SetObjectAccessControlPolicy.java b/awsapi/src/com/amazon/s3/SetObjectAccessControlPolicy.java index e7e12790e79..3b9842a7479 100644 --- a/awsapi/src/com/amazon/s3/SetObjectAccessControlPolicy.java +++ b/awsapi/src/com/amazon/s3/SetObjectAccessControlPolicy.java @@ -1,1057 +1,1073 @@ - -/** - * SetObjectAccessControlPolicy.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * SetObjectAccessControlPolicy bean class - */ - - public class SetObjectAccessControlPolicy - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetObjectAccessControlPolicy", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected com.amazon.s3.AccessControlList localAccessControlList ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.AccessControlList - */ - public com.amazon.s3.AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(com.amazon.s3.AccessControlList param){ - - this.localAccessControlList=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetObjectAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetObjectAccessControlPolicy", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetObjectAccessControlPolicy", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetObjectAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetObjectAccessControlPolicy object = - new SetObjectAccessControlPolicy(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetObjectAccessControlPolicy".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetObjectAccessControlPolicy)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * SetObjectAccessControlPolicy.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * SetObjectAccessControlPolicy bean class + */ + + public class SetObjectAccessControlPolicy + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetObjectAccessControlPolicy", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected com.amazon.s3.AccessControlList localAccessControlList ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.AccessControlList + */ + public com.amazon.s3.AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(com.amazon.s3.AccessControlList param){ + + this.localAccessControlList=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetObjectAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetObjectAccessControlPolicy", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetObjectAccessControlPolicy", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetObjectAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetObjectAccessControlPolicy object = + new SetObjectAccessControlPolicy(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetObjectAccessControlPolicy".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetObjectAccessControlPolicy)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(com.amazon.s3.AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/SetObjectAccessControlPolicyResponse.java b/awsapi/src/com/amazon/s3/SetObjectAccessControlPolicyResponse.java index 2b662d91f20..e6778c044af 100644 --- a/awsapi/src/com/amazon/s3/SetObjectAccessControlPolicyResponse.java +++ b/awsapi/src/com/amazon/s3/SetObjectAccessControlPolicyResponse.java @@ -1,392 +1,408 @@ - -/** - * SetObjectAccessControlPolicyResponse.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * SetObjectAccessControlPolicyResponse bean class - */ - - public class SetObjectAccessControlPolicyResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetObjectAccessControlPolicyResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetObjectAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetObjectAccessControlPolicyResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetObjectAccessControlPolicyResponse", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetObjectAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetObjectAccessControlPolicyResponse object = - new SetObjectAccessControlPolicyResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetObjectAccessControlPolicyResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetObjectAccessControlPolicyResponse)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * SetObjectAccessControlPolicyResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * SetObjectAccessControlPolicyResponse bean class + */ + + public class SetObjectAccessControlPolicyResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetObjectAccessControlPolicyResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetObjectAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetObjectAccessControlPolicyResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetObjectAccessControlPolicyResponse", + xmlWriter); + } + + + } + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetObjectAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetObjectAccessControlPolicyResponse object = + new SetObjectAccessControlPolicyResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetObjectAccessControlPolicyResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetObjectAccessControlPolicyResponse)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/Status.java b/awsapi/src/com/amazon/s3/Status.java index bccb331ad03..6a578e816b3 100644 --- a/awsapi/src/com/amazon/s3/Status.java +++ b/awsapi/src/com/amazon/s3/Status.java @@ -1,567 +1,583 @@ - -/** - * Status.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * Status bean class - */ - - public class Status - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = Status - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Code - */ - - - protected int localCode ; - - - /** - * Auto generated getter method - * @return int - */ - public int getCode(){ - return localCode; - } - - - - /** - * Auto generated setter method - * @param param Code - */ - public void setCode(int param){ - - this.localCode=param; - - - } - - - /** - * field for Description - */ - - - protected java.lang.String localDescription ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDescription(){ - return localDescription; - } - - - - /** - * Auto generated setter method - * @param param Description - */ - public void setDescription(java.lang.String param){ - - this.localDescription=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Status.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Status", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Status", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Code", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Code"); - } - - } else { - xmlWriter.writeStartElement("Code"); - } - - if (localCode==java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("Code cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCode)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Description", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Description"); - } - - } else { - xmlWriter.writeStartElement("Description"); - } - - - if (localDescription==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Description cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDescription); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Code")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCode)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Description")); - - if (localDescription != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDescription)); - } else { - throw new org.apache.axis2.databinding.ADBException("Description cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Status parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Status object = - new Status(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"Status".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Status)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Code").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCode( - org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Description").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDescription( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * Status.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * Status bean class + */ + + public class Status + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = Status + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Code + */ + + + protected int localCode ; + + + /** + * Auto generated getter method + * @return int + */ + public int getCode(){ + return localCode; + } + + + + /** + * Auto generated setter method + * @param param Code + */ + public void setCode(int param){ + + this.localCode=param; + + + } + + + /** + * field for Description + */ + + + protected java.lang.String localDescription ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDescription(){ + return localDescription; + } + + + + /** + * Auto generated setter method + * @param param Description + */ + public void setDescription(java.lang.String param){ + + this.localDescription=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Status.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Status", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Status", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Code", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Code"); + } + + } else { + xmlWriter.writeStartElement("Code"); + } + + if (localCode==java.lang.Integer.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("Code cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCode)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Description", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Description"); + } + + } else { + xmlWriter.writeStartElement("Description"); + } + + + if (localDescription==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Description cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDescription); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Code")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCode)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Description")); + + if (localDescription != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDescription)); + } else { + throw new org.apache.axis2.databinding.ADBException("Description cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Status parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Status object = + new Status(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"Status".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (Status)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Code").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCode( + org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Description").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDescription( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/StorageClass.java b/awsapi/src/com/amazon/s3/StorageClass.java index 8e8ceebc2dc..25efad56730 100644 --- a/awsapi/src/com/amazon/s3/StorageClass.java +++ b/awsapi/src/com/amazon/s3/StorageClass.java @@ -1,466 +1,482 @@ - -/** - * StorageClass.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * StorageClass bean class - */ - - public class StorageClass - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for StorageClass - */ - - - protected java.lang.String localStorageClass ; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected StorageClass(java.lang.String value, boolean isRegisterValue) { - localStorageClass = value; - if (isRegisterValue){ - - _table_.put(localStorageClass, this); - - } - - } - - public static final java.lang.String _STANDARD = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("STANDARD"); - - public static final java.lang.String _UNKNOWN = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("UNKNOWN"); - - public static final StorageClass STANDARD = - new StorageClass(_STANDARD,true); - - public static final StorageClass UNKNOWN = - new StorageClass(_UNKNOWN,true); - - - public java.lang.String getValue() { return localStorageClass;} - - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { - - return localStorageClass.toString(); - - - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - StorageClass.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - //We can safely assume an element has only one type associated with it - - java.lang.String namespace = parentQName.getNamespaceURI(); - java.lang.String localName = parentQName.getLocalPart(); - - if (! namespace.equals("")) { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix, localName, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace, localName); - } - - } else { - xmlWriter.writeStartElement(localName); - } - - // add the type details if this is used in a simple type - if (serializeType){ - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":StorageClass", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "StorageClass", - xmlWriter); - } - } - - if (localStorageClass==null){ - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); - - }else{ - - xmlWriter.writeCharacters(localStorageClass); - - } - - xmlWriter.writeEndElement(); - - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - - //We can safely assume an element has only one type associated with it - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, - new java.lang.Object[]{ - org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStorageClass) - }, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - public static StorageClass fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - StorageClass enumeration = (StorageClass) - - _table_.get(value); - - - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static StorageClass fromString(java.lang.String value,java.lang.String namespaceURI) - throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } catch (java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static StorageClass fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, - java.lang.String content) { - if (content.indexOf(":") > -1){ - java.lang.String prefix = content.substring(0,content.indexOf(":")); - java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return StorageClass.Factory.fromString(content,namespaceUri); - } else { - return StorageClass.Factory.fromString(content,""); - } - } - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static StorageClass parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - StorageClass object = null; - // initialize a hash map to keep values - java.util.Map attributeMap = new java.util.HashMap(); - java.util.List extraAttributeList = new java.util.ArrayList(); - - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - while(!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()){ - - java.lang.String content = reader.getElementText(); - - if (content.indexOf(":") > 0) { - // this seems to be a Qname so find the namespace and send - prefix = content.substring(0, content.indexOf(":")); - namespaceuri = reader.getNamespaceURI(prefix); - object = StorageClass.Factory.fromString(content,namespaceuri); - } else { - // this seems to be not a qname send and empty namespace incase of it is - // check is done in fromString method - object = StorageClass.Factory.fromString(content,""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * StorageClass.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * StorageClass bean class + */ + + public class StorageClass + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for StorageClass + */ + + + protected java.lang.String localStorageClass ; + + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + + protected StorageClass(java.lang.String value, boolean isRegisterValue) { + localStorageClass = value; + if (isRegisterValue){ + + _table_.put(localStorageClass, this); + + } + + } + + public static final java.lang.String _STANDARD = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("STANDARD"); + + public static final java.lang.String _UNKNOWN = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("UNKNOWN"); + + public static final StorageClass STANDARD = + new StorageClass(_STANDARD,true); + + public static final StorageClass UNKNOWN = + new StorageClass(_UNKNOWN,true); + + + public java.lang.String getValue() { return localStorageClass;} + + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { + + return localStorageClass.toString(); + + + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + StorageClass.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + //We can safely assume an element has only one type associated with it + + java.lang.String namespace = parentQName.getNamespaceURI(); + java.lang.String localName = parentQName.getLocalPart(); + + if (! namespace.equals("")) { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix, localName, namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace, localName); + } + + } else { + xmlWriter.writeStartElement(localName); + } + + // add the type details if this is used in a simple type + if (serializeType){ + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":StorageClass", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "StorageClass", + xmlWriter); + } + } + + if (localStorageClass==null){ + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); + + }else{ + + xmlWriter.writeCharacters(localStorageClass); + + } + + xmlWriter.writeEndElement(); + + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + + //We can safely assume an element has only one type associated with it + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, + new java.lang.Object[]{ + org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStorageClass) + }, + null); + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + public static StorageClass fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + StorageClass enumeration = (StorageClass) + + _table_.get(value); + + + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static StorageClass fromString(java.lang.String value,java.lang.String namespaceURI) + throws java.lang.IllegalArgumentException { + try { + + return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); + + + } catch (java.lang.Exception e) { + throw new java.lang.IllegalArgumentException(); + } + } + + public static StorageClass fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, + java.lang.String content) { + if (content.indexOf(":") > -1){ + java.lang.String prefix = content.substring(0,content.indexOf(":")); + java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); + return StorageClass.Factory.fromString(content,namespaceUri); + } else { + return StorageClass.Factory.fromString(content,""); + } + } + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static StorageClass parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + StorageClass object = null; + // initialize a hash map to keep values + java.util.Map attributeMap = new java.util.HashMap(); + java.util.List extraAttributeList = new java.util.ArrayList(); + + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + while(!reader.isEndElement()) { + if (reader.isStartElement() || reader.hasText()){ + + java.lang.String content = reader.getElementText(); + + if (content.indexOf(":") > 0) { + // this seems to be a Qname so find the namespace and send + prefix = content.substring(0, content.indexOf(":")); + namespaceuri = reader.getNamespaceURI(prefix); + object = StorageClass.Factory.fromString(content,namespaceuri); + } else { + // this seems to be not a qname send and empty namespace incase of it is + // check is done in fromString method + object = StorageClass.Factory.fromString(content,""); + } + + + } else { + reader.next(); + } + } // end of while loop + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/TopicConfiguration.java b/awsapi/src/com/amazon/s3/TopicConfiguration.java index 4969f6d4276..b4ed85de318 100644 --- a/awsapi/src/com/amazon/s3/TopicConfiguration.java +++ b/awsapi/src/com/amazon/s3/TopicConfiguration.java @@ -1,666 +1,682 @@ - -/** - * TopicConfiguration.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * TopicConfiguration bean class - */ - - public class TopicConfiguration - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = TopicConfiguration - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Topic - */ - - - protected java.lang.String localTopic ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getTopic(){ - return localTopic; - } - - - - /** - * Auto generated setter method - * @param param Topic - */ - public void setTopic(java.lang.String param){ - - this.localTopic=param; - - - } - - - /** - * field for Event - * This was an Array! - */ - - - protected java.lang.String[] localEvent ; - - - /** - * Auto generated getter method - * @return java.lang.String[] - */ - public java.lang.String[] getEvent(){ - return localEvent; - } - - - - - - - /** - * validate the array for Event - */ - protected void validateEvent(java.lang.String[] param){ - - if ((param != null) && (param.length < 1)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param Event - */ - public void setEvent(java.lang.String[] param){ - - validateEvent(param); - - - this.localEvent=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param java.lang.String - */ - public void addEvent(java.lang.String param){ - if (localEvent == null){ - localEvent = new java.lang.String[]{}; - } - - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localEvent); - list.add(param); - this.localEvent = - (java.lang.String[])list.toArray( - new java.lang.String[list.size()]); - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - TopicConfiguration.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":TopicConfiguration", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "TopicConfiguration", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Topic", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Topic"); - } - - } else { - xmlWriter.writeStartElement("Topic"); - } - - - if (localTopic==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Topic cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localTopic); - - } - - xmlWriter.writeEndElement(); - - if (localEvent!=null) { - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - boolean emptyNamespace = namespace == null || namespace.length() == 0; - prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); - for (int i = 0;i < localEvent.length;i++){ - - if (localEvent[i] != null){ - - if (!emptyNamespace) { - if (prefix == null) { - java.lang.String prefix2 = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix2,"Event", namespace); - xmlWriter.writeNamespace(prefix2, namespace); - xmlWriter.setPrefix(prefix2, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Event"); - } - - } else { - xmlWriter.writeStartElement("Event"); - } - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEvent[i])); - - xmlWriter.writeEndElement(); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Event cannot be null!!"); - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Event cannot be null!!"); - - } - - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Topic")); - - if (localTopic != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTopic)); - } else { - throw new org.apache.axis2.databinding.ADBException("Topic cannot be null!!"); - } - - if (localEvent!=null){ - for (int i = 0;i < localEvent.length;i++){ - - if (localEvent[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Event")); - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEvent[i])); - } else { - - throw new org.apache.axis2.databinding.ADBException("Event cannot be null!!"); - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Event cannot be null!!"); - - } - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static TopicConfiguration parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - TopicConfiguration object = - new TopicConfiguration(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"TopicConfiguration".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (TopicConfiguration)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list2 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Topic").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTopic( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Event").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list2.add(reader.getElementText()); - - //loop until we find a start element that is not part of this array - boolean loopDone2 = false; - while(!loopDone2){ - // Ensure we are at the EndElement - while (!reader.isEndElement()){ - reader.next(); - } - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone2 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Event").equals(reader.getName())){ - list2.add(reader.getElementText()); - - }else{ - loopDone2 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setEvent((java.lang.String[]) - list2.toArray(new java.lang.String[list2.size()])); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * TopicConfiguration.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * TopicConfiguration bean class + */ + + public class TopicConfiguration + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = TopicConfiguration + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Topic + */ + + + protected java.lang.String localTopic ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getTopic(){ + return localTopic; + } + + + + /** + * Auto generated setter method + * @param param Topic + */ + public void setTopic(java.lang.String param){ + + this.localTopic=param; + + + } + + + /** + * field for Event + * This was an Array! + */ + + + protected java.lang.String[] localEvent ; + + + /** + * Auto generated getter method + * @return java.lang.String[] + */ + public java.lang.String[] getEvent(){ + return localEvent; + } + + + + + + + /** + * validate the array for Event + */ + protected void validateEvent(java.lang.String[] param){ + + if ((param != null) && (param.length < 1)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param Event + */ + public void setEvent(java.lang.String[] param){ + + validateEvent(param); + + + this.localEvent=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param java.lang.String + */ + public void addEvent(java.lang.String param){ + if (localEvent == null){ + localEvent = new java.lang.String[]{}; + } + + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localEvent); + list.add(param); + this.localEvent = + (java.lang.String[])list.toArray( + new java.lang.String[list.size()]); + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + TopicConfiguration.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":TopicConfiguration", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "TopicConfiguration", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Topic", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Topic"); + } + + } else { + xmlWriter.writeStartElement("Topic"); + } + + + if (localTopic==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Topic cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localTopic); + + } + + xmlWriter.writeEndElement(); + + if (localEvent!=null) { + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + boolean emptyNamespace = namespace == null || namespace.length() == 0; + prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); + for (int i = 0;i < localEvent.length;i++){ + + if (localEvent[i] != null){ + + if (!emptyNamespace) { + if (prefix == null) { + java.lang.String prefix2 = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix2,"Event", namespace); + xmlWriter.writeNamespace(prefix2, namespace); + xmlWriter.setPrefix(prefix2, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Event"); + } + + } else { + xmlWriter.writeStartElement("Event"); + } + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEvent[i])); + + xmlWriter.writeEndElement(); + + } else { + + throw new org.apache.axis2.databinding.ADBException("Event cannot be null!!"); + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Event cannot be null!!"); + + } + + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Topic")); + + if (localTopic != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTopic)); + } else { + throw new org.apache.axis2.databinding.ADBException("Topic cannot be null!!"); + } + + if (localEvent!=null){ + for (int i = 0;i < localEvent.length;i++){ + + if (localEvent[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Event")); + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEvent[i])); + } else { + + throw new org.apache.axis2.databinding.ADBException("Event cannot be null!!"); + + } + + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Event cannot be null!!"); + + } + + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static TopicConfiguration parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + TopicConfiguration object = + new TopicConfiguration(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"TopicConfiguration".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (TopicConfiguration)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list2 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Topic").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTopic( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Event").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list2.add(reader.getElementText()); + + //loop until we find a start element that is not part of this array + boolean loopDone2 = false; + while(!loopDone2){ + // Ensure we are at the EndElement + while (!reader.isEndElement()){ + reader.next(); + } + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone2 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Event").equals(reader.getName())){ + list2.add(reader.getElementText()); + + }else{ + loopDone2 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setEvent((java.lang.String[]) + list2.toArray(new java.lang.String[list2.size()])); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/User.java b/awsapi/src/com/amazon/s3/User.java index 3fbbc762fbe..daeab872fbb 100644 --- a/awsapi/src/com/amazon/s3/User.java +++ b/awsapi/src/com/amazon/s3/User.java @@ -1,385 +1,401 @@ - -/** - * User.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * User bean class - */ - - public abstract class User extends com.amazon.s3.Grantee - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = User - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - User.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":User", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "User", - xmlWriter); - } - - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); - attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","User")); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static User parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - User object = - null; - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"User".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (User)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - throw new org.apache.axis2.databinding.ADBException("The an abstract class can not be instantiated !!!"); - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * User.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * User bean class + */ + + public abstract class User extends com.amazon.s3.Grantee + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = User + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + User.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":User", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "User", + xmlWriter); + } + + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); + attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","User")); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static User parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + User object = + null; + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"User".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (User)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + throw new org.apache.axis2.databinding.ADBException("The an abstract class can not be instantiated !!!"); + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/VersionEntry.java b/awsapi/src/com/amazon/s3/VersionEntry.java index d49bf45f385..f328efb0c3d 100644 --- a/awsapi/src/com/amazon/s3/VersionEntry.java +++ b/awsapi/src/com/amazon/s3/VersionEntry.java @@ -1,1062 +1,1078 @@ - -/** - * VersionEntry.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * VersionEntry bean class - */ - - public class VersionEntry - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = VersionEntry - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for VersionId - */ - - - protected java.lang.String localVersionId ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getVersionId(){ - return localVersionId; - } - - - - /** - * Auto generated setter method - * @param param VersionId - */ - public void setVersionId(java.lang.String param){ - - this.localVersionId=param; - - - } - - - /** - * field for IsLatest - */ - - - protected boolean localIsLatest ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getIsLatest(){ - return localIsLatest; - } - - - - /** - * Auto generated setter method - * @param param IsLatest - */ - public void setIsLatest(boolean param){ - - this.localIsLatest=param; - - - } - - - /** - * field for LastModified - */ - - - protected java.util.Calendar localLastModified ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getLastModified(){ - return localLastModified; - } - - - - /** - * Auto generated setter method - * @param param LastModified - */ - public void setLastModified(java.util.Calendar param){ - - this.localLastModified=param; - - - } - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * field for Size - */ - - - protected long localSize ; - - - /** - * Auto generated getter method - * @return long - */ - public long getSize(){ - return localSize; - } - - - - /** - * Auto generated setter method - * @param param Size - */ - public void setSize(long param){ - - this.localSize=param; - - - } - - - /** - * field for Owner - */ - - - protected com.amazon.s3.CanonicalUser localOwner ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localOwnerTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.CanonicalUser - */ - public com.amazon.s3.CanonicalUser getOwner(){ - return localOwner; - } - - - - /** - * Auto generated setter method - * @param param Owner - */ - public void setOwner(com.amazon.s3.CanonicalUser param){ - - if (param != null){ - //update the setting tracker - localOwnerTracker = true; - } else { - localOwnerTracker = false; - - } - - this.localOwner=param; - - - } - - - /** - * field for StorageClass - */ - - - protected com.amazon.s3.StorageClass localStorageClass ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.StorageClass - */ - public com.amazon.s3.StorageClass getStorageClass(){ - return localStorageClass; - } - - - - /** - * Auto generated setter method - * @param param StorageClass - */ - public void setStorageClass(com.amazon.s3.StorageClass param){ - - this.localStorageClass=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - VersionEntry.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":VersionEntry", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "VersionEntry", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"VersionId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"VersionId"); - } - - } else { - xmlWriter.writeStartElement("VersionId"); - } - - - if (localVersionId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("VersionId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localVersionId); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"IsLatest", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IsLatest"); - } - - } else { - xmlWriter.writeStartElement("IsLatest"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("IsLatest cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsLatest)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"LastModified", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"LastModified"); - } - - } else { - xmlWriter.writeStartElement("LastModified"); - } - - - if (localLastModified==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Size", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Size"); - } - - } else { - xmlWriter.writeStartElement("Size"); - } - - if (localSize==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("Size cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); - } - - xmlWriter.writeEndElement(); - if (localOwnerTracker){ - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), - factory,xmlWriter); - } - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "VersionId")); - - if (localVersionId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localVersionId)); - } else { - throw new org.apache.axis2.databinding.ADBException("VersionId cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IsLatest")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsLatest)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LastModified")); - - if (localLastModified != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - } else { - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Size")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); - if (localOwnerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Owner")); - - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - elementList.add(localOwner); - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass")); - - - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - elementList.add(localStorageClass); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static VersionEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - VersionEntry object = - new VersionEntry(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"VersionEntry".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (VersionEntry)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","VersionId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setVersionId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IsLatest").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setIsLatest( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLastModified( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Size").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSize( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ - - object.setOwner(com.amazon.s3.CanonicalUser.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ - - object.setStorageClass(com.amazon.s3.StorageClass.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * VersionEntry.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * VersionEntry bean class + */ + + public class VersionEntry + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = VersionEntry + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for VersionId + */ + + + protected java.lang.String localVersionId ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getVersionId(){ + return localVersionId; + } + + + + /** + * Auto generated setter method + * @param param VersionId + */ + public void setVersionId(java.lang.String param){ + + this.localVersionId=param; + + + } + + + /** + * field for IsLatest + */ + + + protected boolean localIsLatest ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getIsLatest(){ + return localIsLatest; + } + + + + /** + * Auto generated setter method + * @param param IsLatest + */ + public void setIsLatest(boolean param){ + + this.localIsLatest=param; + + + } + + + /** + * field for LastModified + */ + + + protected java.util.Calendar localLastModified ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getLastModified(){ + return localLastModified; + } + + + + /** + * Auto generated setter method + * @param param LastModified + */ + public void setLastModified(java.util.Calendar param){ + + this.localLastModified=param; + + + } + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * field for Size + */ + + + protected long localSize ; + + + /** + * Auto generated getter method + * @return long + */ + public long getSize(){ + return localSize; + } + + + + /** + * Auto generated setter method + * @param param Size + */ + public void setSize(long param){ + + this.localSize=param; + + + } + + + /** + * field for Owner + */ + + + protected com.amazon.s3.CanonicalUser localOwner ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localOwnerTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.CanonicalUser + */ + public com.amazon.s3.CanonicalUser getOwner(){ + return localOwner; + } + + + + /** + * Auto generated setter method + * @param param Owner + */ + public void setOwner(com.amazon.s3.CanonicalUser param){ + + if (param != null){ + //update the setting tracker + localOwnerTracker = true; + } else { + localOwnerTracker = false; + + } + + this.localOwner=param; + + + } + + + /** + * field for StorageClass + */ + + + protected com.amazon.s3.StorageClass localStorageClass ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.StorageClass + */ + public com.amazon.s3.StorageClass getStorageClass(){ + return localStorageClass; + } + + + + /** + * Auto generated setter method + * @param param StorageClass + */ + public void setStorageClass(com.amazon.s3.StorageClass param){ + + this.localStorageClass=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + VersionEntry.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":VersionEntry", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "VersionEntry", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"VersionId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"VersionId"); + } + + } else { + xmlWriter.writeStartElement("VersionId"); + } + + + if (localVersionId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("VersionId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localVersionId); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"IsLatest", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IsLatest"); + } + + } else { + xmlWriter.writeStartElement("IsLatest"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("IsLatest cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsLatest)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"LastModified", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"LastModified"); + } + + } else { + xmlWriter.writeStartElement("LastModified"); + } + + + if (localLastModified==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Size", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Size"); + } + + } else { + xmlWriter.writeStartElement("Size"); + } + + if (localSize==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("Size cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); + } + + xmlWriter.writeEndElement(); + if (localOwnerTracker){ + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), + factory,xmlWriter); + } + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "VersionId")); + + if (localVersionId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localVersionId)); + } else { + throw new org.apache.axis2.databinding.ADBException("VersionId cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IsLatest")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsLatest)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LastModified")); + + if (localLastModified != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + } else { + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Size")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); + if (localOwnerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Owner")); + + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + elementList.add(localOwner); + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass")); + + + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + elementList.add(localStorageClass); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static VersionEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + VersionEntry object = + new VersionEntry(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"VersionEntry".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (VersionEntry)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","VersionId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setVersionId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IsLatest").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setIsLatest( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLastModified( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Size").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSize( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ + + object.setOwner(com.amazon.s3.CanonicalUser.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ + + object.setStorageClass(com.amazon.s3.StorageClass.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/VersioningConfiguration.java b/awsapi/src/com/amazon/s3/VersioningConfiguration.java index 472faede6b0..62a61e2501f 100644 --- a/awsapi/src/com/amazon/s3/VersioningConfiguration.java +++ b/awsapi/src/com/amazon/s3/VersioningConfiguration.java @@ -1,539 +1,555 @@ - -/** - * VersioningConfiguration.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * VersioningConfiguration bean class - */ - - public class VersioningConfiguration - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = VersioningConfiguration - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Status - */ - - - protected com.amazon.s3.VersioningStatus localStatus ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localStatusTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.VersioningStatus - */ - public com.amazon.s3.VersioningStatus getStatus(){ - return localStatus; - } - - - - /** - * Auto generated setter method - * @param param Status - */ - public void setStatus(com.amazon.s3.VersioningStatus param){ - - if (param != null){ - //update the setting tracker - localStatusTracker = true; - } else { - localStatusTracker = false; - - } - - this.localStatus=param; - - - } - - - /** - * field for MfaDelete - */ - - - protected com.amazon.s3.MfaDeleteStatus localMfaDelete ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMfaDeleteTracker = false ; - - - /** - * Auto generated getter method - * @return com.amazon.s3.MfaDeleteStatus - */ - public com.amazon.s3.MfaDeleteStatus getMfaDelete(){ - return localMfaDelete; - } - - - - /** - * Auto generated setter method - * @param param MfaDelete - */ - public void setMfaDelete(com.amazon.s3.MfaDeleteStatus param){ - - if (param != null){ - //update the setting tracker - localMfaDeleteTracker = true; - } else { - localMfaDeleteTracker = false; - - } - - this.localMfaDelete=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - VersioningConfiguration.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":VersioningConfiguration", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "VersioningConfiguration", - xmlWriter); - } - - - } - if (localStatusTracker){ - if (localStatus==null){ - throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); - } - localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status"), - factory,xmlWriter); - } if (localMfaDeleteTracker){ - if (localMfaDelete==null){ - throw new org.apache.axis2.databinding.ADBException("MfaDelete cannot be null!!"); - } - localMfaDelete.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MfaDelete"), - factory,xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localStatusTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Status")); - - - if (localStatus==null){ - throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); - } - elementList.add(localStatus); - } if (localMfaDeleteTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "MfaDelete")); - - - if (localMfaDelete==null){ - throw new org.apache.axis2.databinding.ADBException("MfaDelete cannot be null!!"); - } - elementList.add(localMfaDelete); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static VersioningConfiguration parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - VersioningConfiguration object = - new VersioningConfiguration(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"VersioningConfiguration".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (VersioningConfiguration)com.amazon.s3.ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status").equals(reader.getName())){ - - object.setStatus(com.amazon.s3.VersioningStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MfaDelete").equals(reader.getName())){ - - object.setMfaDelete(com.amazon.s3.MfaDeleteStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * VersioningConfiguration.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * VersioningConfiguration bean class + */ + + public class VersioningConfiguration + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = VersioningConfiguration + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Status + */ + + + protected com.amazon.s3.VersioningStatus localStatus ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localStatusTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.VersioningStatus + */ + public com.amazon.s3.VersioningStatus getStatus(){ + return localStatus; + } + + + + /** + * Auto generated setter method + * @param param Status + */ + public void setStatus(com.amazon.s3.VersioningStatus param){ + + if (param != null){ + //update the setting tracker + localStatusTracker = true; + } else { + localStatusTracker = false; + + } + + this.localStatus=param; + + + } + + + /** + * field for MfaDelete + */ + + + protected com.amazon.s3.MfaDeleteStatus localMfaDelete ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMfaDeleteTracker = false ; + + + /** + * Auto generated getter method + * @return com.amazon.s3.MfaDeleteStatus + */ + public com.amazon.s3.MfaDeleteStatus getMfaDelete(){ + return localMfaDelete; + } + + + + /** + * Auto generated setter method + * @param param MfaDelete + */ + public void setMfaDelete(com.amazon.s3.MfaDeleteStatus param){ + + if (param != null){ + //update the setting tracker + localMfaDeleteTracker = true; + } else { + localMfaDeleteTracker = false; + + } + + this.localMfaDelete=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + VersioningConfiguration.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":VersioningConfiguration", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "VersioningConfiguration", + xmlWriter); + } + + + } + if (localStatusTracker){ + if (localStatus==null){ + throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); + } + localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status"), + factory,xmlWriter); + } if (localMfaDeleteTracker){ + if (localMfaDelete==null){ + throw new org.apache.axis2.databinding.ADBException("MfaDelete cannot be null!!"); + } + localMfaDelete.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MfaDelete"), + factory,xmlWriter); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localStatusTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Status")); + + + if (localStatus==null){ + throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); + } + elementList.add(localStatus); + } if (localMfaDeleteTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "MfaDelete")); + + + if (localMfaDelete==null){ + throw new org.apache.axis2.databinding.ADBException("MfaDelete cannot be null!!"); + } + elementList.add(localMfaDelete); + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static VersioningConfiguration parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + VersioningConfiguration object = + new VersioningConfiguration(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"VersioningConfiguration".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (VersioningConfiguration)com.amazon.s3.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status").equals(reader.getName())){ + + object.setStatus(com.amazon.s3.VersioningStatus.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MfaDelete").equals(reader.getName())){ + + object.setMfaDelete(com.amazon.s3.MfaDeleteStatus.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/VersioningStatus.java b/awsapi/src/com/amazon/s3/VersioningStatus.java index eda667a9399..6840ab29fe4 100644 --- a/awsapi/src/com/amazon/s3/VersioningStatus.java +++ b/awsapi/src/com/amazon/s3/VersioningStatus.java @@ -1,466 +1,482 @@ - -/** - * VersioningStatus.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) - */ - - package com.amazon.s3; - - - /** - * VersioningStatus bean class - */ - - public class VersioningStatus - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "VersioningStatus", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for VersioningStatus - */ - - - protected java.lang.String localVersioningStatus ; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected VersioningStatus(java.lang.String value, boolean isRegisterValue) { - localVersioningStatus = value; - if (isRegisterValue){ - - _table_.put(localVersioningStatus, this); - - } - - } - - public static final java.lang.String _Enabled = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("Enabled"); - - public static final java.lang.String _Suspended = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("Suspended"); - - public static final VersioningStatus Enabled = - new VersioningStatus(_Enabled,true); - - public static final VersioningStatus Suspended = - new VersioningStatus(_Suspended,true); - - - public java.lang.String getValue() { return localVersioningStatus;} - - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { - - return localVersioningStatus.toString(); - - - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - VersioningStatus.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - //We can safely assume an element has only one type associated with it - - java.lang.String namespace = parentQName.getNamespaceURI(); - java.lang.String localName = parentQName.getLocalPart(); - - if (! namespace.equals("")) { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix, localName, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace, localName); - } - - } else { - xmlWriter.writeStartElement(localName); - } - - // add the type details if this is used in a simple type - if (serializeType){ - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":VersioningStatus", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "VersioningStatus", - xmlWriter); - } - } - - if (localVersioningStatus==null){ - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); - - }else{ - - xmlWriter.writeCharacters(localVersioningStatus); - - } - - xmlWriter.writeEndElement(); - - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - - //We can safely assume an element has only one type associated with it - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, - new java.lang.Object[]{ - org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localVersioningStatus) - }, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - public static VersioningStatus fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - VersioningStatus enumeration = (VersioningStatus) - - _table_.get(value); - - - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static VersioningStatus fromString(java.lang.String value,java.lang.String namespaceURI) - throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } catch (java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static VersioningStatus fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, - java.lang.String content) { - if (content.indexOf(":") > -1){ - java.lang.String prefix = content.substring(0,content.indexOf(":")); - java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return VersioningStatus.Factory.fromString(content,namespaceUri); - } else { - return VersioningStatus.Factory.fromString(content,""); - } - } - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static VersioningStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - VersioningStatus object = null; - // initialize a hash map to keep values - java.util.Map attributeMap = new java.util.HashMap(); - java.util.List extraAttributeList = new java.util.ArrayList(); - - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - while(!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()){ - - java.lang.String content = reader.getElementText(); - - if (content.indexOf(":") > 0) { - // this seems to be a Qname so find the namespace and send - prefix = content.substring(0, content.indexOf(":")); - namespaceuri = reader.getNamespaceURI(prefix); - object = VersioningStatus.Factory.fromString(content,namespaceuri); - } else { - // this seems to be not a qname send and empty namespace incase of it is - // check is done in fromString method - object = VersioningStatus.Factory.fromString(content,""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * VersioningStatus.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.amazon.s3; + + + /** + * VersioningStatus bean class + */ + + public class VersioningStatus + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "VersioningStatus", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for VersioningStatus + */ + + + protected java.lang.String localVersioningStatus ; + + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + + protected VersioningStatus(java.lang.String value, boolean isRegisterValue) { + localVersioningStatus = value; + if (isRegisterValue){ + + _table_.put(localVersioningStatus, this); + + } + + } + + public static final java.lang.String _Enabled = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("Enabled"); + + public static final java.lang.String _Suspended = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("Suspended"); + + public static final VersioningStatus Enabled = + new VersioningStatus(_Enabled,true); + + public static final VersioningStatus Suspended = + new VersioningStatus(_Suspended,true); + + + public java.lang.String getValue() { return localVersioningStatus;} + + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { + + return localVersioningStatus.toString(); + + + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + VersioningStatus.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + //We can safely assume an element has only one type associated with it + + java.lang.String namespace = parentQName.getNamespaceURI(); + java.lang.String localName = parentQName.getLocalPart(); + + if (! namespace.equals("")) { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix, localName, namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace, localName); + } + + } else { + xmlWriter.writeStartElement(localName); + } + + // add the type details if this is used in a simple type + if (serializeType){ + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":VersioningStatus", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "VersioningStatus", + xmlWriter); + } + } + + if (localVersioningStatus==null){ + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); + + }else{ + + xmlWriter.writeCharacters(localVersioningStatus); + + } + + xmlWriter.writeEndElement(); + + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + + //We can safely assume an element has only one type associated with it + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, + new java.lang.Object[]{ + org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localVersioningStatus) + }, + null); + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + public static VersioningStatus fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + VersioningStatus enumeration = (VersioningStatus) + + _table_.get(value); + + + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static VersioningStatus fromString(java.lang.String value,java.lang.String namespaceURI) + throws java.lang.IllegalArgumentException { + try { + + return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); + + + } catch (java.lang.Exception e) { + throw new java.lang.IllegalArgumentException(); + } + } + + public static VersioningStatus fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, + java.lang.String content) { + if (content.indexOf(":") > -1){ + java.lang.String prefix = content.substring(0,content.indexOf(":")); + java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); + return VersioningStatus.Factory.fromString(content,namespaceUri); + } else { + return VersioningStatus.Factory.fromString(content,""); + } + } + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static VersioningStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + VersioningStatus object = null; + // initialize a hash map to keep values + java.util.Map attributeMap = new java.util.HashMap(); + java.util.List extraAttributeList = new java.util.ArrayList(); + + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + while(!reader.isEndElement()) { + if (reader.isStartElement() || reader.hasText()){ + + java.lang.String content = reader.getElementText(); + + if (content.indexOf(":") > 0) { + // this seems to be a Qname so find the namespace and send + prefix = content.substring(0, content.indexOf(":")); + namespaceuri = reader.getNamespaceURI(prefix); + object = VersioningStatus.Factory.fromString(content,namespaceuri); + } else { + // this seems to be not a qname send and empty namespace incase of it is + // check is done in fromString method + object = VersioningStatus.Factory.fromString(content,""); + } + + + } else { + reader.next(); + } + } // end of while loop + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/client/AmazonS3CallbackHandler.java b/awsapi/src/com/amazon/s3/client/AmazonS3CallbackHandler.java index 8137a724627..b1385e2aaaa 100644 --- a/awsapi/src/com/amazon/s3/client/AmazonS3CallbackHandler.java +++ b/awsapi/src/com/amazon/s3/client/AmazonS3CallbackHandler.java @@ -1,306 +1,322 @@ - -/** - * AmazonS3CallbackHandler.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) - */ - - package com.amazon.s3.client; - - /** - * AmazonS3CallbackHandler Callback class, Users can extend this class and implement - * their own receiveResult and receiveError methods. - */ - public abstract class AmazonS3CallbackHandler{ - - - - protected Object clientData; - - /** - * User can pass in any object that needs to be accessed once the NonBlocking - * Web service call is finished and appropriate method of this CallBack is called. - * @param clientData Object mechanism by which the user can pass in user data - * that will be avilable at the time this callback is called. - */ - public AmazonS3CallbackHandler(Object clientData){ - this.clientData = clientData; - } - - /** - * Please use this constructor if you don't want to set any clientData - */ - public AmazonS3CallbackHandler(){ - this.clientData = null; - } - - /** - * Get the client data - */ - - public Object getClientData() { - return clientData; - } - - - /** - * auto generated Axis2 call back method for getBucketLoggingStatus method - * override this method for handling normal response from getBucketLoggingStatus operation - */ - public void receiveResultgetBucketLoggingStatus( - com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from getBucketLoggingStatus operation - */ - public void receiveErrorgetBucketLoggingStatus(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for copyObject method - * override this method for handling normal response from copyObject operation - */ - public void receiveResultcopyObject( - com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from copyObject operation - */ - public void receiveErrorcopyObject(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for getBucketAccessControlPolicy method - * override this method for handling normal response from getBucketAccessControlPolicy operation - */ - public void receiveResultgetBucketAccessControlPolicy( - com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from getBucketAccessControlPolicy operation - */ - public void receiveErrorgetBucketAccessControlPolicy(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for listBucket method - * override this method for handling normal response from listBucket operation - */ - public void receiveResultlistBucket( - com.amazon.s3.client.AmazonS3Stub.ListBucketResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from listBucket operation - */ - public void receiveErrorlistBucket(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for putObject method - * override this method for handling normal response from putObject operation - */ - public void receiveResultputObject( - com.amazon.s3.client.AmazonS3Stub.PutObjectResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from putObject operation - */ - public void receiveErrorputObject(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for createBucket method - * override this method for handling normal response from createBucket operation - */ - public void receiveResultcreateBucket( - com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from createBucket operation - */ - public void receiveErrorcreateBucket(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for listAllMyBuckets method - * override this method for handling normal response from listAllMyBuckets operation - */ - public void receiveResultlistAllMyBuckets( - com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from listAllMyBuckets operation - */ - public void receiveErrorlistAllMyBuckets(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for getObject method - * override this method for handling normal response from getObject operation - */ - public void receiveResultgetObject( - com.amazon.s3.client.AmazonS3Stub.GetObjectResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from getObject operation - */ - public void receiveErrorgetObject(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for deleteBucket method - * override this method for handling normal response from deleteBucket operation - */ - public void receiveResultdeleteBucket( - com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from deleteBucket operation - */ - public void receiveErrordeleteBucket(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for setBucketLoggingStatus method - * override this method for handling normal response from setBucketLoggingStatus operation - */ - public void receiveResultsetBucketLoggingStatus( - com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from setBucketLoggingStatus operation - */ - public void receiveErrorsetBucketLoggingStatus(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for getObjectAccessControlPolicy method - * override this method for handling normal response from getObjectAccessControlPolicy operation - */ - public void receiveResultgetObjectAccessControlPolicy( - com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from getObjectAccessControlPolicy operation - */ - public void receiveErrorgetObjectAccessControlPolicy(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for deleteObject method - * override this method for handling normal response from deleteObject operation - */ - public void receiveResultdeleteObject( - com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from deleteObject operation - */ - public void receiveErrordeleteObject(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for setBucketAccessControlPolicy method - * override this method for handling normal response from setBucketAccessControlPolicy operation - */ - public void receiveResultsetBucketAccessControlPolicy( - com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from setBucketAccessControlPolicy operation - */ - public void receiveErrorsetBucketAccessControlPolicy(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for setObjectAccessControlPolicy method - * override this method for handling normal response from setObjectAccessControlPolicy operation - */ - public void receiveResultsetObjectAccessControlPolicy( - com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from setObjectAccessControlPolicy operation - */ - public void receiveErrorsetObjectAccessControlPolicy(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for putObjectInline method - * override this method for handling normal response from putObjectInline operation - */ - public void receiveResultputObjectInline( - com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from putObjectInline operation - */ - public void receiveErrorputObjectInline(java.lang.Exception e) { - } - - /** - * auto generated Axis2 call back method for getObjectExtended method - * override this method for handling normal response from getObjectExtended operation - */ - public void receiveResultgetObjectExtended( - com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse result - ) { - } - - /** - * auto generated Axis2 Error handler - * override this method for handling error response from getObjectExtended operation - */ - public void receiveErrorgetObjectExtended(java.lang.Exception e) { - } - - - - } +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * AmazonS3CallbackHandler.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) + */ + + package com.amazon.s3.client; + + /** + * AmazonS3CallbackHandler Callback class, Users can extend this class and implement + * their own receiveResult and receiveError methods. + */ + public abstract class AmazonS3CallbackHandler{ + + + + protected Object clientData; + + /** + * User can pass in any object that needs to be accessed once the NonBlocking + * Web service call is finished and appropriate method of this CallBack is called. + * @param clientData Object mechanism by which the user can pass in user data + * that will be avilable at the time this callback is called. + */ + public AmazonS3CallbackHandler(Object clientData){ + this.clientData = clientData; + } + + /** + * Please use this constructor if you don't want to set any clientData + */ + public AmazonS3CallbackHandler(){ + this.clientData = null; + } + + /** + * Get the client data + */ + + public Object getClientData() { + return clientData; + } + + + /** + * auto generated Axis2 call back method for getBucketLoggingStatus method + * override this method for handling normal response from getBucketLoggingStatus operation + */ + public void receiveResultgetBucketLoggingStatus( + com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from getBucketLoggingStatus operation + */ + public void receiveErrorgetBucketLoggingStatus(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for copyObject method + * override this method for handling normal response from copyObject operation + */ + public void receiveResultcopyObject( + com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from copyObject operation + */ + public void receiveErrorcopyObject(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for getBucketAccessControlPolicy method + * override this method for handling normal response from getBucketAccessControlPolicy operation + */ + public void receiveResultgetBucketAccessControlPolicy( + com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from getBucketAccessControlPolicy operation + */ + public void receiveErrorgetBucketAccessControlPolicy(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for listBucket method + * override this method for handling normal response from listBucket operation + */ + public void receiveResultlistBucket( + com.amazon.s3.client.AmazonS3Stub.ListBucketResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from listBucket operation + */ + public void receiveErrorlistBucket(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for putObject method + * override this method for handling normal response from putObject operation + */ + public void receiveResultputObject( + com.amazon.s3.client.AmazonS3Stub.PutObjectResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from putObject operation + */ + public void receiveErrorputObject(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for createBucket method + * override this method for handling normal response from createBucket operation + */ + public void receiveResultcreateBucket( + com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from createBucket operation + */ + public void receiveErrorcreateBucket(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for listAllMyBuckets method + * override this method for handling normal response from listAllMyBuckets operation + */ + public void receiveResultlistAllMyBuckets( + com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from listAllMyBuckets operation + */ + public void receiveErrorlistAllMyBuckets(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for getObject method + * override this method for handling normal response from getObject operation + */ + public void receiveResultgetObject( + com.amazon.s3.client.AmazonS3Stub.GetObjectResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from getObject operation + */ + public void receiveErrorgetObject(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for deleteBucket method + * override this method for handling normal response from deleteBucket operation + */ + public void receiveResultdeleteBucket( + com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from deleteBucket operation + */ + public void receiveErrordeleteBucket(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for setBucketLoggingStatus method + * override this method for handling normal response from setBucketLoggingStatus operation + */ + public void receiveResultsetBucketLoggingStatus( + com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from setBucketLoggingStatus operation + */ + public void receiveErrorsetBucketLoggingStatus(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for getObjectAccessControlPolicy method + * override this method for handling normal response from getObjectAccessControlPolicy operation + */ + public void receiveResultgetObjectAccessControlPolicy( + com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from getObjectAccessControlPolicy operation + */ + public void receiveErrorgetObjectAccessControlPolicy(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for deleteObject method + * override this method for handling normal response from deleteObject operation + */ + public void receiveResultdeleteObject( + com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from deleteObject operation + */ + public void receiveErrordeleteObject(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for setBucketAccessControlPolicy method + * override this method for handling normal response from setBucketAccessControlPolicy operation + */ + public void receiveResultsetBucketAccessControlPolicy( + com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from setBucketAccessControlPolicy operation + */ + public void receiveErrorsetBucketAccessControlPolicy(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for setObjectAccessControlPolicy method + * override this method for handling normal response from setObjectAccessControlPolicy operation + */ + public void receiveResultsetObjectAccessControlPolicy( + com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from setObjectAccessControlPolicy operation + */ + public void receiveErrorsetObjectAccessControlPolicy(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for putObjectInline method + * override this method for handling normal response from putObjectInline operation + */ + public void receiveResultputObjectInline( + com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from putObjectInline operation + */ + public void receiveErrorputObjectInline(java.lang.Exception e) { + } + + /** + * auto generated Axis2 call back method for getObjectExtended method + * override this method for handling normal response from getObjectExtended operation + */ + public void receiveResultgetObjectExtended( + com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse result + ) { + } + + /** + * auto generated Axis2 Error handler + * override this method for handling error response from getObjectExtended operation + */ + public void receiveErrorgetObjectExtended(java.lang.Exception e) { + } + + + + } \ No newline at end of file diff --git a/awsapi/src/com/amazon/s3/client/AmazonS3Stub.java b/awsapi/src/com/amazon/s3/client/AmazonS3Stub.java index e3eaad508f2..44c204deacc 100644 --- a/awsapi/src/com/amazon/s3/client/AmazonS3Stub.java +++ b/awsapi/src/com/amazon/s3/client/AmazonS3Stub.java @@ -1,46084 +1,46100 @@ - -/** - * AmazonS3Stub.java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) - */ - package com.amazon.s3.client; - - - - /* - * AmazonS3Stub java implementation - */ - - - public class AmazonS3Stub extends org.apache.axis2.client.Stub - { - protected org.apache.axis2.description.AxisOperation[] _operations; - - //hashmaps to keep the fault mapping - private java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); - private java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); - private java.util.HashMap faultMessageMap = new java.util.HashMap(); - - private static int counter = 0; - - private static synchronized java.lang.String getUniqueSuffix(){ - // reset the counter if it is greater than 99999 - if (counter > 99999){ - counter = 0; - } - counter = counter + 1; - return java.lang.Long.toString(System.currentTimeMillis()) + "_" + counter; - } - - - private void populateAxisService() throws org.apache.axis2.AxisFault { - - //creating the Service with a unique name - _service = new org.apache.axis2.description.AxisService("AmazonS3" + getUniqueSuffix()); - addAnonymousOperations(); - - //creating the operations - org.apache.axis2.description.AxisOperation __operation; - - _operations = new org.apache.axis2.description.AxisOperation[16]; - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getBucketLoggingStatus")); - _service.addOperation(__operation); - - - - - _operations[0]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "copyObject")); - _service.addOperation(__operation); - - - - - _operations[1]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getBucketAccessControlPolicy")); - _service.addOperation(__operation); - - - - - _operations[2]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "listBucket")); - _service.addOperation(__operation); - - - - - _operations[3]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "putObject")); - _service.addOperation(__operation); - - - - - _operations[4]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "createBucket")); - _service.addOperation(__operation); - - - - - _operations[5]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "listAllMyBuckets")); - _service.addOperation(__operation); - - - - - _operations[6]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getObject")); - _service.addOperation(__operation); - - - - - _operations[7]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "deleteBucket")); - _service.addOperation(__operation); - - - - - _operations[8]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "setBucketLoggingStatus")); - _service.addOperation(__operation); - - - - - _operations[9]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getObjectAccessControlPolicy")); - _service.addOperation(__operation); - - - - - _operations[10]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "deleteObject")); - _service.addOperation(__operation); - - - - - _operations[11]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "setBucketAccessControlPolicy")); - _service.addOperation(__operation); - - - - - _operations[12]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "setObjectAccessControlPolicy")); - _service.addOperation(__operation); - - - - - _operations[13]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "putObjectInline")); - _service.addOperation(__operation); - - - - - _operations[14]=__operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getObjectExtended")); - _service.addOperation(__operation); - - - - - _operations[15]=__operation; - - - } - - //populates the faults - private void populateFaults(){ - - - - } - - /** - *Constructor that takes in a configContext - */ - - public AmazonS3Stub(org.apache.axis2.context.ConfigurationContext configurationContext, - java.lang.String targetEndpoint) - throws org.apache.axis2.AxisFault { - this(configurationContext,targetEndpoint,false); - } - - - /** - * Constructor that takes in a configContext and useseperate listner - */ - public AmazonS3Stub(org.apache.axis2.context.ConfigurationContext configurationContext, - java.lang.String targetEndpoint, boolean useSeparateListener) - throws org.apache.axis2.AxisFault { - //To populate AxisService - populateAxisService(); - populateFaults(); - - _serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service); - - - _serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference( - targetEndpoint)); - _serviceClient.getOptions().setUseSeparateListener(useSeparateListener); - - - } - - /** - * Default Constructor - */ - public AmazonS3Stub(org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { - - this(configurationContext,"http://s3.cloud.com/soap" ); - - } - - /** - * Default Constructor - */ - public AmazonS3Stub() throws org.apache.axis2.AxisFault { - - this("http://s3.cloud.com/soap" ); - - } - - /** - * Constructor taking the target endpoint - */ - public AmazonS3Stub(java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(null,targetEndpoint); - } - - - - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#getBucketLoggingStatus - * @param getBucketLoggingStatus0 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse getBucketLoggingStatus( - - com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus getBucketLoggingStatus0) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketLoggingStatusRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - getBucketLoggingStatus0, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "getBucketLoggingStatus"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startgetBucketLoggingStatus - * @param getBucketLoggingStatus0 - - */ - public void startgetBucketLoggingStatus( - - com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus getBucketLoggingStatus0, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketLoggingStatusRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - getBucketLoggingStatus0, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "getBucketLoggingStatus"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetBucketLoggingStatus( - (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorgetBucketLoggingStatus(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorgetBucketLoggingStatus(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketLoggingStatus(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketLoggingStatus(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketLoggingStatus(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketLoggingStatus(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketLoggingStatus(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketLoggingStatus(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketLoggingStatus(f); - } - } else { - callback.receiveErrorgetBucketLoggingStatus(f); - } - } else { - callback.receiveErrorgetBucketLoggingStatus(f); - } - } else { - callback.receiveErrorgetBucketLoggingStatus(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetBucketLoggingStatus(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[0].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[0].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#copyObject - * @param copyObject2 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse copyObject( - - com.amazon.s3.client.AmazonS3Stub.CopyObject copyObject2) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CopyObjectRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - copyObject2, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "copyObject"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startcopyObject - * @param copyObject2 - - */ - public void startcopyObject( - - com.amazon.s3.client.AmazonS3Stub.CopyObject copyObject2, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CopyObjectRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - copyObject2, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "copyObject"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultcopyObject( - (com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorcopyObject(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorcopyObject(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcopyObject(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcopyObject(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcopyObject(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcopyObject(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcopyObject(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcopyObject(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcopyObject(f); - } - } else { - callback.receiveErrorcopyObject(f); - } - } else { - callback.receiveErrorcopyObject(f); - } - } else { - callback.receiveErrorcopyObject(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorcopyObject(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[1].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[1].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#getBucketAccessControlPolicy - * @param getBucketAccessControlPolicy4 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse getBucketAccessControlPolicy( - - com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy getBucketAccessControlPolicy4) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketAccessControlPolicyRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - getBucketAccessControlPolicy4, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "getBucketAccessControlPolicy"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startgetBucketAccessControlPolicy - * @param getBucketAccessControlPolicy4 - - */ - public void startgetBucketAccessControlPolicy( - - com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy getBucketAccessControlPolicy4, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketAccessControlPolicyRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - getBucketAccessControlPolicy4, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "getBucketAccessControlPolicy"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetBucketAccessControlPolicy( - (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorgetBucketAccessControlPolicy(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorgetBucketAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketAccessControlPolicy(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketAccessControlPolicy(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketAccessControlPolicy(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketAccessControlPolicy(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketAccessControlPolicy(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketAccessControlPolicy(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetBucketAccessControlPolicy(f); - } - } else { - callback.receiveErrorgetBucketAccessControlPolicy(f); - } - } else { - callback.receiveErrorgetBucketAccessControlPolicy(f); - } - } else { - callback.receiveErrorgetBucketAccessControlPolicy(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetBucketAccessControlPolicy(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[2].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[2].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#listBucket - * @param listBucket6 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.ListBucketResponse listBucket( - - com.amazon.s3.client.AmazonS3Stub.ListBucket listBucket6) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[3].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListBucketRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - listBucket6, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "listBucket"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.ListBucketResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startlistBucket - * @param listBucket6 - - */ - public void startlistBucket( - - com.amazon.s3.client.AmazonS3Stub.ListBucket listBucket6, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[3].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListBucketRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - listBucket6, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "listBucket"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultlistBucket( - (com.amazon.s3.client.AmazonS3Stub.ListBucketResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorlistBucket(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorlistBucket(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistBucket(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistBucket(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistBucket(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistBucket(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistBucket(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistBucket(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistBucket(f); - } - } else { - callback.receiveErrorlistBucket(f); - } - } else { - callback.receiveErrorlistBucket(f); - } - } else { - callback.receiveErrorlistBucket(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorlistBucket(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[3].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[3].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#putObject - * @param putObject8 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.PutObjectResponse putObject( - - com.amazon.s3.client.AmazonS3Stub.PutObject putObject8) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[4].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - putObject8, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "putObject"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.PutObjectResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startputObject - * @param putObject8 - - */ - public void startputObject( - - com.amazon.s3.client.AmazonS3Stub.PutObject putObject8, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[4].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - putObject8, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "putObject"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultputObject( - (com.amazon.s3.client.AmazonS3Stub.PutObjectResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorputObject(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorputObject(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObject(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObject(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObject(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObject(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObject(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObject(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObject(f); - } - } else { - callback.receiveErrorputObject(f); - } - } else { - callback.receiveErrorputObject(f); - } - } else { - callback.receiveErrorputObject(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorputObject(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[4].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[4].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#createBucket - * @param createBucket10 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse createBucket( - - com.amazon.s3.client.AmazonS3Stub.CreateBucket createBucket10) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[5].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CreateBucketRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - createBucket10, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "createBucket"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startcreateBucket - * @param createBucket10 - - */ - public void startcreateBucket( - - com.amazon.s3.client.AmazonS3Stub.CreateBucket createBucket10, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[5].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CreateBucketRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - createBucket10, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "createBucket"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultcreateBucket( - (com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorcreateBucket(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorcreateBucket(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcreateBucket(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcreateBucket(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcreateBucket(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcreateBucket(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcreateBucket(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcreateBucket(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorcreateBucket(f); - } - } else { - callback.receiveErrorcreateBucket(f); - } - } else { - callback.receiveErrorcreateBucket(f); - } - } else { - callback.receiveErrorcreateBucket(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorcreateBucket(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[5].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[5].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#listAllMyBuckets - * @param listAllMyBuckets12 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse listAllMyBuckets( - - com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets listAllMyBuckets12) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[6].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListAllMyBucketsRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - listAllMyBuckets12, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "listAllMyBuckets"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startlistAllMyBuckets - * @param listAllMyBuckets12 - - */ - public void startlistAllMyBuckets( - - com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets listAllMyBuckets12, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[6].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListAllMyBucketsRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - listAllMyBuckets12, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "listAllMyBuckets"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultlistAllMyBuckets( - (com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorlistAllMyBuckets(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorlistAllMyBuckets(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistAllMyBuckets(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistAllMyBuckets(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistAllMyBuckets(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistAllMyBuckets(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistAllMyBuckets(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistAllMyBuckets(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistAllMyBuckets(f); - } - } else { - callback.receiveErrorlistAllMyBuckets(f); - } - } else { - callback.receiveErrorlistAllMyBuckets(f); - } - } else { - callback.receiveErrorlistAllMyBuckets(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorlistAllMyBuckets(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[6].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[6].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#getObject - * @param getObject14 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.GetObjectResponse getObject( - - com.amazon.s3.client.AmazonS3Stub.GetObject getObject14) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[7].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - getObject14, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "getObject"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.GetObjectResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startgetObject - * @param getObject14 - - */ - public void startgetObject( - - com.amazon.s3.client.AmazonS3Stub.GetObject getObject14, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[7].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - getObject14, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "getObject"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetObject( - (com.amazon.s3.client.AmazonS3Stub.GetObjectResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorgetObject(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorgetObject(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObject(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObject(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObject(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObject(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObject(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObject(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObject(f); - } - } else { - callback.receiveErrorgetObject(f); - } - } else { - callback.receiveErrorgetObject(f); - } - } else { - callback.receiveErrorgetObject(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetObject(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[7].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[7].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#deleteBucket - * @param deleteBucket16 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse deleteBucket( - - com.amazon.s3.client.AmazonS3Stub.DeleteBucket deleteBucket16) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[8].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteBucketRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - deleteBucket16, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "deleteBucket"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startdeleteBucket - * @param deleteBucket16 - - */ - public void startdeleteBucket( - - com.amazon.s3.client.AmazonS3Stub.DeleteBucket deleteBucket16, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[8].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteBucketRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - deleteBucket16, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "deleteBucket"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultdeleteBucket( - (com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrordeleteBucket(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrordeleteBucket(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteBucket(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteBucket(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteBucket(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteBucket(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteBucket(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteBucket(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteBucket(f); - } - } else { - callback.receiveErrordeleteBucket(f); - } - } else { - callback.receiveErrordeleteBucket(f); - } - } else { - callback.receiveErrordeleteBucket(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrordeleteBucket(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[8].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[8].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#setBucketLoggingStatus - * @param setBucketLoggingStatus18 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse setBucketLoggingStatus( - - com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus setBucketLoggingStatus18) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[9].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketLoggingStatusRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - setBucketLoggingStatus18, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "setBucketLoggingStatus"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startsetBucketLoggingStatus - * @param setBucketLoggingStatus18 - - */ - public void startsetBucketLoggingStatus( - - com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus setBucketLoggingStatus18, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[9].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketLoggingStatusRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - setBucketLoggingStatus18, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "setBucketLoggingStatus"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultsetBucketLoggingStatus( - (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorsetBucketLoggingStatus(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorsetBucketLoggingStatus(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketLoggingStatus(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketLoggingStatus(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketLoggingStatus(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketLoggingStatus(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketLoggingStatus(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketLoggingStatus(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketLoggingStatus(f); - } - } else { - callback.receiveErrorsetBucketLoggingStatus(f); - } - } else { - callback.receiveErrorsetBucketLoggingStatus(f); - } - } else { - callback.receiveErrorsetBucketLoggingStatus(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorsetBucketLoggingStatus(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[9].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[9].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#getObjectAccessControlPolicy - * @param getObjectAccessControlPolicy20 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse getObjectAccessControlPolicy( - - com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy getObjectAccessControlPolicy20) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[10].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectAccessControlPolicyRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - getObjectAccessControlPolicy20, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "getObjectAccessControlPolicy"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startgetObjectAccessControlPolicy - * @param getObjectAccessControlPolicy20 - - */ - public void startgetObjectAccessControlPolicy( - - com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy getObjectAccessControlPolicy20, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[10].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectAccessControlPolicyRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - getObjectAccessControlPolicy20, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "getObjectAccessControlPolicy"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetObjectAccessControlPolicy( - (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorgetObjectAccessControlPolicy(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorgetObjectAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectAccessControlPolicy(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectAccessControlPolicy(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectAccessControlPolicy(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectAccessControlPolicy(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectAccessControlPolicy(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectAccessControlPolicy(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectAccessControlPolicy(f); - } - } else { - callback.receiveErrorgetObjectAccessControlPolicy(f); - } - } else { - callback.receiveErrorgetObjectAccessControlPolicy(f); - } - } else { - callback.receiveErrorgetObjectAccessControlPolicy(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetObjectAccessControlPolicy(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[10].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[10].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#deleteObject - * @param deleteObject22 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse deleteObject( - - com.amazon.s3.client.AmazonS3Stub.DeleteObject deleteObject22) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[11].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteObjectRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - deleteObject22, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "deleteObject"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startdeleteObject - * @param deleteObject22 - - */ - public void startdeleteObject( - - com.amazon.s3.client.AmazonS3Stub.DeleteObject deleteObject22, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[11].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteObjectRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - deleteObject22, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "deleteObject"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultdeleteObject( - (com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrordeleteObject(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrordeleteObject(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteObject(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteObject(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteObject(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteObject(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteObject(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteObject(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteObject(f); - } - } else { - callback.receiveErrordeleteObject(f); - } - } else { - callback.receiveErrordeleteObject(f); - } - } else { - callback.receiveErrordeleteObject(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrordeleteObject(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[11].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[11].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#setBucketAccessControlPolicy - * @param setBucketAccessControlPolicy24 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse setBucketAccessControlPolicy( - - com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy setBucketAccessControlPolicy24) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[12].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketAccessControlPolicyRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - setBucketAccessControlPolicy24, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "setBucketAccessControlPolicy"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startsetBucketAccessControlPolicy - * @param setBucketAccessControlPolicy24 - - */ - public void startsetBucketAccessControlPolicy( - - com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy setBucketAccessControlPolicy24, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[12].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketAccessControlPolicyRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - setBucketAccessControlPolicy24, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "setBucketAccessControlPolicy"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultsetBucketAccessControlPolicy( - (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorsetBucketAccessControlPolicy(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorsetBucketAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketAccessControlPolicy(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketAccessControlPolicy(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketAccessControlPolicy(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketAccessControlPolicy(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketAccessControlPolicy(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketAccessControlPolicy(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetBucketAccessControlPolicy(f); - } - } else { - callback.receiveErrorsetBucketAccessControlPolicy(f); - } - } else { - callback.receiveErrorsetBucketAccessControlPolicy(f); - } - } else { - callback.receiveErrorsetBucketAccessControlPolicy(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorsetBucketAccessControlPolicy(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[12].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[12].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#setObjectAccessControlPolicy - * @param setObjectAccessControlPolicy26 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse setObjectAccessControlPolicy( - - com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy setObjectAccessControlPolicy26) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[13].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetObjectAccessControlPolicyRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - setObjectAccessControlPolicy26, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "setObjectAccessControlPolicy"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startsetObjectAccessControlPolicy - * @param setObjectAccessControlPolicy26 - - */ - public void startsetObjectAccessControlPolicy( - - com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy setObjectAccessControlPolicy26, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[13].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetObjectAccessControlPolicyRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - setObjectAccessControlPolicy26, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "setObjectAccessControlPolicy"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultsetObjectAccessControlPolicy( - (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorsetObjectAccessControlPolicy(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorsetObjectAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetObjectAccessControlPolicy(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetObjectAccessControlPolicy(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetObjectAccessControlPolicy(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetObjectAccessControlPolicy(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetObjectAccessControlPolicy(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetObjectAccessControlPolicy(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorsetObjectAccessControlPolicy(f); - } - } else { - callback.receiveErrorsetObjectAccessControlPolicy(f); - } - } else { - callback.receiveErrorsetObjectAccessControlPolicy(f); - } - } else { - callback.receiveErrorsetObjectAccessControlPolicy(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorsetObjectAccessControlPolicy(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[13].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[13].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#putObjectInline - * @param putObjectInline28 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse putObjectInline( - - com.amazon.s3.client.AmazonS3Stub.PutObjectInline putObjectInline28) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[14].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectInlineRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - putObjectInline28, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "putObjectInline"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startputObjectInline - * @param putObjectInline28 - - */ - public void startputObjectInline( - - com.amazon.s3.client.AmazonS3Stub.PutObjectInline putObjectInline28, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[14].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectInlineRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - putObjectInline28, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "putObjectInline"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultputObjectInline( - (com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorputObjectInline(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorputObjectInline(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObjectInline(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObjectInline(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObjectInline(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObjectInline(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObjectInline(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObjectInline(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorputObjectInline(f); - } - } else { - callback.receiveErrorputObjectInline(f); - } - } else { - callback.receiveErrorputObjectInline(f); - } - } else { - callback.receiveErrorputObjectInline(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorputObjectInline(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[14].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[14].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see com.amazon.s3.client.AmazonS3#getObjectExtended - * @param getObjectExtended30 - - */ - - - - public com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse getObjectExtended( - - com.amazon.s3.client.AmazonS3Stub.GetObjectExtended getObjectExtended30) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try{ - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[15].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectExtendedRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - // create a message context - _messageContext = new org.apache.axis2.context.MessageContext(); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env = null; - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - getObjectExtended30, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "getObjectExtended"))); - - //adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // set the message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - //execute the operation client - _operationClient.execute(true); - - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( - org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - java.lang.Object object = fromOM( - _returnEnv.getBody().getFirstElement() , - com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse)object; - - }catch(org.apache.axis2.AxisFault f){ - - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - }catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - }catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - }else{ - throw f; - } - }else{ - throw f; - } - } finally { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see com.amazon.s3.client.AmazonS3#startgetObjectExtended - * @param getObjectExtended30 - - */ - public void startgetObjectExtended( - - com.amazon.s3.client.AmazonS3Stub.GetObjectExtended getObjectExtended30, - - final com.amazon.s3.client.AmazonS3CallbackHandler callback) - - throws java.rmi.RemoteException{ - - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[15].getName()); - _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectExtendedRequest"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); - - - - // create SOAP envelope with that payload - org.apache.axiom.soap.SOAPEnvelope env=null; - final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - - - //Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), - getObjectExtended30, - optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "getObjectExtended"))); - - // adding SOAP soap_headers - _serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { - public void onMessage(org.apache.axis2.context.MessageContext resultContext) { - try { - org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetObjectExtended( - (com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse)object); - - } catch (org.apache.axis2.AxisFault e) { - callback.receiveErrorgetObjectExtended(e); - } - } - - public void onError(java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt!=null){ - if (faultExceptionNameMap.containsKey(faultElt.getQName())){ - //make the fault by reflection - try{ - java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); - java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - java.lang.Exception ex= - (java.lang.Exception) exceptionClass.newInstance(); - //message class - java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); - java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - java.lang.Object messageObject = fromOM(faultElt,messageClass,null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", - new java.lang.Class[]{messageClass}); - m.invoke(ex,new java.lang.Object[]{messageObject}); - - - callback.receiveErrorgetObjectExtended(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch(java.lang.ClassCastException e){ - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectExtended(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectExtended(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectExtended(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectExtended(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectExtended(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectExtended(f); - } catch (org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetObjectExtended(f); - } - } else { - callback.receiveErrorgetObjectExtended(f); - } - } else { - callback.receiveErrorgetObjectExtended(f); - } - } else { - callback.receiveErrorgetObjectExtended(error); - } - } - - public void onFault(org.apache.axis2.context.MessageContext faultContext) { - org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } catch (org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetObjectExtended(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if ( _operations[15].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - _operations[15].setMessageReceiver( - _callbackReceiver); - } - - //execute the operation client - _operationClient.execute(false); - - } - - - - /** - * A utility method that copies the namepaces from the SOAPEnvelope - */ - private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){ - java.util.Map returnMap = new java.util.HashMap(); - java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); - while (namespaceIterator.hasNext()) { - org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); - returnMap.put(ns.getPrefix(),ns.getNamespaceURI()); - } - return returnMap; - } - - - - private javax.xml.namespace.QName[] opNameArray = null; - private boolean optimizeContent(javax.xml.namespace.QName opName) { - - - if (opNameArray == null) { - return false; - } - for (int i = 0; i < opNameArray.length; i++) { - if (opName.equals(opNameArray[i])) { - return true; - } - } - return false; - } - //http://s3.cloud.com/soap - public static class ListAllMyBuckets - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "ListAllMyBuckets", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListAllMyBuckets.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListAllMyBuckets", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListAllMyBuckets", - xmlWriter); - } - - - } - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListAllMyBuckets parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListAllMyBuckets object = - new ListAllMyBuckets(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListAllMyBuckets".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListAllMyBuckets)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class ListAllMyBucketsEntry - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListAllMyBucketsEntry - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Name - */ - - - protected java.lang.String localName ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getName(){ - return localName; - } - - - - /** - * Auto generated setter method - * @param param Name - */ - public void setName(java.lang.String param){ - - this.localName=param; - - - } - - - /** - * field for CreationDate - */ - - - protected java.util.Calendar localCreationDate ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getCreationDate(){ - return localCreationDate; - } - - - - /** - * Auto generated setter method - * @param param CreationDate - */ - public void setCreationDate(java.util.Calendar param){ - - this.localCreationDate=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListAllMyBucketsEntry.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListAllMyBucketsEntry", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListAllMyBucketsEntry", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Name", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Name"); - } - - } else { - xmlWriter.writeStartElement("Name"); - } - - - if (localName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localName); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"CreationDate", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"CreationDate"); - } - - } else { - xmlWriter.writeStartElement("CreationDate"); - } - - - if (localCreationDate==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("CreationDate cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCreationDate)); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Name")); - - if (localName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CreationDate")); - - if (localCreationDate != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCreationDate)); - } else { - throw new org.apache.axis2.databinding.ADBException("CreationDate cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListAllMyBucketsEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListAllMyBucketsEntry object = - new ListAllMyBucketsEntry(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListAllMyBucketsEntry".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListAllMyBucketsEntry)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreationDate").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCreationDate( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class ListBucketResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListBucketResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Metadata - * This was an Array! - */ - - - protected MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return MetadataEntry[] - */ - public MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(MetadataEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param MetadataEntry - */ - public void addMetadata(MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (MetadataEntry[])list.toArray( - new MetadataEntry[list.size()]); - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getName(){ - return localName; - } - - - - /** - * Auto generated setter method - * @param param Name - */ - public void setName(java.lang.String param){ - - this.localName=param; - - - } - - - /** - * field for Prefix - */ - - - protected java.lang.String localPrefix ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getPrefix(){ - return localPrefix; - } - - - - /** - * Auto generated setter method - * @param param Prefix - */ - public void setPrefix(java.lang.String param){ - - this.localPrefix=param; - - - } - - - /** - * field for Marker - */ - - - protected java.lang.String localMarker ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getMarker(){ - return localMarker; - } - - - - /** - * Auto generated setter method - * @param param Marker - */ - public void setMarker(java.lang.String param){ - - this.localMarker=param; - - - } - - - /** - * field for NextMarker - */ - - - protected java.lang.String localNextMarker ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localNextMarkerTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getNextMarker(){ - return localNextMarker; - } - - - - /** - * Auto generated setter method - * @param param NextMarker - */ - public void setNextMarker(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localNextMarkerTracker = true; - } else { - localNextMarkerTracker = false; - - } - - this.localNextMarker=param; - - - } - - - /** - * field for MaxKeys - */ - - - protected int localMaxKeys ; - - - /** - * Auto generated getter method - * @return int - */ - public int getMaxKeys(){ - return localMaxKeys; - } - - - - /** - * Auto generated setter method - * @param param MaxKeys - */ - public void setMaxKeys(int param){ - - this.localMaxKeys=param; - - - } - - - /** - * field for Delimiter - */ - - - protected java.lang.String localDelimiter ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localDelimiterTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDelimiter(){ - return localDelimiter; - } - - - - /** - * Auto generated setter method - * @param param Delimiter - */ - public void setDelimiter(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localDelimiterTracker = true; - } else { - localDelimiterTracker = false; - - } - - this.localDelimiter=param; - - - } - - - /** - * field for IsTruncated - */ - - - protected boolean localIsTruncated ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getIsTruncated(){ - return localIsTruncated; - } - - - - /** - * Auto generated setter method - * @param param IsTruncated - */ - public void setIsTruncated(boolean param){ - - this.localIsTruncated=param; - - - } - - - /** - * field for Contents - * This was an Array! - */ - - - protected ListEntry[] localContents ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localContentsTracker = false ; - - - /** - * Auto generated getter method - * @return ListEntry[] - */ - public ListEntry[] getContents(){ - return localContents; - } - - - - - - - /** - * validate the array for Contents - */ - protected void validateContents(ListEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param Contents - */ - public void setContents(ListEntry[] param){ - - validateContents(param); - - - if (param != null){ - //update the setting tracker - localContentsTracker = true; - } else { - localContentsTracker = false; - - } - - this.localContents=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param ListEntry - */ - public void addContents(ListEntry param){ - if (localContents == null){ - localContents = new ListEntry[]{}; - } - - - //update the setting tracker - localContentsTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localContents); - list.add(param); - this.localContents = - (ListEntry[])list.toArray( - new ListEntry[list.size()]); - - } - - - /** - * field for CommonPrefixes - * This was an Array! - */ - - - protected PrefixEntry[] localCommonPrefixes ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCommonPrefixesTracker = false ; - - - /** - * Auto generated getter method - * @return PrefixEntry[] - */ - public PrefixEntry[] getCommonPrefixes(){ - return localCommonPrefixes; - } - - - - - - - /** - * validate the array for CommonPrefixes - */ - protected void validateCommonPrefixes(PrefixEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param CommonPrefixes - */ - public void setCommonPrefixes(PrefixEntry[] param){ - - validateCommonPrefixes(param); - - - if (param != null){ - //update the setting tracker - localCommonPrefixesTracker = true; - } else { - localCommonPrefixesTracker = false; - - } - - this.localCommonPrefixes=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param PrefixEntry - */ - public void addCommonPrefixes(PrefixEntry param){ - if (localCommonPrefixes == null){ - localCommonPrefixes = new PrefixEntry[]{}; - } - - - //update the setting tracker - localCommonPrefixesTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localCommonPrefixes); - list.add(param); - this.localCommonPrefixes = - (PrefixEntry[])list.toArray( - new PrefixEntry[list.size()]); - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListBucketResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListBucketResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListBucketResult", - xmlWriter); - } - - - } - if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Name", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Name"); - } - - } else { - xmlWriter.writeStartElement("Name"); - } - - - if (localName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localName); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Prefix", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Prefix"); - } - - } else { - xmlWriter.writeStartElement("Prefix"); - } - - - if (localPrefix==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localPrefix); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Marker", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Marker"); - } - - } else { - xmlWriter.writeStartElement("Marker"); - } - - - if (localMarker==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localMarker); - - } - - xmlWriter.writeEndElement(); - if (localNextMarkerTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"NextMarker", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"NextMarker"); - } - - } else { - xmlWriter.writeStartElement("NextMarker"); - } - - - if (localNextMarker==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("NextMarker cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localNextMarker); - - } - - xmlWriter.writeEndElement(); - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"MaxKeys", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"MaxKeys"); - } - - } else { - xmlWriter.writeStartElement("MaxKeys"); - } - - if (localMaxKeys==java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); - } - - xmlWriter.writeEndElement(); - if (localDelimiterTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Delimiter", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Delimiter"); - } - - } else { - xmlWriter.writeStartElement("Delimiter"); - } - - - if (localDelimiter==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDelimiter); - - } - - xmlWriter.writeEndElement(); - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"IsTruncated", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IsTruncated"); - } - - } else { - xmlWriter.writeStartElement("IsTruncated"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("IsTruncated cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); - } - - xmlWriter.writeEndElement(); - if (localContentsTracker){ - if (localContents!=null){ - for (int i = 0;i < localContents.length;i++){ - if (localContents[i] != null){ - localContents[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Contents cannot be null!!"); - - } - } if (localCommonPrefixesTracker){ - if (localCommonPrefixes!=null){ - for (int i = 0;i < localCommonPrefixes.length;i++){ - if (localCommonPrefixes[i] != null){ - localCommonPrefixes[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Name")); - - if (localName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Prefix")); - - if (localPrefix != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); - } else { - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Marker")); - - if (localMarker != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMarker)); - } else { - throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); - } - if (localNextMarkerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "NextMarker")); - - if (localNextMarker != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNextMarker)); - } else { - throw new org.apache.axis2.databinding.ADBException("NextMarker cannot be null!!"); - } - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "MaxKeys")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); - if (localDelimiterTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Delimiter")); - - if (localDelimiter != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); - } else { - throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); - } - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IsTruncated")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); - if (localContentsTracker){ - if (localContents!=null) { - for (int i = 0;i < localContents.length;i++){ - - if (localContents[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Contents")); - elementList.add(localContents[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Contents cannot be null!!"); - - } - - } if (localCommonPrefixesTracker){ - if (localCommonPrefixes!=null) { - for (int i = 0;i < localCommonPrefixes.length;i++){ - - if (localCommonPrefixes[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CommonPrefixes")); - elementList.add(localCommonPrefixes[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListBucketResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListBucketResult object = - new ListBucketResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListBucketResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListBucketResult)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list1 = new java.util.ArrayList(); - - java.util.ArrayList list9 = new java.util.ArrayList(); - - java.util.ArrayList list10 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list1.add(MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while(!loopDone1){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list1.add(MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - MetadataEntry.class, - list1)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setPrefix( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Marker").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setMarker( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","NextMarker").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setNextMarker( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MaxKeys").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setMaxKeys( - org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Delimiter").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDelimiter( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IsTruncated").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setIsTruncated( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list9.add(ListEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone9 = false; - while(!loopDone9){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone9 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents").equals(reader.getName())){ - list9.add(ListEntry.Factory.parse(reader)); - - }else{ - loopDone9 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setContents((ListEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - ListEntry.class, - list9)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list10.add(PrefixEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone10 = false; - while(!loopDone10){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone10 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ - list10.add(PrefixEntry.Factory.parse(reader)); - - }else{ - loopDone10 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCommonPrefixes((PrefixEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - PrefixEntry.class, - list10)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class DeleteObject - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteObject", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - DeleteObject.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":DeleteObject", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "DeleteObject", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static DeleteObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - DeleteObject object = - new DeleteObject(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"DeleteObject".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteObject)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class ListAllMyBucketsList - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListAllMyBucketsList - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - * This was an Array! - */ - - - protected ListAllMyBucketsEntry[] localBucket ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localBucketTracker = false ; - - - /** - * Auto generated getter method - * @return ListAllMyBucketsEntry[] - */ - public ListAllMyBucketsEntry[] getBucket(){ - return localBucket; - } - - - - - - - /** - * validate the array for Bucket - */ - protected void validateBucket(ListAllMyBucketsEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(ListAllMyBucketsEntry[] param){ - - validateBucket(param); - - - if (param != null){ - //update the setting tracker - localBucketTracker = true; - } else { - localBucketTracker = false; - - } - - this.localBucket=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param ListAllMyBucketsEntry - */ - public void addBucket(ListAllMyBucketsEntry param){ - if (localBucket == null){ - localBucket = new ListAllMyBucketsEntry[]{}; - } - - - //update the setting tracker - localBucketTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localBucket); - list.add(param); - this.localBucket = - (ListAllMyBucketsEntry[])list.toArray( - new ListAllMyBucketsEntry[list.size()]); - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListAllMyBucketsList.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListAllMyBucketsList", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListAllMyBucketsList", - xmlWriter); - } - - - } - if (localBucketTracker){ - if (localBucket!=null){ - for (int i = 0;i < localBucket.length;i++){ - if (localBucket[i] != null){ - localBucket[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localBucketTracker){ - if (localBucket!=null) { - for (int i = 0;i < localBucket.length;i++){ - - if (localBucket[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - elementList.add(localBucket[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListAllMyBucketsList parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListAllMyBucketsList object = - new ListAllMyBucketsList(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListAllMyBucketsList".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListAllMyBucketsList)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list1.add(ListAllMyBucketsEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while(!loopDone1){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - list1.add(ListAllMyBucketsEntry.Factory.parse(reader)); - - }else{ - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setBucket((ListAllMyBucketsEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - ListAllMyBucketsEntry.class, - list1)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class PutObjectInline - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "PutObjectInline", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for Metadata - * This was an Array! - */ - - - protected MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return MetadataEntry[] - */ - public MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(MetadataEntry[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param MetadataEntry - */ - public void addMetadata(MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (MetadataEntry[])list.toArray( - new MetadataEntry[list.size()]); - - } - - - /** - * field for Data - */ - - - protected javax.activation.DataHandler localData ; - - - /** - * Auto generated getter method - * @return javax.activation.DataHandler - */ - public javax.activation.DataHandler getData(){ - return localData; - } - - - - /** - * Auto generated setter method - * @param param Data - */ - public void setData(javax.activation.DataHandler param){ - - this.localData=param; - - - } - - - /** - * field for ContentLength - */ - - - protected long localContentLength ; - - - /** - * Auto generated getter method - * @return long - */ - public long getContentLength(){ - return localContentLength; - } - - - - /** - * Auto generated setter method - * @param param ContentLength - */ - public void setContentLength(long param){ - - this.localContentLength=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected AccessControlList localAccessControlList ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAccessControlListTracker = false ; - - - /** - * Auto generated getter method - * @return AccessControlList - */ - public AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(AccessControlList param){ - - if (param != null){ - //update the setting tracker - localAccessControlListTracker = true; - } else { - localAccessControlListTracker = false; - - } - - this.localAccessControlList=param; - - - } - - - /** - * field for StorageClass - */ - - - protected StorageClass localStorageClass ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localStorageClassTracker = false ; - - - /** - * Auto generated getter method - * @return StorageClass - */ - public StorageClass getStorageClass(){ - return localStorageClass; - } - - - - /** - * Auto generated setter method - * @param param StorageClass - */ - public void setStorageClass(StorageClass param){ - - if (param != null){ - //update the setting tracker - localStorageClassTracker = true; - } else { - localStorageClassTracker = false; - - } - - this.localStorageClass=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PutObjectInline.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PutObjectInline", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PutObjectInline", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Data", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Data"); - } - - } else { - xmlWriter.writeStartElement("Data"); - } - - - if (localData!=null) - { - xmlWriter.writeDataHandler(localData); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ContentLength", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ContentLength"); - } - - } else { - xmlWriter.writeStartElement("ContentLength"); - } - - if (localContentLength==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("ContentLength cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); - } - - xmlWriter.writeEndElement(); - if (localAccessControlListTracker){ - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - } if (localStorageClassTracker){ - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), - factory,xmlWriter); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Data")); - - elementList.add(localData); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ContentLength")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); - if (localAccessControlListTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - } if (localStorageClassTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass")); - - - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - elementList.add(localStorageClass); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PutObjectInline parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PutObjectInline object = - new PutObjectInline(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PutObjectInline".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PutObjectInline)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list3 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list3.add(MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone3 = false; - while(!loopDone3){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone3 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list3.add(MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone3 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - MetadataEntry.class, - list3)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Data").equals(reader.getName())){ - reader.next(); - if (isReaderMTOMAware(reader) - && - java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))) - { - //MTOM aware reader - get the datahandler directly and put it in the object - object.setData( - (javax.activation.DataHandler) reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER)); - } else { - if (reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT && reader.getName().equals(new javax.xml.namespace.QName(org.apache.axiom.om.impl.MTOMConstants.XOP_NAMESPACE_URI, org.apache.axiom.om.impl.MTOMConstants.XOP_INCLUDE))) - { - java.lang.String id = org.apache.axiom.om.util.ElementHelper.getContentID(reader, "UTF-8"); - object.setData(((org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder) ((org.apache.axiom.om.impl.llom.OMStAXWrapper) reader).getBuilder()).getDataHandler(id)); - reader.next(); - - reader.next(); - - } else if(reader.hasText()) { - //Do the usual conversion - java.lang.String content = reader.getText(); - object.setData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBase64Binary(content)); - - reader.next(); - - } - } - - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ContentLength").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setContentLength( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ - - object.setStorageClass(StorageClass.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class CreateBucketResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = CreateBucketResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for BucketName - */ - - - protected java.lang.String localBucketName ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucketName(){ - return localBucketName; - } - - - - /** - * Auto generated setter method - * @param param BucketName - */ - public void setBucketName(java.lang.String param){ - - this.localBucketName=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CreateBucketResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CreateBucketResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CreateBucketResult", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"BucketName", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"BucketName"); - } - - } else { - xmlWriter.writeStartElement("BucketName"); - } - - - if (localBucketName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("BucketName cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucketName); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "BucketName")); - - if (localBucketName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucketName)); - } else { - throw new org.apache.axis2.databinding.ADBException("BucketName cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CreateBucketResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CreateBucketResult object = - new CreateBucketResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CreateBucketResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CreateBucketResult)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketName").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucketName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class Status - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = Status - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Code - */ - - - protected int localCode ; - - - /** - * Auto generated getter method - * @return int - */ - public int getCode(){ - return localCode; - } - - - - /** - * Auto generated setter method - * @param param Code - */ - public void setCode(int param){ - - this.localCode=param; - - - } - - - /** - * field for Description - */ - - - protected java.lang.String localDescription ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDescription(){ - return localDescription; - } - - - - /** - * Auto generated setter method - * @param param Description - */ - public void setDescription(java.lang.String param){ - - this.localDescription=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Status.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Status", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Status", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Code", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Code"); - } - - } else { - xmlWriter.writeStartElement("Code"); - } - - if (localCode==java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("Code cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCode)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Description", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Description"); - } - - } else { - xmlWriter.writeStartElement("Description"); - } - - - if (localDescription==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Description cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDescription); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Code")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCode)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Description")); - - if (localDescription != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDescription)); - } else { - throw new org.apache.axis2.databinding.ADBException("Description cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Status parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Status object = - new Status(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"Status".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Status)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Code").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCode( - org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Description").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDescription( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class CreateBucketResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "CreateBucketResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for CreateBucketReturn - */ - - - protected CreateBucketResult localCreateBucketReturn ; - - - /** - * Auto generated getter method - * @return CreateBucketResult - */ - public CreateBucketResult getCreateBucketReturn(){ - return localCreateBucketReturn; - } - - - - /** - * Auto generated setter method - * @param param CreateBucketReturn - */ - public void setCreateBucketReturn(CreateBucketResult param){ - - this.localCreateBucketReturn=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CreateBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CreateBucketResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CreateBucketResponse", - xmlWriter); - } - - - } - - if (localCreateBucketReturn==null){ - throw new org.apache.axis2.databinding.ADBException("CreateBucketReturn cannot be null!!"); - } - localCreateBucketReturn.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreateBucketReturn"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CreateBucketReturn")); - - - if (localCreateBucketReturn==null){ - throw new org.apache.axis2.databinding.ADBException("CreateBucketReturn cannot be null!!"); - } - elementList.add(localCreateBucketReturn); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CreateBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CreateBucketResponse object = - new CreateBucketResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CreateBucketResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CreateBucketResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreateBucketReturn").equals(reader.getName())){ - - object.setCreateBucketReturn(CreateBucketResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetObjectExtended - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectExtended", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for GetMetadata - */ - - - protected boolean localGetMetadata ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getGetMetadata(){ - return localGetMetadata; - } - - - - /** - * Auto generated setter method - * @param param GetMetadata - */ - public void setGetMetadata(boolean param){ - - this.localGetMetadata=param; - - - } - - - /** - * field for GetData - */ - - - protected boolean localGetData ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getGetData(){ - return localGetData; - } - - - - /** - * Auto generated setter method - * @param param GetData - */ - public void setGetData(boolean param){ - - this.localGetData=param; - - - } - - - /** - * field for InlineData - */ - - - protected boolean localInlineData ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getInlineData(){ - return localInlineData; - } - - - - /** - * Auto generated setter method - * @param param InlineData - */ - public void setInlineData(boolean param){ - - this.localInlineData=param; - - - } - - - /** - * field for ByteRangeStart - */ - - - protected long localByteRangeStart ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localByteRangeStartTracker = false ; - - - /** - * Auto generated getter method - * @return long - */ - public long getByteRangeStart(){ - return localByteRangeStart; - } - - - - /** - * Auto generated setter method - * @param param ByteRangeStart - */ - public void setByteRangeStart(long param){ - - // setting primitive attribute tracker to true - - if (param==java.lang.Long.MIN_VALUE) { - localByteRangeStartTracker = false; - - } else { - localByteRangeStartTracker = true; - } - - this.localByteRangeStart=param; - - - } - - - /** - * field for ByteRangeEnd - */ - - - protected long localByteRangeEnd ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localByteRangeEndTracker = false ; - - - /** - * Auto generated getter method - * @return long - */ - public long getByteRangeEnd(){ - return localByteRangeEnd; - } - - - - /** - * Auto generated setter method - * @param param ByteRangeEnd - */ - public void setByteRangeEnd(long param){ - - // setting primitive attribute tracker to true - - if (param==java.lang.Long.MIN_VALUE) { - localByteRangeEndTracker = false; - - } else { - localByteRangeEndTracker = true; - } - - this.localByteRangeEnd=param; - - - } - - - /** - * field for IfModifiedSince - */ - - - protected java.util.Calendar localIfModifiedSince ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localIfModifiedSinceTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getIfModifiedSince(){ - return localIfModifiedSince; - } - - - - /** - * Auto generated setter method - * @param param IfModifiedSince - */ - public void setIfModifiedSince(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localIfModifiedSinceTracker = true; - } else { - localIfModifiedSinceTracker = false; - - } - - this.localIfModifiedSince=param; - - - } - - - /** - * field for IfUnmodifiedSince - */ - - - protected java.util.Calendar localIfUnmodifiedSince ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localIfUnmodifiedSinceTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getIfUnmodifiedSince(){ - return localIfUnmodifiedSince; - } - - - - /** - * Auto generated setter method - * @param param IfUnmodifiedSince - */ - public void setIfUnmodifiedSince(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localIfUnmodifiedSinceTracker = true; - } else { - localIfUnmodifiedSinceTracker = false; - - } - - this.localIfUnmodifiedSince=param; - - - } - - - /** - * field for IfMatch - * This was an Array! - */ - - - protected java.lang.String[] localIfMatch ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localIfMatchTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String[] - */ - public java.lang.String[] getIfMatch(){ - return localIfMatch; - } - - - - - - - /** - * validate the array for IfMatch - */ - protected void validateIfMatch(java.lang.String[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param IfMatch - */ - public void setIfMatch(java.lang.String[] param){ - - validateIfMatch(param); - - - if (param != null){ - //update the setting tracker - localIfMatchTracker = true; - } else { - localIfMatchTracker = false; - - } - - this.localIfMatch=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param java.lang.String - */ - public void addIfMatch(java.lang.String param){ - if (localIfMatch == null){ - localIfMatch = new java.lang.String[]{}; - } - - - //update the setting tracker - localIfMatchTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localIfMatch); - list.add(param); - this.localIfMatch = - (java.lang.String[])list.toArray( - new java.lang.String[list.size()]); - - } - - - /** - * field for IfNoneMatch - * This was an Array! - */ - - - protected java.lang.String[] localIfNoneMatch ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localIfNoneMatchTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String[] - */ - public java.lang.String[] getIfNoneMatch(){ - return localIfNoneMatch; - } - - - - - - - /** - * validate the array for IfNoneMatch - */ - protected void validateIfNoneMatch(java.lang.String[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param IfNoneMatch - */ - public void setIfNoneMatch(java.lang.String[] param){ - - validateIfNoneMatch(param); - - - if (param != null){ - //update the setting tracker - localIfNoneMatchTracker = true; - } else { - localIfNoneMatchTracker = false; - - } - - this.localIfNoneMatch=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param java.lang.String - */ - public void addIfNoneMatch(java.lang.String param){ - if (localIfNoneMatch == null){ - localIfNoneMatch = new java.lang.String[]{}; - } - - - //update the setting tracker - localIfNoneMatchTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localIfNoneMatch); - list.add(param); - this.localIfNoneMatch = - (java.lang.String[])list.toArray( - new java.lang.String[list.size()]); - - } - - - /** - * field for ReturnCompleteObjectOnConditionFailure - */ - - - protected boolean localReturnCompleteObjectOnConditionFailure ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localReturnCompleteObjectOnConditionFailureTracker = false ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getReturnCompleteObjectOnConditionFailure(){ - return localReturnCompleteObjectOnConditionFailure; - } - - - - /** - * Auto generated setter method - * @param param ReturnCompleteObjectOnConditionFailure - */ - public void setReturnCompleteObjectOnConditionFailure(boolean param){ - - // setting primitive attribute tracker to true - - if (false) { - localReturnCompleteObjectOnConditionFailureTracker = false; - - } else { - localReturnCompleteObjectOnConditionFailureTracker = true; - } - - this.localReturnCompleteObjectOnConditionFailure=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectExtended.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectExtended", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectExtended", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"GetMetadata", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"GetMetadata"); - } - - } else { - xmlWriter.writeStartElement("GetMetadata"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("GetMetadata cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"GetData", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"GetData"); - } - - } else { - xmlWriter.writeStartElement("GetData"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("GetData cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"InlineData", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"InlineData"); - } - - } else { - xmlWriter.writeStartElement("InlineData"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("InlineData cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); - } - - xmlWriter.writeEndElement(); - if (localByteRangeStartTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ByteRangeStart", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ByteRangeStart"); - } - - } else { - xmlWriter.writeStartElement("ByteRangeStart"); - } - - if (localByteRangeStart==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("ByteRangeStart cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeStart)); - } - - xmlWriter.writeEndElement(); - } if (localByteRangeEndTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ByteRangeEnd", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ByteRangeEnd"); - } - - } else { - xmlWriter.writeStartElement("ByteRangeEnd"); - } - - if (localByteRangeEnd==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("ByteRangeEnd cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeEnd)); - } - - xmlWriter.writeEndElement(); - } if (localIfModifiedSinceTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"IfModifiedSince", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IfModifiedSince"); - } - - } else { - xmlWriter.writeStartElement("IfModifiedSince"); - } - - - if (localIfModifiedSince==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("IfModifiedSince cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfModifiedSince)); - - } - - xmlWriter.writeEndElement(); - } if (localIfUnmodifiedSinceTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"IfUnmodifiedSince", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IfUnmodifiedSince"); - } - - } else { - xmlWriter.writeStartElement("IfUnmodifiedSince"); - } - - - if (localIfUnmodifiedSince==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("IfUnmodifiedSince cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfUnmodifiedSince)); - - } - - xmlWriter.writeEndElement(); - } if (localIfMatchTracker){ - if (localIfMatch!=null) { - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - boolean emptyNamespace = namespace == null || namespace.length() == 0; - prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); - for (int i = 0;i < localIfMatch.length;i++){ - - if (localIfMatch[i] != null){ - - if (!emptyNamespace) { - if (prefix == null) { - java.lang.String prefix2 = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix2,"IfMatch", namespace); - xmlWriter.writeNamespace(prefix2, namespace); - xmlWriter.setPrefix(prefix2, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IfMatch"); - } - - } else { - xmlWriter.writeStartElement("IfMatch"); - } - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfMatch[i])); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("IfMatch cannot be null!!"); - - } - - } if (localIfNoneMatchTracker){ - if (localIfNoneMatch!=null) { - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - boolean emptyNamespace = namespace == null || namespace.length() == 0; - prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); - for (int i = 0;i < localIfNoneMatch.length;i++){ - - if (localIfNoneMatch[i] != null){ - - if (!emptyNamespace) { - if (prefix == null) { - java.lang.String prefix2 = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix2,"IfNoneMatch", namespace); - xmlWriter.writeNamespace(prefix2, namespace); - xmlWriter.setPrefix(prefix2, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"IfNoneMatch"); - } - - } else { - xmlWriter.writeStartElement("IfNoneMatch"); - } - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfNoneMatch[i])); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("IfNoneMatch cannot be null!!"); - - } - - } if (localReturnCompleteObjectOnConditionFailureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ReturnCompleteObjectOnConditionFailure", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ReturnCompleteObjectOnConditionFailure"); - } - - } else { - xmlWriter.writeStartElement("ReturnCompleteObjectOnConditionFailure"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("ReturnCompleteObjectOnConditionFailure cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReturnCompleteObjectOnConditionFailure)); - } - - xmlWriter.writeEndElement(); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetMetadata")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetData")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "InlineData")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); - if (localByteRangeStartTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ByteRangeStart")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeStart)); - } if (localByteRangeEndTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ByteRangeEnd")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeEnd)); - } if (localIfModifiedSinceTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IfModifiedSince")); - - if (localIfModifiedSince != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfModifiedSince)); - } else { - throw new org.apache.axis2.databinding.ADBException("IfModifiedSince cannot be null!!"); - } - } if (localIfUnmodifiedSinceTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IfUnmodifiedSince")); - - if (localIfUnmodifiedSince != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfUnmodifiedSince)); - } else { - throw new org.apache.axis2.databinding.ADBException("IfUnmodifiedSince cannot be null!!"); - } - } if (localIfMatchTracker){ - if (localIfMatch!=null){ - for (int i = 0;i < localIfMatch.length;i++){ - - if (localIfMatch[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IfMatch")); - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfMatch[i])); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("IfMatch cannot be null!!"); - - } - - } if (localIfNoneMatchTracker){ - if (localIfNoneMatch!=null){ - for (int i = 0;i < localIfNoneMatch.length;i++){ - - if (localIfNoneMatch[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "IfNoneMatch")); - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfNoneMatch[i])); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("IfNoneMatch cannot be null!!"); - - } - - } if (localReturnCompleteObjectOnConditionFailureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ReturnCompleteObjectOnConditionFailure")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReturnCompleteObjectOnConditionFailure)); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectExtended parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectExtended object = - new GetObjectExtended(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectExtended".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectExtended)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list10 = new java.util.ArrayList(); - - java.util.ArrayList list11 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetMetadata").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setGetMetadata( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetData").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setGetData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","InlineData").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setInlineData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ByteRangeStart").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setByteRangeStart( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setByteRangeStart(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ByteRangeEnd").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setByteRangeEnd( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setByteRangeEnd(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfModifiedSince").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setIfModifiedSince( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfUnmodifiedSince").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setIfUnmodifiedSince( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfMatch").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list10.add(reader.getElementText()); - - //loop until we find a start element that is not part of this array - boolean loopDone10 = false; - while(!loopDone10){ - // Ensure we are at the EndElement - while (!reader.isEndElement()){ - reader.next(); - } - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone10 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfMatch").equals(reader.getName())){ - list10.add(reader.getElementText()); - - }else{ - loopDone10 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setIfMatch((java.lang.String[]) - list10.toArray(new java.lang.String[list10.size()])); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfNoneMatch").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list11.add(reader.getElementText()); - - //loop until we find a start element that is not part of this array - boolean loopDone11 = false; - while(!loopDone11){ - // Ensure we are at the EndElement - while (!reader.isEndElement()){ - reader.next(); - } - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone11 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfNoneMatch").equals(reader.getName())){ - list11.add(reader.getElementText()); - - }else{ - loopDone11 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setIfNoneMatch((java.lang.String[]) - list11.toArray(new java.lang.String[list11.size()])); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ReturnCompleteObjectOnConditionFailure").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setReturnCompleteObjectOnConditionFailure( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class ListAllMyBucketsResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "ListAllMyBucketsResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for ListAllMyBucketsResponse - */ - - - protected ListAllMyBucketsResult localListAllMyBucketsResponse ; - - - /** - * Auto generated getter method - * @return ListAllMyBucketsResult - */ - public ListAllMyBucketsResult getListAllMyBucketsResponse(){ - return localListAllMyBucketsResponse; - } - - - - /** - * Auto generated setter method - * @param param ListAllMyBucketsResponse - */ - public void setListAllMyBucketsResponse(ListAllMyBucketsResult param){ - - this.localListAllMyBucketsResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListAllMyBucketsResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListAllMyBucketsResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListAllMyBucketsResponse", - xmlWriter); - } - - - } - - if (localListAllMyBucketsResponse==null){ - throw new org.apache.axis2.databinding.ADBException("ListAllMyBucketsResponse cannot be null!!"); - } - localListAllMyBucketsResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListAllMyBucketsResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ListAllMyBucketsResponse")); - - - if (localListAllMyBucketsResponse==null){ - throw new org.apache.axis2.databinding.ADBException("ListAllMyBucketsResponse cannot be null!!"); - } - elementList.add(localListAllMyBucketsResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListAllMyBucketsResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListAllMyBucketsResponse object = - new ListAllMyBucketsResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListAllMyBucketsResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListAllMyBucketsResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListAllMyBucketsResponse").equals(reader.getName())){ - - object.setListAllMyBucketsResponse(ListAllMyBucketsResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class SetBucketAccessControlPolicy - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetBucketAccessControlPolicy", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected AccessControlList localAccessControlList ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAccessControlListTracker = false ; - - - /** - * Auto generated getter method - * @return AccessControlList - */ - public AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(AccessControlList param){ - - if (param != null){ - //update the setting tracker - localAccessControlListTracker = true; - } else { - localAccessControlListTracker = false; - - } - - this.localAccessControlList=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetBucketAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetBucketAccessControlPolicy", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetBucketAccessControlPolicy", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAccessControlListTracker){ - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAccessControlListTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetBucketAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetBucketAccessControlPolicy object = - new SetBucketAccessControlPolicy(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetBucketAccessControlPolicy".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetBucketAccessControlPolicy)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetObjectAccessControlPolicyResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectAccessControlPolicyResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for GetObjectAccessControlPolicyResponse - */ - - - protected AccessControlPolicy localGetObjectAccessControlPolicyResponse ; - - - /** - * Auto generated getter method - * @return AccessControlPolicy - */ - public AccessControlPolicy getGetObjectAccessControlPolicyResponse(){ - return localGetObjectAccessControlPolicyResponse; - } - - - - /** - * Auto generated setter method - * @param param GetObjectAccessControlPolicyResponse - */ - public void setGetObjectAccessControlPolicyResponse(AccessControlPolicy param){ - - this.localGetObjectAccessControlPolicyResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectAccessControlPolicyResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectAccessControlPolicyResponse", - xmlWriter); - } - - - } - - if (localGetObjectAccessControlPolicyResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectAccessControlPolicyResponse cannot be null!!"); - } - localGetObjectAccessControlPolicyResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectAccessControlPolicyResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectAccessControlPolicyResponse")); - - - if (localGetObjectAccessControlPolicyResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectAccessControlPolicyResponse cannot be null!!"); - } - elementList.add(localGetObjectAccessControlPolicyResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectAccessControlPolicyResponse object = - new GetObjectAccessControlPolicyResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectAccessControlPolicyResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectAccessControlPolicyResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectAccessControlPolicyResponse").equals(reader.getName())){ - - object.setGetObjectAccessControlPolicyResponse(AccessControlPolicy.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class DeleteObjectResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteObjectResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for DeleteObjectResponse - */ - - - protected Status localDeleteObjectResponse ; - - - /** - * Auto generated getter method - * @return Status - */ - public Status getDeleteObjectResponse(){ - return localDeleteObjectResponse; - } - - - - /** - * Auto generated setter method - * @param param DeleteObjectResponse - */ - public void setDeleteObjectResponse(Status param){ - - this.localDeleteObjectResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - DeleteObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":DeleteObjectResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "DeleteObjectResponse", - xmlWriter); - } - - - } - - if (localDeleteObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("DeleteObjectResponse cannot be null!!"); - } - localDeleteObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteObjectResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteObjectResponse")); - - - if (localDeleteObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("DeleteObjectResponse cannot be null!!"); - } - elementList.add(localDeleteObjectResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static DeleteObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - DeleteObjectResponse object = - new DeleteObjectResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"DeleteObjectResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteObjectResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteObjectResponse").equals(reader.getName())){ - - object.setDeleteObjectResponse(Status.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetBucketLoggingStatus - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketLoggingStatus", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetBucketLoggingStatus.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetBucketLoggingStatus", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetBucketLoggingStatus", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetBucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetBucketLoggingStatus object = - new GetBucketLoggingStatus(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetBucketLoggingStatus".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetBucketLoggingStatus)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class LoggingSettings - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = LoggingSettings - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for TargetBucket - */ - - - protected java.lang.String localTargetBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getTargetBucket(){ - return localTargetBucket; - } - - - - /** - * Auto generated setter method - * @param param TargetBucket - */ - public void setTargetBucket(java.lang.String param){ - - this.localTargetBucket=param; - - - } - - - /** - * field for TargetPrefix - */ - - - protected java.lang.String localTargetPrefix ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getTargetPrefix(){ - return localTargetPrefix; - } - - - - /** - * Auto generated setter method - * @param param TargetPrefix - */ - public void setTargetPrefix(java.lang.String param){ - - this.localTargetPrefix=param; - - - } - - - /** - * field for TargetGrants - */ - - - protected AccessControlList localTargetGrants ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTargetGrantsTracker = false ; - - - /** - * Auto generated getter method - * @return AccessControlList - */ - public AccessControlList getTargetGrants(){ - return localTargetGrants; - } - - - - /** - * Auto generated setter method - * @param param TargetGrants - */ - public void setTargetGrants(AccessControlList param){ - - if (param != null){ - //update the setting tracker - localTargetGrantsTracker = true; - } else { - localTargetGrantsTracker = false; - - } - - this.localTargetGrants=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - LoggingSettings.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":LoggingSettings", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "LoggingSettings", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"TargetBucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"TargetBucket"); - } - - } else { - xmlWriter.writeStartElement("TargetBucket"); - } - - - if (localTargetBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("TargetBucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localTargetBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"TargetPrefix", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"TargetPrefix"); - } - - } else { - xmlWriter.writeStartElement("TargetPrefix"); - } - - - if (localTargetPrefix==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("TargetPrefix cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localTargetPrefix); - - } - - xmlWriter.writeEndElement(); - if (localTargetGrantsTracker){ - if (localTargetGrants==null){ - throw new org.apache.axis2.databinding.ADBException("TargetGrants cannot be null!!"); - } - localTargetGrants.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetGrants"), - factory,xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "TargetBucket")); - - if (localTargetBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTargetBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("TargetBucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "TargetPrefix")); - - if (localTargetPrefix != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTargetPrefix)); - } else { - throw new org.apache.axis2.databinding.ADBException("TargetPrefix cannot be null!!"); - } - if (localTargetGrantsTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "TargetGrants")); - - - if (localTargetGrants==null){ - throw new org.apache.axis2.databinding.ADBException("TargetGrants cannot be null!!"); - } - elementList.add(localTargetGrants); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static LoggingSettings parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - LoggingSettings object = - new LoggingSettings(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"LoggingSettings".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LoggingSettings)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetBucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTargetBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetPrefix").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTargetPrefix( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetGrants").equals(reader.getName())){ - - object.setTargetGrants(AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class ExtensionMapper{ - - public static java.lang.Object getTypeObject(java.lang.String namespaceURI, - java.lang.String typeName, - javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListAllMyBucketsResult".equals(typeName)){ - - return ListAllMyBucketsResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "PutObjectResult".equals(typeName)){ - - return PutObjectResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "BucketLoggingStatus".equals(typeName)){ - - return BucketLoggingStatus.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "AccessControlList".equals(typeName)){ - - return AccessControlList.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListAllMyBucketsEntry".equals(typeName)){ - - return ListAllMyBucketsEntry.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "MetadataDirective".equals(typeName)){ - - return MetadataDirective.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListBucketResult".equals(typeName)){ - - return ListBucketResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "AccessControlPolicy".equals(typeName)){ - - return AccessControlPolicy.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "PrefixEntry".equals(typeName)){ - - return PrefixEntry.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "GetObjectResult".equals(typeName)){ - - return GetObjectResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Grant".equals(typeName)){ - - return Grant.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListAllMyBucketsList".equals(typeName)){ - - return ListAllMyBucketsList.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "CreateBucketResult".equals(typeName)){ - - return CreateBucketResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Status".equals(typeName)){ - - return Status.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "MetadataEntry".equals(typeName)){ - - return MetadataEntry.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "LoggingSettings".equals(typeName)){ - - return LoggingSettings.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "CopyObjectResult".equals(typeName)){ - - return CopyObjectResult.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "CanonicalUser".equals(typeName)){ - - return CanonicalUser.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "ListEntry".equals(typeName)){ - - return ListEntry.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Grantee".equals(typeName)){ - - return Grantee.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "StorageClass".equals(typeName)){ - - return StorageClass.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Permission".equals(typeName)){ - - return Permission.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "Result".equals(typeName)){ - - return Result.Factory.parse(reader); - - - } - - - if ( - "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && - "User".equals(typeName)){ - - return User.Factory.parse(reader); - - - } - - - throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); - } - - } - - public static class DeleteBucket - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteBucket", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - DeleteBucket.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":DeleteBucket", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "DeleteBucket", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static DeleteBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - DeleteBucket object = - new DeleteBucket(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"DeleteBucket".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteBucket)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class DeleteBucketResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteBucketResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for DeleteBucketResponse - */ - - - protected Status localDeleteBucketResponse ; - - - /** - * Auto generated getter method - * @return Status - */ - public Status getDeleteBucketResponse(){ - return localDeleteBucketResponse; - } - - - - /** - * Auto generated setter method - * @param param DeleteBucketResponse - */ - public void setDeleteBucketResponse(Status param){ - - this.localDeleteBucketResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - DeleteBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":DeleteBucketResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "DeleteBucketResponse", - xmlWriter); - } - - - } - - if (localDeleteBucketResponse==null){ - throw new org.apache.axis2.databinding.ADBException("DeleteBucketResponse cannot be null!!"); - } - localDeleteBucketResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteBucketResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DeleteBucketResponse")); - - - if (localDeleteBucketResponse==null){ - throw new org.apache.axis2.databinding.ADBException("DeleteBucketResponse cannot be null!!"); - } - elementList.add(localDeleteBucketResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static DeleteBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - DeleteBucketResponse object = - new DeleteBucketResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"DeleteBucketResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteBucketResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteBucketResponse").equals(reader.getName())){ - - object.setDeleteBucketResponse(Status.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class CopyObjectResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = CopyObjectResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for LastModified - */ - - - protected java.util.Calendar localLastModified ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getLastModified(){ - return localLastModified; - } - - - - /** - * Auto generated setter method - * @param param LastModified - */ - public void setLastModified(java.util.Calendar param){ - - this.localLastModified=param; - - - } - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CopyObjectResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CopyObjectResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CopyObjectResult", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"LastModified", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"LastModified"); - } - - } else { - xmlWriter.writeStartElement("LastModified"); - } - - - if (localLastModified==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LastModified")); - - if (localLastModified != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - } else { - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CopyObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CopyObjectResult object = - new CopyObjectResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CopyObjectResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CopyObjectResult)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLastModified( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class ListEntry - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListEntry - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for LastModified - */ - - - protected java.util.Calendar localLastModified ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getLastModified(){ - return localLastModified; - } - - - - /** - * Auto generated setter method - * @param param LastModified - */ - public void setLastModified(java.util.Calendar param){ - - this.localLastModified=param; - - - } - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * field for Size - */ - - - protected long localSize ; - - - /** - * Auto generated getter method - * @return long - */ - public long getSize(){ - return localSize; - } - - - - /** - * Auto generated setter method - * @param param Size - */ - public void setSize(long param){ - - this.localSize=param; - - - } - - - /** - * field for Owner - */ - - - protected CanonicalUser localOwner ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localOwnerTracker = false ; - - - /** - * Auto generated getter method - * @return CanonicalUser - */ - public CanonicalUser getOwner(){ - return localOwner; - } - - - - /** - * Auto generated setter method - * @param param Owner - */ - public void setOwner(CanonicalUser param){ - - if (param != null){ - //update the setting tracker - localOwnerTracker = true; - } else { - localOwnerTracker = false; - - } - - this.localOwner=param; - - - } - - - /** - * field for StorageClass - */ - - - protected StorageClass localStorageClass ; - - - /** - * Auto generated getter method - * @return StorageClass - */ - public StorageClass getStorageClass(){ - return localStorageClass; - } - - - - /** - * Auto generated setter method - * @param param StorageClass - */ - public void setStorageClass(StorageClass param){ - - this.localStorageClass=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListEntry.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListEntry", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListEntry", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"LastModified", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"LastModified"); - } - - } else { - xmlWriter.writeStartElement("LastModified"); - } - - - if (localLastModified==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Size", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Size"); - } - - } else { - xmlWriter.writeStartElement("Size"); - } - - if (localSize==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("Size cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); - } - - xmlWriter.writeEndElement(); - if (localOwnerTracker){ - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), - factory,xmlWriter); - } - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LastModified")); - - if (localLastModified != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - } else { - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Size")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); - if (localOwnerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Owner")); - - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - elementList.add(localOwner); - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass")); - - - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - elementList.add(localStorageClass); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListEntry object = - new ListEntry(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListEntry".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListEntry)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLastModified( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Size").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSize( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ - - object.setOwner(CanonicalUser.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ - - object.setStorageClass(StorageClass.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class Permission - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "Permission", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Permission - */ - - - protected java.lang.String localPermission ; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected Permission(java.lang.String value, boolean isRegisterValue) { - localPermission = value; - if (isRegisterValue){ - - _table_.put(localPermission, this); - - } - - } - - public static final java.lang.String _READ = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("READ"); - - public static final java.lang.String _WRITE = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("WRITE"); - - public static final java.lang.String _READ_ACP = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("READ_ACP"); - - public static final java.lang.String _WRITE_ACP = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("WRITE_ACP"); - - public static final java.lang.String _FULL_CONTROL = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FULL_CONTROL"); - - public static final Permission READ = - new Permission(_READ,true); - - public static final Permission WRITE = - new Permission(_WRITE,true); - - public static final Permission READ_ACP = - new Permission(_READ_ACP,true); - - public static final Permission WRITE_ACP = - new Permission(_WRITE_ACP,true); - - public static final Permission FULL_CONTROL = - new Permission(_FULL_CONTROL,true); - - - public java.lang.String getValue() { return localPermission;} - - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { - - return localPermission.toString(); - - - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Permission.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - //We can safely assume an element has only one type associated with it - - java.lang.String namespace = parentQName.getNamespaceURI(); - java.lang.String localName = parentQName.getLocalPart(); - - if (! namespace.equals("")) { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix, localName, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace, localName); - } - - } else { - xmlWriter.writeStartElement(localName); - } - - // add the type details if this is used in a simple type - if (serializeType){ - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Permission", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Permission", - xmlWriter); - } - } - - if (localPermission==null){ - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); - - }else{ - - xmlWriter.writeCharacters(localPermission); - - } - - xmlWriter.writeEndElement(); - - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - - //We can safely assume an element has only one type associated with it - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, - new java.lang.Object[]{ - org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPermission) - }, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - public static Permission fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - Permission enumeration = (Permission) - - _table_.get(value); - - - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static Permission fromString(java.lang.String value,java.lang.String namespaceURI) - throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } catch (java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static Permission fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, - java.lang.String content) { - if (content.indexOf(":") > -1){ - java.lang.String prefix = content.substring(0,content.indexOf(":")); - java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return Permission.Factory.fromString(content,namespaceUri); - } else { - return Permission.Factory.fromString(content,""); - } - } - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Permission parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Permission object = null; - // initialize a hash map to keep values - java.util.Map attributeMap = new java.util.HashMap(); - java.util.List extraAttributeList = new java.util.ArrayList(); - - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - while(!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()){ - - java.lang.String content = reader.getElementText(); - - if (content.indexOf(":") > 0) { - // this seems to be a Qname so find the namespace and send - prefix = content.substring(0, content.indexOf(":")); - namespaceuri = reader.getNamespaceURI(prefix); - object = Permission.Factory.fromString(content,namespaceuri); - } else { - // this seems to be not a qname send and empty namespace incase of it is - // check is done in fromString method - object = Permission.Factory.fromString(content,""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class Grantee - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = Grantee - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Grantee.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Grantee", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Grantee", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Grantee parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Grantee object = - null; - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"Grantee".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Grantee)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - throw new org.apache.axis2.databinding.ADBException("The an abstract class can not be instantiated !!!"); - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class ListAllMyBucketsResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = ListAllMyBucketsResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Owner - */ - - - protected CanonicalUser localOwner ; - - - /** - * Auto generated getter method - * @return CanonicalUser - */ - public CanonicalUser getOwner(){ - return localOwner; - } - - - - /** - * Auto generated setter method - * @param param Owner - */ - public void setOwner(CanonicalUser param){ - - this.localOwner=param; - - - } - - - /** - * field for Buckets - */ - - - protected ListAllMyBucketsList localBuckets ; - - - /** - * Auto generated getter method - * @return ListAllMyBucketsList - */ - public ListAllMyBucketsList getBuckets(){ - return localBuckets; - } - - - - /** - * Auto generated setter method - * @param param Buckets - */ - public void setBuckets(ListAllMyBucketsList param){ - - this.localBuckets=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListAllMyBucketsResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListAllMyBucketsResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListAllMyBucketsResult", - xmlWriter); - } - - - } - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), - factory,xmlWriter); - - if (localBuckets==null){ - throw new org.apache.axis2.databinding.ADBException("Buckets cannot be null!!"); - } - localBuckets.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Buckets"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Owner")); - - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - elementList.add(localOwner); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Buckets")); - - - if (localBuckets==null){ - throw new org.apache.axis2.databinding.ADBException("Buckets cannot be null!!"); - } - elementList.add(localBuckets); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListAllMyBucketsResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListAllMyBucketsResult object = - new ListAllMyBucketsResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListAllMyBucketsResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListAllMyBucketsResult)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ - - object.setOwner(CanonicalUser.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Buckets").equals(reader.getName())){ - - object.setBuckets(ListAllMyBucketsList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class CopyObject - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "CopyObject", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for SourceBucket - */ - - - protected java.lang.String localSourceBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSourceBucket(){ - return localSourceBucket; - } - - - - /** - * Auto generated setter method - * @param param SourceBucket - */ - public void setSourceBucket(java.lang.String param){ - - this.localSourceBucket=param; - - - } - - - /** - * field for SourceKey - */ - - - protected java.lang.String localSourceKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSourceKey(){ - return localSourceKey; - } - - - - /** - * Auto generated setter method - * @param param SourceKey - */ - public void setSourceKey(java.lang.String param){ - - this.localSourceKey=param; - - - } - - - /** - * field for DestinationBucket - */ - - - protected java.lang.String localDestinationBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDestinationBucket(){ - return localDestinationBucket; - } - - - - /** - * Auto generated setter method - * @param param DestinationBucket - */ - public void setDestinationBucket(java.lang.String param){ - - this.localDestinationBucket=param; - - - } - - - /** - * field for DestinationKey - */ - - - protected java.lang.String localDestinationKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDestinationKey(){ - return localDestinationKey; - } - - - - /** - * Auto generated setter method - * @param param DestinationKey - */ - public void setDestinationKey(java.lang.String param){ - - this.localDestinationKey=param; - - - } - - - /** - * field for MetadataDirective - */ - - - protected MetadataDirective localMetadataDirective ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataDirectiveTracker = false ; - - - /** - * Auto generated getter method - * @return MetadataDirective - */ - public MetadataDirective getMetadataDirective(){ - return localMetadataDirective; - } - - - - /** - * Auto generated setter method - * @param param MetadataDirective - */ - public void setMetadataDirective(MetadataDirective param){ - - if (param != null){ - //update the setting tracker - localMetadataDirectiveTracker = true; - } else { - localMetadataDirectiveTracker = false; - - } - - this.localMetadataDirective=param; - - - } - - - /** - * field for Metadata - * This was an Array! - */ - - - protected MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return MetadataEntry[] - */ - public MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(MetadataEntry[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param MetadataEntry - */ - public void addMetadata(MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (MetadataEntry[])list.toArray( - new MetadataEntry[list.size()]); - - } - - - /** - * field for AccessControlList - */ - - - protected AccessControlList localAccessControlList ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAccessControlListTracker = false ; - - - /** - * Auto generated getter method - * @return AccessControlList - */ - public AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(AccessControlList param){ - - if (param != null){ - //update the setting tracker - localAccessControlListTracker = true; - } else { - localAccessControlListTracker = false; - - } - - this.localAccessControlList=param; - - - } - - - /** - * field for CopySourceIfModifiedSince - */ - - - protected java.util.Calendar localCopySourceIfModifiedSince ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCopySourceIfModifiedSinceTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getCopySourceIfModifiedSince(){ - return localCopySourceIfModifiedSince; - } - - - - /** - * Auto generated setter method - * @param param CopySourceIfModifiedSince - */ - public void setCopySourceIfModifiedSince(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localCopySourceIfModifiedSinceTracker = true; - } else { - localCopySourceIfModifiedSinceTracker = false; - - } - - this.localCopySourceIfModifiedSince=param; - - - } - - - /** - * field for CopySourceIfUnmodifiedSince - */ - - - protected java.util.Calendar localCopySourceIfUnmodifiedSince ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCopySourceIfUnmodifiedSinceTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getCopySourceIfUnmodifiedSince(){ - return localCopySourceIfUnmodifiedSince; - } - - - - /** - * Auto generated setter method - * @param param CopySourceIfUnmodifiedSince - */ - public void setCopySourceIfUnmodifiedSince(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localCopySourceIfUnmodifiedSinceTracker = true; - } else { - localCopySourceIfUnmodifiedSinceTracker = false; - - } - - this.localCopySourceIfUnmodifiedSince=param; - - - } - - - /** - * field for CopySourceIfMatch - * This was an Array! - */ - - - protected java.lang.String[] localCopySourceIfMatch ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCopySourceIfMatchTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String[] - */ - public java.lang.String[] getCopySourceIfMatch(){ - return localCopySourceIfMatch; - } - - - - - - - /** - * validate the array for CopySourceIfMatch - */ - protected void validateCopySourceIfMatch(java.lang.String[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param CopySourceIfMatch - */ - public void setCopySourceIfMatch(java.lang.String[] param){ - - validateCopySourceIfMatch(param); - - - if (param != null){ - //update the setting tracker - localCopySourceIfMatchTracker = true; - } else { - localCopySourceIfMatchTracker = false; - - } - - this.localCopySourceIfMatch=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param java.lang.String - */ - public void addCopySourceIfMatch(java.lang.String param){ - if (localCopySourceIfMatch == null){ - localCopySourceIfMatch = new java.lang.String[]{}; - } - - - //update the setting tracker - localCopySourceIfMatchTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localCopySourceIfMatch); - list.add(param); - this.localCopySourceIfMatch = - (java.lang.String[])list.toArray( - new java.lang.String[list.size()]); - - } - - - /** - * field for CopySourceIfNoneMatch - * This was an Array! - */ - - - protected java.lang.String[] localCopySourceIfNoneMatch ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCopySourceIfNoneMatchTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String[] - */ - public java.lang.String[] getCopySourceIfNoneMatch(){ - return localCopySourceIfNoneMatch; - } - - - - - - - /** - * validate the array for CopySourceIfNoneMatch - */ - protected void validateCopySourceIfNoneMatch(java.lang.String[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param CopySourceIfNoneMatch - */ - public void setCopySourceIfNoneMatch(java.lang.String[] param){ - - validateCopySourceIfNoneMatch(param); - - - if (param != null){ - //update the setting tracker - localCopySourceIfNoneMatchTracker = true; - } else { - localCopySourceIfNoneMatchTracker = false; - - } - - this.localCopySourceIfNoneMatch=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param java.lang.String - */ - public void addCopySourceIfNoneMatch(java.lang.String param){ - if (localCopySourceIfNoneMatch == null){ - localCopySourceIfNoneMatch = new java.lang.String[]{}; - } - - - //update the setting tracker - localCopySourceIfNoneMatchTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localCopySourceIfNoneMatch); - list.add(param); - this.localCopySourceIfNoneMatch = - (java.lang.String[])list.toArray( - new java.lang.String[list.size()]); - - } - - - /** - * field for StorageClass - */ - - - protected StorageClass localStorageClass ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localStorageClassTracker = false ; - - - /** - * Auto generated getter method - * @return StorageClass - */ - public StorageClass getStorageClass(){ - return localStorageClass; - } - - - - /** - * Auto generated setter method - * @param param StorageClass - */ - public void setStorageClass(StorageClass param){ - - if (param != null){ - //update the setting tracker - localStorageClassTracker = true; - } else { - localStorageClassTracker = false; - - } - - this.localStorageClass=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CopyObject.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CopyObject", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CopyObject", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"SourceBucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"SourceBucket"); - } - - } else { - xmlWriter.writeStartElement("SourceBucket"); - } - - - if (localSourceBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("SourceBucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSourceBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"SourceKey", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"SourceKey"); - } - - } else { - xmlWriter.writeStartElement("SourceKey"); - } - - - if (localSourceKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("SourceKey cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSourceKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"DestinationBucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"DestinationBucket"); - } - - } else { - xmlWriter.writeStartElement("DestinationBucket"); - } - - - if (localDestinationBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("DestinationBucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDestinationBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"DestinationKey", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"DestinationKey"); - } - - } else { - xmlWriter.writeStartElement("DestinationKey"); - } - - - if (localDestinationKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("DestinationKey cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDestinationKey); - - } - - xmlWriter.writeEndElement(); - if (localMetadataDirectiveTracker){ - if (localMetadataDirective==null){ - throw new org.apache.axis2.databinding.ADBException("MetadataDirective cannot be null!!"); - } - localMetadataDirective.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MetadataDirective"), - factory,xmlWriter); - } if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } if (localAccessControlListTracker){ - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - } if (localCopySourceIfModifiedSinceTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"CopySourceIfModifiedSince", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"CopySourceIfModifiedSince"); - } - - } else { - xmlWriter.writeStartElement("CopySourceIfModifiedSince"); - } - - - if (localCopySourceIfModifiedSince==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfModifiedSince cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfModifiedSince)); - - } - - xmlWriter.writeEndElement(); - } if (localCopySourceIfUnmodifiedSinceTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"CopySourceIfUnmodifiedSince", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"CopySourceIfUnmodifiedSince"); - } - - } else { - xmlWriter.writeStartElement("CopySourceIfUnmodifiedSince"); - } - - - if (localCopySourceIfUnmodifiedSince==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfUnmodifiedSince cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfUnmodifiedSince)); - - } - - xmlWriter.writeEndElement(); - } if (localCopySourceIfMatchTracker){ - if (localCopySourceIfMatch!=null) { - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - boolean emptyNamespace = namespace == null || namespace.length() == 0; - prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); - for (int i = 0;i < localCopySourceIfMatch.length;i++){ - - if (localCopySourceIfMatch[i] != null){ - - if (!emptyNamespace) { - if (prefix == null) { - java.lang.String prefix2 = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix2,"CopySourceIfMatch", namespace); - xmlWriter.writeNamespace(prefix2, namespace); - xmlWriter.setPrefix(prefix2, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"CopySourceIfMatch"); - } - - } else { - xmlWriter.writeStartElement("CopySourceIfMatch"); - } - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfMatch[i])); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfMatch cannot be null!!"); - - } - - } if (localCopySourceIfNoneMatchTracker){ - if (localCopySourceIfNoneMatch!=null) { - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - boolean emptyNamespace = namespace == null || namespace.length() == 0; - prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); - for (int i = 0;i < localCopySourceIfNoneMatch.length;i++){ - - if (localCopySourceIfNoneMatch[i] != null){ - - if (!emptyNamespace) { - if (prefix == null) { - java.lang.String prefix2 = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix2,"CopySourceIfNoneMatch", namespace); - xmlWriter.writeNamespace(prefix2, namespace); - xmlWriter.setPrefix(prefix2, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"CopySourceIfNoneMatch"); - } - - } else { - xmlWriter.writeStartElement("CopySourceIfNoneMatch"); - } - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfNoneMatch[i])); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfNoneMatch cannot be null!!"); - - } - - } if (localStorageClassTracker){ - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), - factory,xmlWriter); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "SourceBucket")); - - if (localSourceBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSourceBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("SourceBucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "SourceKey")); - - if (localSourceKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSourceKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("SourceKey cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DestinationBucket")); - - if (localDestinationBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDestinationBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("DestinationBucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DestinationKey")); - - if (localDestinationKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDestinationKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("DestinationKey cannot be null!!"); - } - if (localMetadataDirectiveTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "MetadataDirective")); - - - if (localMetadataDirective==null){ - throw new org.apache.axis2.databinding.ADBException("MetadataDirective cannot be null!!"); - } - elementList.add(localMetadataDirective); - } if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } if (localAccessControlListTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - } if (localCopySourceIfModifiedSinceTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CopySourceIfModifiedSince")); - - if (localCopySourceIfModifiedSince != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfModifiedSince)); - } else { - throw new org.apache.axis2.databinding.ADBException("CopySourceIfModifiedSince cannot be null!!"); - } - } if (localCopySourceIfUnmodifiedSinceTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CopySourceIfUnmodifiedSince")); - - if (localCopySourceIfUnmodifiedSince != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfUnmodifiedSince)); - } else { - throw new org.apache.axis2.databinding.ADBException("CopySourceIfUnmodifiedSince cannot be null!!"); - } - } if (localCopySourceIfMatchTracker){ - if (localCopySourceIfMatch!=null){ - for (int i = 0;i < localCopySourceIfMatch.length;i++){ - - if (localCopySourceIfMatch[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CopySourceIfMatch")); - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfMatch[i])); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfMatch cannot be null!!"); - - } - - } if (localCopySourceIfNoneMatchTracker){ - if (localCopySourceIfNoneMatch!=null){ - for (int i = 0;i < localCopySourceIfNoneMatch.length;i++){ - - if (localCopySourceIfNoneMatch[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CopySourceIfNoneMatch")); - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfNoneMatch[i])); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("CopySourceIfNoneMatch cannot be null!!"); - - } - - } if (localStorageClassTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass")); - - - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - elementList.add(localStorageClass); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CopyObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CopyObject object = - new CopyObject(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CopyObject".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CopyObject)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list6 = new java.util.ArrayList(); - - java.util.ArrayList list10 = new java.util.ArrayList(); - - java.util.ArrayList list11 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","SourceBucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSourceBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","SourceKey").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSourceKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DestinationBucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDestinationBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DestinationKey").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDestinationKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MetadataDirective").equals(reader.getName())){ - - object.setMetadataDirective(MetadataDirective.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list6.add(MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone6 = false; - while(!loopDone6){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone6 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list6.add(MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone6 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - MetadataEntry.class, - list6)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfModifiedSince").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCopySourceIfModifiedSince( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfUnmodifiedSince").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCopySourceIfUnmodifiedSince( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfMatch").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list10.add(reader.getElementText()); - - //loop until we find a start element that is not part of this array - boolean loopDone10 = false; - while(!loopDone10){ - // Ensure we are at the EndElement - while (!reader.isEndElement()){ - reader.next(); - } - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone10 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfMatch").equals(reader.getName())){ - list10.add(reader.getElementText()); - - }else{ - loopDone10 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCopySourceIfMatch((java.lang.String[]) - list10.toArray(new java.lang.String[list10.size()])); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfNoneMatch").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list11.add(reader.getElementText()); - - //loop until we find a start element that is not part of this array - boolean loopDone11 = false; - while(!loopDone11){ - // Ensure we are at the EndElement - while (!reader.isEndElement()){ - reader.next(); - } - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone11 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfNoneMatch").equals(reader.getName())){ - list11.add(reader.getElementText()); - - }else{ - loopDone11 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCopySourceIfNoneMatch((java.lang.String[]) - list11.toArray(new java.lang.String[list11.size()])); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ - - object.setStorageClass(StorageClass.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class BucketLoggingStatus - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = BucketLoggingStatus - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for LoggingEnabled - */ - - - protected LoggingSettings localLoggingEnabled ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localLoggingEnabledTracker = false ; - - - /** - * Auto generated getter method - * @return LoggingSettings - */ - public LoggingSettings getLoggingEnabled(){ - return localLoggingEnabled; - } - - - - /** - * Auto generated setter method - * @param param LoggingEnabled - */ - public void setLoggingEnabled(LoggingSettings param){ - - if (param != null){ - //update the setting tracker - localLoggingEnabledTracker = true; - } else { - localLoggingEnabledTracker = false; - - } - - this.localLoggingEnabled=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - BucketLoggingStatus.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":BucketLoggingStatus", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "BucketLoggingStatus", - xmlWriter); - } - - - } - if (localLoggingEnabledTracker){ - if (localLoggingEnabled==null){ - throw new org.apache.axis2.databinding.ADBException("LoggingEnabled cannot be null!!"); - } - localLoggingEnabled.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LoggingEnabled"), - factory,xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localLoggingEnabledTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LoggingEnabled")); - - - if (localLoggingEnabled==null){ - throw new org.apache.axis2.databinding.ADBException("LoggingEnabled cannot be null!!"); - } - elementList.add(localLoggingEnabled); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static BucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - BucketLoggingStatus object = - new BucketLoggingStatus(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"BucketLoggingStatus".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (BucketLoggingStatus)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LoggingEnabled").equals(reader.getName())){ - - object.setLoggingEnabled(LoggingSettings.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class PutObject - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "PutObject", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for Metadata - * This was an Array! - */ - - - protected MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return MetadataEntry[] - */ - public MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(MetadataEntry[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param MetadataEntry - */ - public void addMetadata(MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (MetadataEntry[])list.toArray( - new MetadataEntry[list.size()]); - - } - - - /** - * field for ContentLength - */ - - - protected long localContentLength ; - - - /** - * Auto generated getter method - * @return long - */ - public long getContentLength(){ - return localContentLength; - } - - - - /** - * Auto generated setter method - * @param param ContentLength - */ - public void setContentLength(long param){ - - this.localContentLength=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected AccessControlList localAccessControlList ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAccessControlListTracker = false ; - - - /** - * Auto generated getter method - * @return AccessControlList - */ - public AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(AccessControlList param){ - - if (param != null){ - //update the setting tracker - localAccessControlListTracker = true; - } else { - localAccessControlListTracker = false; - - } - - this.localAccessControlList=param; - - - } - - - /** - * field for StorageClass - */ - - - protected StorageClass localStorageClass ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localStorageClassTracker = false ; - - - /** - * Auto generated getter method - * @return StorageClass - */ - public StorageClass getStorageClass(){ - return localStorageClass; - } - - - - /** - * Auto generated setter method - * @param param StorageClass - */ - public void setStorageClass(StorageClass param){ - - if (param != null){ - //update the setting tracker - localStorageClassTracker = true; - } else { - localStorageClassTracker = false; - - } - - this.localStorageClass=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PutObject.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PutObject", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PutObject", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ContentLength", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ContentLength"); - } - - } else { - xmlWriter.writeStartElement("ContentLength"); - } - - if (localContentLength==java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("ContentLength cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); - } - - xmlWriter.writeEndElement(); - if (localAccessControlListTracker){ - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - } if (localStorageClassTracker){ - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), - factory,xmlWriter); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ContentLength")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); - if (localAccessControlListTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - } if (localStorageClassTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass")); - - - if (localStorageClass==null){ - throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); - } - elementList.add(localStorageClass); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PutObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PutObject object = - new PutObject(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PutObject".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PutObject)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list3 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list3.add(MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone3 = false; - while(!loopDone3){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone3 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list3.add(MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone3 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - MetadataEntry.class, - list3)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ContentLength").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setContentLength( - org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ - - object.setStorageClass(StorageClass.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class MetadataDirective - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "MetadataDirective", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for MetadataDirective - */ - - - protected java.lang.String localMetadataDirective ; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected MetadataDirective(java.lang.String value, boolean isRegisterValue) { - localMetadataDirective = value; - if (isRegisterValue){ - - _table_.put(localMetadataDirective, this); - - } - - } - - public static final java.lang.String _COPY = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("COPY"); - - public static final java.lang.String _REPLACE = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("REPLACE"); - - public static final MetadataDirective COPY = - new MetadataDirective(_COPY,true); - - public static final MetadataDirective REPLACE = - new MetadataDirective(_REPLACE,true); - - - public java.lang.String getValue() { return localMetadataDirective;} - - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { - - return localMetadataDirective.toString(); - - - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - MetadataDirective.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - //We can safely assume an element has only one type associated with it - - java.lang.String namespace = parentQName.getNamespaceURI(); - java.lang.String localName = parentQName.getLocalPart(); - - if (! namespace.equals("")) { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix, localName, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace, localName); - } - - } else { - xmlWriter.writeStartElement(localName); - } - - // add the type details if this is used in a simple type - if (serializeType){ - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":MetadataDirective", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "MetadataDirective", - xmlWriter); - } - } - - if (localMetadataDirective==null){ - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); - - }else{ - - xmlWriter.writeCharacters(localMetadataDirective); - - } - - xmlWriter.writeEndElement(); - - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - - //We can safely assume an element has only one type associated with it - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, - new java.lang.Object[]{ - org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMetadataDirective) - }, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - public static MetadataDirective fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - MetadataDirective enumeration = (MetadataDirective) - - _table_.get(value); - - - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static MetadataDirective fromString(java.lang.String value,java.lang.String namespaceURI) - throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } catch (java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static MetadataDirective fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, - java.lang.String content) { - if (content.indexOf(":") > -1){ - java.lang.String prefix = content.substring(0,content.indexOf(":")); - java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return MetadataDirective.Factory.fromString(content,namespaceUri); - } else { - return MetadataDirective.Factory.fromString(content,""); - } - } - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static MetadataDirective parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - MetadataDirective object = null; - // initialize a hash map to keep values - java.util.Map attributeMap = new java.util.HashMap(); - java.util.List extraAttributeList = new java.util.ArrayList(); - - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - while(!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()){ - - java.lang.String content = reader.getElementText(); - - if (content.indexOf(":") > 0) { - // this seems to be a Qname so find the namespace and send - prefix = content.substring(0, content.indexOf(":")); - namespaceuri = reader.getNamespaceURI(prefix); - object = MetadataDirective.Factory.fromString(content,namespaceuri); - } else { - // this seems to be not a qname send and empty namespace incase of it is - // check is done in fromString method - object = MetadataDirective.Factory.fromString(content,""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetObjectResult extends Result - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = GetObjectResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Metadata - * This was an Array! - */ - - - protected MetadataEntry[] localMetadata ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMetadataTracker = false ; - - - /** - * Auto generated getter method - * @return MetadataEntry[] - */ - public MetadataEntry[] getMetadata(){ - return localMetadata; - } - - - - - - - /** - * validate the array for Metadata - */ - protected void validateMetadata(MetadataEntry[] param){ - - } - - - /** - * Auto generated setter method - * @param param Metadata - */ - public void setMetadata(MetadataEntry[] param){ - - validateMetadata(param); - - - if (param != null){ - //update the setting tracker - localMetadataTracker = true; - } else { - localMetadataTracker = false; - - } - - this.localMetadata=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param MetadataEntry - */ - public void addMetadata(MetadataEntry param){ - if (localMetadata == null){ - localMetadata = new MetadataEntry[]{}; - } - - - //update the setting tracker - localMetadataTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); - list.add(param); - this.localMetadata = - (MetadataEntry[])list.toArray( - new MetadataEntry[list.size()]); - - } - - - /** - * field for Data - */ - - - protected javax.activation.DataHandler localData ; - - - /** - * Auto generated getter method - * @return javax.activation.DataHandler - */ - public javax.activation.DataHandler getData(){ - return localData; - } - - - - /** - * Auto generated setter method - * @param param Data - */ - public void setData(javax.activation.DataHandler param){ - - this.localData=param; - - - } - - - /** - * field for LastModified - */ - - - protected java.util.Calendar localLastModified ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getLastModified(){ - return localLastModified; - } - - - - /** - * Auto generated setter method - * @param param LastModified - */ - public void setLastModified(java.util.Calendar param){ - - this.localLastModified=param; - - - } - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectResult", - xmlWriter); - } - - - if (localStatus==null){ - throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); - } - localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status"), - factory,xmlWriter); - if (localMetadataTracker){ - if (localMetadata!=null){ - for (int i = 0;i < localMetadata.length;i++){ - if (localMetadata[i] != null){ - localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - } - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Data", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Data"); - } - - } else { - xmlWriter.writeStartElement("Data"); - } - - - if (localData!=null) - { - xmlWriter.writeDataHandler(localData); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"LastModified", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"LastModified"); - } - - } else { - xmlWriter.writeStartElement("LastModified"); - } - - - if (localLastModified==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); - attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResult")); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Status")); - - - if (localStatus==null){ - throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); - } - elementList.add(localStatus); - if (localMetadataTracker){ - if (localMetadata!=null) { - for (int i = 0;i < localMetadata.length;i++){ - - if (localMetadata[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Metadata")); - elementList.add(localMetadata[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); - - } - - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Data")); - - elementList.add(localData); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LastModified")); - - if (localLastModified != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - } else { - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectResult object = - new GetObjectResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectResult)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list2 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status").equals(reader.getName())){ - - object.setStatus(Status.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list2.add(MetadataEntry.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone2 = false; - while(!loopDone2){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone2 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ - list2.add(MetadataEntry.Factory.parse(reader)); - - }else{ - loopDone2 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMetadata((MetadataEntry[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - MetadataEntry.class, - list2)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Data").equals(reader.getName())){ - reader.next(); - if (isReaderMTOMAware(reader) - && - java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))) - { - //MTOM aware reader - get the datahandler directly and put it in the object - object.setData( - (javax.activation.DataHandler) reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER)); - } else { - if (reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT && reader.getName().equals(new javax.xml.namespace.QName(org.apache.axiom.om.impl.MTOMConstants.XOP_NAMESPACE_URI, org.apache.axiom.om.impl.MTOMConstants.XOP_INCLUDE))) - { - java.lang.String id = org.apache.axiom.om.util.ElementHelper.getContentID(reader, "UTF-8"); - object.setData(((org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder) ((org.apache.axiom.om.impl.llom.OMStAXWrapper) reader).getBuilder()).getDataHandler(id)); - reader.next(); - - reader.next(); - - } else if(reader.hasText()) { - //Do the usual conversion - java.lang.String content = reader.getText(); - object.setData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBase64Binary(content)); - - reader.next(); - - } - } - - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLastModified( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class Grant - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = Grant - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Grantee - */ - - - protected Grantee localGrantee ; - - - /** - * Auto generated getter method - * @return Grantee - */ - public Grantee getGrantee(){ - return localGrantee; - } - - - - /** - * Auto generated setter method - * @param param Grantee - */ - public void setGrantee(Grantee param){ - - this.localGrantee=param; - - - } - - - /** - * field for Permission - */ - - - protected Permission localPermission ; - - - /** - * Auto generated getter method - * @return Permission - */ - public Permission getPermission(){ - return localPermission; - } - - - - /** - * Auto generated setter method - * @param param Permission - */ - public void setPermission(Permission param){ - - this.localPermission=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Grant.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Grant", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Grant", - xmlWriter); - } - - - } - - if (localGrantee==null){ - throw new org.apache.axis2.databinding.ADBException("Grantee cannot be null!!"); - } - localGrantee.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grantee"), - factory,xmlWriter); - - if (localPermission==null){ - throw new org.apache.axis2.databinding.ADBException("Permission cannot be null!!"); - } - localPermission.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Permission"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Grantee")); - - - if (localGrantee==null){ - throw new org.apache.axis2.databinding.ADBException("Grantee cannot be null!!"); - } - elementList.add(localGrantee); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Permission")); - - - if (localPermission==null){ - throw new org.apache.axis2.databinding.ADBException("Permission cannot be null!!"); - } - elementList.add(localPermission); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Grant parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Grant object = - new Grant(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"Grant".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Grant)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grantee").equals(reader.getName())){ - - object.setGrantee(Grantee.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Permission").equals(reader.getName())){ - - object.setPermission(Permission.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetBucketAccessControlPolicyResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketAccessControlPolicyResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for GetBucketAccessControlPolicyResponse - */ - - - protected AccessControlPolicy localGetBucketAccessControlPolicyResponse ; - - - /** - * Auto generated getter method - * @return AccessControlPolicy - */ - public AccessControlPolicy getGetBucketAccessControlPolicyResponse(){ - return localGetBucketAccessControlPolicyResponse; - } - - - - /** - * Auto generated setter method - * @param param GetBucketAccessControlPolicyResponse - */ - public void setGetBucketAccessControlPolicyResponse(AccessControlPolicy param){ - - this.localGetBucketAccessControlPolicyResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetBucketAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetBucketAccessControlPolicyResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetBucketAccessControlPolicyResponse", - xmlWriter); - } - - - } - - if (localGetBucketAccessControlPolicyResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetBucketAccessControlPolicyResponse cannot be null!!"); - } - localGetBucketAccessControlPolicyResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketAccessControlPolicyResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketAccessControlPolicyResponse")); - - - if (localGetBucketAccessControlPolicyResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetBucketAccessControlPolicyResponse cannot be null!!"); - } - elementList.add(localGetBucketAccessControlPolicyResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetBucketAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetBucketAccessControlPolicyResponse object = - new GetBucketAccessControlPolicyResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetBucketAccessControlPolicyResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetBucketAccessControlPolicyResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketAccessControlPolicyResponse").equals(reader.getName())){ - - object.setGetBucketAccessControlPolicyResponse(AccessControlPolicy.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class SetObjectAccessControlPolicyResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetObjectAccessControlPolicyResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetObjectAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetObjectAccessControlPolicyResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetObjectAccessControlPolicyResponse", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetObjectAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetObjectAccessControlPolicyResponse object = - new SetObjectAccessControlPolicyResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetObjectAccessControlPolicyResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetObjectAccessControlPolicyResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class SetObjectAccessControlPolicy - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetObjectAccessControlPolicy", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected AccessControlList localAccessControlList ; - - - /** - * Auto generated getter method - * @return AccessControlList - */ - public AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(AccessControlList param){ - - this.localAccessControlList=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetObjectAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetObjectAccessControlPolicy", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetObjectAccessControlPolicy", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetObjectAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetObjectAccessControlPolicy object = - new SetObjectAccessControlPolicy(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetObjectAccessControlPolicy".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetObjectAccessControlPolicy)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class ListBucket - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "ListBucket", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Prefix - */ - - - protected java.lang.String localPrefix ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localPrefixTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getPrefix(){ - return localPrefix; - } - - - - /** - * Auto generated setter method - * @param param Prefix - */ - public void setPrefix(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localPrefixTracker = true; - } else { - localPrefixTracker = false; - - } - - this.localPrefix=param; - - - } - - - /** - * field for Marker - */ - - - protected java.lang.String localMarker ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMarkerTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getMarker(){ - return localMarker; - } - - - - /** - * Auto generated setter method - * @param param Marker - */ - public void setMarker(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localMarkerTracker = true; - } else { - localMarkerTracker = false; - - } - - this.localMarker=param; - - - } - - - /** - * field for MaxKeys - */ - - - protected int localMaxKeys ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localMaxKeysTracker = false ; - - - /** - * Auto generated getter method - * @return int - */ - public int getMaxKeys(){ - return localMaxKeys; - } - - - - /** - * Auto generated setter method - * @param param MaxKeys - */ - public void setMaxKeys(int param){ - - // setting primitive attribute tracker to true - - if (param==java.lang.Integer.MIN_VALUE) { - localMaxKeysTracker = false; - - } else { - localMaxKeysTracker = true; - } - - this.localMaxKeys=param; - - - } - - - /** - * field for Delimiter - */ - - - protected java.lang.String localDelimiter ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localDelimiterTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDelimiter(){ - return localDelimiter; - } - - - - /** - * Auto generated setter method - * @param param Delimiter - */ - public void setDelimiter(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localDelimiterTracker = true; - } else { - localDelimiterTracker = false; - - } - - this.localDelimiter=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListBucket.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListBucket", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListBucket", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localPrefixTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Prefix", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Prefix"); - } - - } else { - xmlWriter.writeStartElement("Prefix"); - } - - - if (localPrefix==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localPrefix); - - } - - xmlWriter.writeEndElement(); - } if (localMarkerTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Marker", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Marker"); - } - - } else { - xmlWriter.writeStartElement("Marker"); - } - - - if (localMarker==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localMarker); - - } - - xmlWriter.writeEndElement(); - } if (localMaxKeysTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"MaxKeys", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"MaxKeys"); - } - - } else { - xmlWriter.writeStartElement("MaxKeys"); - } - - if (localMaxKeys==java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); - } - - xmlWriter.writeEndElement(); - } if (localDelimiterTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Delimiter", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Delimiter"); - } - - } else { - xmlWriter.writeStartElement("Delimiter"); - } - - - if (localDelimiter==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDelimiter); - - } - - xmlWriter.writeEndElement(); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localPrefixTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Prefix")); - - if (localPrefix != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); - } else { - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - } - } if (localMarkerTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Marker")); - - if (localMarker != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMarker)); - } else { - throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); - } - } if (localMaxKeysTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "MaxKeys")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); - } if (localDelimiterTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Delimiter")); - - if (localDelimiter != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); - } else { - throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); - } - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListBucket object = - new ListBucket(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListBucket".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListBucket)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setPrefix( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Marker").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setMarker( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MaxKeys").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setMaxKeys( - org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setMaxKeys(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Delimiter").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDelimiter( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class MetadataEntry - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = MetadataEntry - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Name - */ - - - protected java.lang.String localName ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getName(){ - return localName; - } - - - - /** - * Auto generated setter method - * @param param Name - */ - public void setName(java.lang.String param){ - - this.localName=param; - - - } - - - /** - * field for Value - */ - - - protected java.lang.String localValue ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getValue(){ - return localValue; - } - - - - /** - * Auto generated setter method - * @param param Value - */ - public void setValue(java.lang.String param){ - - this.localValue=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - MetadataEntry.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":MetadataEntry", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "MetadataEntry", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Name", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Name"); - } - - } else { - xmlWriter.writeStartElement("Name"); - } - - - if (localName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localName); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Value", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Value"); - } - - } else { - xmlWriter.writeStartElement("Value"); - } - - - if (localValue==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localValue); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Name")); - - if (localName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Value")); - - if (localValue != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue)); - } else { - throw new org.apache.axis2.databinding.ADBException("Value cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static MetadataEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - MetadataEntry object = - new MetadataEntry(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"MetadataEntry".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (MetadataEntry)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Value").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setValue( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetBucketAccessControlPolicy - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketAccessControlPolicy", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetBucketAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetBucketAccessControlPolicy", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetBucketAccessControlPolicy", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetBucketAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetBucketAccessControlPolicy object = - new GetBucketAccessControlPolicy(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetBucketAccessControlPolicy".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetBucketAccessControlPolicy)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetObjectExtendedResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectExtendedResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for GetObjectResponse - */ - - - protected GetObjectResult localGetObjectResponse ; - - - /** - * Auto generated getter method - * @return GetObjectResult - */ - public GetObjectResult getGetObjectResponse(){ - return localGetObjectResponse; - } - - - - /** - * Auto generated setter method - * @param param GetObjectResponse - */ - public void setGetObjectResponse(GetObjectResult param){ - - this.localGetObjectResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectExtendedResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectExtendedResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectExtendedResponse", - xmlWriter); - } - - - } - - if (localGetObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); - } - localGetObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectResponse")); - - - if (localGetObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); - } - elementList.add(localGetObjectResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectExtendedResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectExtendedResponse object = - new GetObjectExtendedResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectExtendedResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectExtendedResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse").equals(reader.getName())){ - - object.setGetObjectResponse(GetObjectResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class StorageClass - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "StorageClass", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for StorageClass - */ - - - protected java.lang.String localStorageClass ; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected StorageClass(java.lang.String value, boolean isRegisterValue) { - localStorageClass = value; - if (isRegisterValue){ - - _table_.put(localStorageClass, this); - - } - - } - - public static final java.lang.String _STANDARD = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("STANDARD"); - - public static final java.lang.String _UNKNOWN = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("UNKNOWN"); - - public static final StorageClass STANDARD = - new StorageClass(_STANDARD,true); - - public static final StorageClass UNKNOWN = - new StorageClass(_UNKNOWN,true); - - - public java.lang.String getValue() { return localStorageClass;} - - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { - - return localStorageClass.toString(); - - - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - StorageClass.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - //We can safely assume an element has only one type associated with it - - java.lang.String namespace = parentQName.getNamespaceURI(); - java.lang.String localName = parentQName.getLocalPart(); - - if (! namespace.equals("")) { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix, localName, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace, localName); - } - - } else { - xmlWriter.writeStartElement(localName); - } - - // add the type details if this is used in a simple type - if (serializeType){ - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":StorageClass", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "StorageClass", - xmlWriter); - } - } - - if (localStorageClass==null){ - - throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); - - }else{ - - xmlWriter.writeCharacters(localStorageClass); - - } - - xmlWriter.writeEndElement(); - - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - - //We can safely assume an element has only one type associated with it - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, - new java.lang.Object[]{ - org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStorageClass) - }, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - public static StorageClass fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - StorageClass enumeration = (StorageClass) - - _table_.get(value); - - - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static StorageClass fromString(java.lang.String value,java.lang.String namespaceURI) - throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } catch (java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static StorageClass fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, - java.lang.String content) { - if (content.indexOf(":") > -1){ - java.lang.String prefix = content.substring(0,content.indexOf(":")); - java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return StorageClass.Factory.fromString(content,namespaceUri); - } else { - return StorageClass.Factory.fromString(content,""); - } - } - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static StorageClass parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - StorageClass object = null; - // initialize a hash map to keep values - java.util.Map attributeMap = new java.util.HashMap(); - java.util.List extraAttributeList = new java.util.ArrayList(); - - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - while(!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()){ - - java.lang.String content = reader.getElementText(); - - if (content.indexOf(":") > 0) { - // this seems to be a Qname so find the namespace and send - prefix = content.substring(0, content.indexOf(":")); - namespaceuri = reader.getNamespaceURI(prefix); - object = StorageClass.Factory.fromString(content,namespaceuri); - } else { - // this seems to be not a qname send and empty namespace incase of it is - // check is done in fromString method - object = StorageClass.Factory.fromString(content,""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class PutObjectResult - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = PutObjectResult - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * field for LastModified - */ - - - protected java.util.Calendar localLastModified ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getLastModified(){ - return localLastModified; - } - - - - /** - * Auto generated setter method - * @param param LastModified - */ - public void setLastModified(java.util.Calendar param){ - - this.localLastModified=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PutObjectResult.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PutObjectResult", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PutObjectResult", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"LastModified", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"LastModified"); - } - - } else { - xmlWriter.writeStartElement("LastModified"); - } - - - if (localLastModified==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "LastModified")); - - if (localLastModified != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); - } else { - throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PutObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PutObjectResult object = - new PutObjectResult(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PutObjectResult".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PutObjectResult)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLastModified( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class AccessControlList - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = AccessControlList - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Grant - * This was an Array! - */ - - - protected Grant[] localGrant ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localGrantTracker = false ; - - - /** - * Auto generated getter method - * @return Grant[] - */ - public Grant[] getGrant(){ - return localGrant; - } - - - - - - - /** - * validate the array for Grant - */ - protected void validateGrant(Grant[] param){ - - if ((param != null) && (param.length > 100)){ - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * @param param Grant - */ - public void setGrant(Grant[] param){ - - validateGrant(param); - - - if (param != null){ - //update the setting tracker - localGrantTracker = true; - } else { - localGrantTracker = false; - - } - - this.localGrant=param; - } - - - - /** - * Auto generated add method for the array for convenience - * @param param Grant - */ - public void addGrant(Grant param){ - if (localGrant == null){ - localGrant = new Grant[]{}; - } - - - //update the setting tracker - localGrantTracker = true; - - - java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(localGrant); - list.add(param); - this.localGrant = - (Grant[])list.toArray( - new Grant[list.size()]); - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - AccessControlList.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":AccessControlList", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "AccessControlList", - xmlWriter); - } - - - } - if (localGrantTracker){ - if (localGrant!=null){ - for (int i = 0;i < localGrant.length;i++){ - if (localGrant[i] != null){ - localGrant[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant"), - factory,xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Grant cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - if (localGrantTracker){ - if (localGrant!=null) { - for (int i = 0;i < localGrant.length;i++){ - - if (localGrant[i] != null){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Grant")); - elementList.add(localGrant[i]); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Grant cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static AccessControlList parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - AccessControlList object = - new AccessControlList(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"AccessControlList".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AccessControlList)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant").equals(reader.getName())){ - - - - // Process the array and step past its final element's end. - list1.add(Grant.Factory.parse(reader)); - - //loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while(!loopDone1){ - // We should be at the end element, but make sure - while (!reader.isEndElement()) - reader.next(); - // Step out of this element - reader.next(); - // Step to next element event. - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - if (reader.isEndElement()){ - //two continuous end elements means we are exiting the xml structure - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant").equals(reader.getName())){ - list1.add(Grant.Factory.parse(reader)); - - }else{ - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setGrant((Grant[]) - org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( - Grant.class, - list1)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class ListBucketResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "ListBucketResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for ListBucketResponse - */ - - - protected ListBucketResult localListBucketResponse ; - - - /** - * Auto generated getter method - * @return ListBucketResult - */ - public ListBucketResult getListBucketResponse(){ - return localListBucketResponse; - } - - - - /** - * Auto generated setter method - * @param param ListBucketResponse - */ - public void setListBucketResponse(ListBucketResult param){ - - this.localListBucketResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - ListBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":ListBucketResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "ListBucketResponse", - xmlWriter); - } - - - } - - if (localListBucketResponse==null){ - throw new org.apache.axis2.databinding.ADBException("ListBucketResponse cannot be null!!"); - } - localListBucketResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListBucketResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ListBucketResponse")); - - - if (localListBucketResponse==null){ - throw new org.apache.axis2.databinding.ADBException("ListBucketResponse cannot be null!!"); - } - elementList.add(localListBucketResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static ListBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - ListBucketResponse object = - new ListBucketResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"ListBucketResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListBucketResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListBucketResponse").equals(reader.getName())){ - - object.setListBucketResponse(ListBucketResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class AccessControlPolicy - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = AccessControlPolicy - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Owner - */ - - - protected CanonicalUser localOwner ; - - - /** - * Auto generated getter method - * @return CanonicalUser - */ - public CanonicalUser getOwner(){ - return localOwner; - } - - - - /** - * Auto generated setter method - * @param param Owner - */ - public void setOwner(CanonicalUser param){ - - this.localOwner=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected AccessControlList localAccessControlList ; - - - /** - * Auto generated getter method - * @return AccessControlList - */ - public AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(AccessControlList param){ - - this.localAccessControlList=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - AccessControlPolicy.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":AccessControlPolicy", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "AccessControlPolicy", - xmlWriter); - } - - - } - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), - factory,xmlWriter); - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Owner")); - - - if (localOwner==null){ - throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); - } - elementList.add(localOwner); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static AccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - AccessControlPolicy object = - new AccessControlPolicy(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"AccessControlPolicy".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AccessControlPolicy)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ - - object.setOwner(CanonicalUser.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class PrefixEntry - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = PrefixEntry - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Prefix - */ - - - protected java.lang.String localPrefix ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getPrefix(){ - return localPrefix; - } - - - - /** - * Auto generated setter method - * @param param Prefix - */ - public void setPrefix(java.lang.String param){ - - this.localPrefix=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PrefixEntry.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PrefixEntry", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PrefixEntry", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Prefix", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Prefix"); - } - - } else { - xmlWriter.writeStartElement("Prefix"); - } - - - if (localPrefix==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localPrefix); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Prefix")); - - if (localPrefix != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); - } else { - throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PrefixEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PrefixEntry object = - new PrefixEntry(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PrefixEntry".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PrefixEntry)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setPrefix( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetObjectAccessControlPolicy - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectAccessControlPolicy", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectAccessControlPolicy", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectAccessControlPolicy", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectAccessControlPolicy object = - new GetObjectAccessControlPolicy(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectAccessControlPolicy".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectAccessControlPolicy)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetObject - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObject", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for GetMetadata - */ - - - protected boolean localGetMetadata ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getGetMetadata(){ - return localGetMetadata; - } - - - - /** - * Auto generated setter method - * @param param GetMetadata - */ - public void setGetMetadata(boolean param){ - - this.localGetMetadata=param; - - - } - - - /** - * field for GetData - */ - - - protected boolean localGetData ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getGetData(){ - return localGetData; - } - - - - /** - * Auto generated setter method - * @param param GetData - */ - public void setGetData(boolean param){ - - this.localGetData=param; - - - } - - - /** - * field for InlineData - */ - - - protected boolean localInlineData ; - - - /** - * Auto generated getter method - * @return boolean - */ - public boolean getInlineData(){ - return localInlineData; - } - - - - /** - * Auto generated setter method - * @param param InlineData - */ - public void setInlineData(boolean param){ - - this.localInlineData=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObject.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObject", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObject", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"GetMetadata", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"GetMetadata"); - } - - } else { - xmlWriter.writeStartElement("GetMetadata"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("GetMetadata cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"GetData", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"GetData"); - } - - } else { - xmlWriter.writeStartElement("GetData"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("GetData cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"InlineData", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"InlineData"); - } - - } else { - xmlWriter.writeStartElement("InlineData"); - } - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("InlineData cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetMetadata")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetData")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "InlineData")); - - elementList.add( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObject object = - new GetObject(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObject".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObject)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetMetadata").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setGetMetadata( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetData").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setGetData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","InlineData").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setInlineData( - org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class CanonicalUser extends User - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = CanonicalUser - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for ID - */ - - - protected java.lang.String localID ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getID(){ - return localID; - } - - - - /** - * Auto generated setter method - * @param param ID - */ - public void setID(java.lang.String param){ - - this.localID=param; - - - } - - - /** - * field for DisplayName - */ - - - protected java.lang.String localDisplayName ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localDisplayNameTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getDisplayName(){ - return localDisplayName; - } - - - - /** - * Auto generated setter method - * @param param DisplayName - */ - public void setDisplayName(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localDisplayNameTracker = true; - } else { - localDisplayNameTracker = false; - - } - - this.localDisplayName=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CanonicalUser.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CanonicalUser", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CanonicalUser", - xmlWriter); - } - - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ID", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ID"); - } - - } else { - xmlWriter.writeStartElement("ID"); - } - - - if (localID==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ID cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localID); - - } - - xmlWriter.writeEndElement(); - if (localDisplayNameTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"DisplayName", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"DisplayName"); - } - - } else { - xmlWriter.writeStartElement("DisplayName"); - } - - - if (localDisplayName==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("DisplayName cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localDisplayName); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); - attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CanonicalUser")); - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ID")); - - if (localID != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localID)); - } else { - throw new org.apache.axis2.databinding.ADBException("ID cannot be null!!"); - } - if (localDisplayNameTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "DisplayName")); - - if (localDisplayName != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDisplayName)); - } else { - throw new org.apache.axis2.databinding.ADBException("DisplayName cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CanonicalUser parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CanonicalUser object = - new CanonicalUser(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CanonicalUser".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CanonicalUser)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ID").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setID( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DisplayName").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setDisplayName( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetBucketLoggingStatusResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketLoggingStatusResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for GetBucketLoggingStatusResponse - */ - - - protected BucketLoggingStatus localGetBucketLoggingStatusResponse ; - - - /** - * Auto generated getter method - * @return BucketLoggingStatus - */ - public BucketLoggingStatus getGetBucketLoggingStatusResponse(){ - return localGetBucketLoggingStatusResponse; - } - - - - /** - * Auto generated setter method - * @param param GetBucketLoggingStatusResponse - */ - public void setGetBucketLoggingStatusResponse(BucketLoggingStatus param){ - - this.localGetBucketLoggingStatusResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetBucketLoggingStatusResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetBucketLoggingStatusResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetBucketLoggingStatusResponse", - xmlWriter); - } - - - } - - if (localGetBucketLoggingStatusResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetBucketLoggingStatusResponse cannot be null!!"); - } - localGetBucketLoggingStatusResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketLoggingStatusResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetBucketLoggingStatusResponse")); - - - if (localGetBucketLoggingStatusResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetBucketLoggingStatusResponse cannot be null!!"); - } - elementList.add(localGetBucketLoggingStatusResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetBucketLoggingStatusResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetBucketLoggingStatusResponse object = - new GetBucketLoggingStatusResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetBucketLoggingStatusResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetBucketLoggingStatusResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketLoggingStatusResponse").equals(reader.getName())){ - - object.setGetBucketLoggingStatusResponse(BucketLoggingStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class Result - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = Result - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Status - */ - - - protected Status localStatus ; - - - /** - * Auto generated getter method - * @return Status - */ - public Status getStatus(){ - return localStatus; - } - - - - /** - * Auto generated setter method - * @param param Status - */ - public void setStatus(Status param){ - - this.localStatus=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - Result.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":Result", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "Result", - xmlWriter); - } - - - } - - if (localStatus==null){ - throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); - } - localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Status")); - - - if (localStatus==null){ - throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); - } - elementList.add(localStatus); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static Result parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - Result object = - new Result(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"Result".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Result)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status").equals(reader.getName())){ - - object.setStatus(Status.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class CopyObjectResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "CopyObjectResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for CopyObjectResult - */ - - - protected CopyObjectResult localCopyObjectResult ; - - - /** - * Auto generated getter method - * @return CopyObjectResult - */ - public CopyObjectResult getCopyObjectResult(){ - return localCopyObjectResult; - } - - - - /** - * Auto generated setter method - * @param param CopyObjectResult - */ - public void setCopyObjectResult(CopyObjectResult param){ - - this.localCopyObjectResult=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CopyObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CopyObjectResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CopyObjectResponse", - xmlWriter); - } - - - } - - if (localCopyObjectResult==null){ - throw new org.apache.axis2.databinding.ADBException("CopyObjectResult cannot be null!!"); - } - localCopyObjectResult.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopyObjectResult"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "CopyObjectResult")); - - - if (localCopyObjectResult==null){ - throw new org.apache.axis2.databinding.ADBException("CopyObjectResult cannot be null!!"); - } - elementList.add(localCopyObjectResult); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CopyObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CopyObjectResponse object = - new CopyObjectResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CopyObjectResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CopyObjectResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopyObjectResult").equals(reader.getName())){ - - object.setCopyObjectResult(CopyObjectResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class GetObjectResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for GetObjectResponse - */ - - - protected GetObjectResult localGetObjectResponse ; - - - /** - * Auto generated getter method - * @return GetObjectResult - */ - public GetObjectResult getGetObjectResponse(){ - return localGetObjectResponse; - } - - - - /** - * Auto generated setter method - * @param param GetObjectResponse - */ - public void setGetObjectResponse(GetObjectResult param){ - - this.localGetObjectResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - GetObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":GetObjectResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "GetObjectResponse", - xmlWriter); - } - - - } - - if (localGetObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); - } - localGetObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "GetObjectResponse")); - - - if (localGetObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); - } - elementList.add(localGetObjectResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static GetObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - GetObjectResponse object = - new GetObjectResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"GetObjectResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetObjectResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse").equals(reader.getName())){ - - object.setGetObjectResponse(GetObjectResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class PutObjectInlineResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "PutObjectInlineResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for PutObjectInlineResponse - */ - - - protected PutObjectResult localPutObjectInlineResponse ; - - - /** - * Auto generated getter method - * @return PutObjectResult - */ - public PutObjectResult getPutObjectInlineResponse(){ - return localPutObjectInlineResponse; - } - - - - /** - * Auto generated setter method - * @param param PutObjectInlineResponse - */ - public void setPutObjectInlineResponse(PutObjectResult param){ - - this.localPutObjectInlineResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PutObjectInlineResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PutObjectInlineResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PutObjectInlineResponse", - xmlWriter); - } - - - } - - if (localPutObjectInlineResponse==null){ - throw new org.apache.axis2.databinding.ADBException("PutObjectInlineResponse cannot be null!!"); - } - localPutObjectInlineResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectInlineResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "PutObjectInlineResponse")); - - - if (localPutObjectInlineResponse==null){ - throw new org.apache.axis2.databinding.ADBException("PutObjectInlineResponse cannot be null!!"); - } - elementList.add(localPutObjectInlineResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PutObjectInlineResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PutObjectInlineResponse object = - new PutObjectInlineResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PutObjectInlineResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PutObjectInlineResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectInlineResponse").equals(reader.getName())){ - - object.setPutObjectInlineResponse(PutObjectResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class CreateBucket - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "CreateBucket", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AccessControlList - */ - - - protected AccessControlList localAccessControlList ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAccessControlListTracker = false ; - - - /** - * Auto generated getter method - * @return AccessControlList - */ - public AccessControlList getAccessControlList(){ - return localAccessControlList; - } - - - - /** - * Auto generated setter method - * @param param AccessControlList - */ - public void setAccessControlList(AccessControlList param){ - - if (param != null){ - //update the setting tracker - localAccessControlListTracker = true; - } else { - localAccessControlListTracker = false; - - } - - this.localAccessControlList=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - CreateBucket.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":CreateBucket", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "CreateBucket", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAccessControlListTracker){ - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), - factory,xmlWriter); - } if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAccessControlListTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AccessControlList")); - - - if (localAccessControlList==null){ - throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); - } - elementList.add(localAccessControlList); - } if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static CreateBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - CreateBucket object = - new CreateBucket(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"CreateBucket".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CreateBucket)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ - - object.setAccessControlList(AccessControlList.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class PutObjectResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "PutObjectResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for PutObjectResponse - */ - - - protected PutObjectResult localPutObjectResponse ; - - - /** - * Auto generated getter method - * @return PutObjectResult - */ - public PutObjectResult getPutObjectResponse(){ - return localPutObjectResponse; - } - - - - /** - * Auto generated setter method - * @param param PutObjectResponse - */ - public void setPutObjectResponse(PutObjectResult param){ - - this.localPutObjectResponse=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PutObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PutObjectResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PutObjectResponse", - xmlWriter); - } - - - } - - if (localPutObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("PutObjectResponse cannot be null!!"); - } - localPutObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectResponse"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "PutObjectResponse")); - - - if (localPutObjectResponse==null){ - throw new org.apache.axis2.databinding.ADBException("PutObjectResponse cannot be null!!"); - } - elementList.add(localPutObjectResponse); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PutObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PutObjectResponse object = - new PutObjectResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PutObjectResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PutObjectResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectResponse").equals(reader.getName())){ - - object.setPutObjectResponse(PutObjectResult.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class PostResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "PostResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Location - */ - - - protected org.apache.axis2.databinding.types.URI localLocation ; - - - /** - * Auto generated getter method - * @return org.apache.axis2.databinding.types.URI - */ - public org.apache.axis2.databinding.types.URI getLocation(){ - return localLocation; - } - - - - /** - * Auto generated setter method - * @param param Location - */ - public void setLocation(org.apache.axis2.databinding.types.URI param){ - - this.localLocation=param; - - - } - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getKey(){ - return localKey; - } - - - - /** - * Auto generated setter method - * @param param Key - */ - public void setKey(java.lang.String param){ - - this.localKey=param; - - - } - - - /** - * field for ETag - */ - - - protected java.lang.String localETag ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getETag(){ - return localETag; - } - - - - /** - * Auto generated setter method - * @param param ETag - */ - public void setETag(java.lang.String param){ - - this.localETag=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - PostResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":PostResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "PostResponse", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Location", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Location"); - } - - } else { - xmlWriter.writeStartElement("Location"); - } - - - if (localLocation==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Location cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocation)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Key", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Key"); - } - - } else { - xmlWriter.writeStartElement("Key"); - } - - - if (localKey==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localKey); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"ETag", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"ETag"); - } - - } else { - xmlWriter.writeStartElement("ETag"); - } - - - if (localETag==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localETag); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Location")); - - if (localLocation != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocation)); - } else { - throw new org.apache.axis2.databinding.ADBException("Location cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Key")); - - if (localKey != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); - } else { - throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "ETag")); - - if (localETag != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); - } else { - throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static PostResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - PostResponse object = - new PostResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"PostResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PostResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Location").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setLocation( - org.apache.axis2.databinding.utils.ConverterUtil.convertToAnyURI(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setKey( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setETag( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class SetBucketAccessControlPolicyResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetBucketAccessControlPolicyResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetBucketAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetBucketAccessControlPolicyResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetBucketAccessControlPolicyResponse", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetBucketAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetBucketAccessControlPolicyResponse object = - new SetBucketAccessControlPolicyResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetBucketAccessControlPolicyResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetBucketAccessControlPolicyResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class SetBucketLoggingStatusResponse - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetBucketLoggingStatusResponse", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetBucketLoggingStatusResponse.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetBucketLoggingStatusResponse", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetBucketLoggingStatusResponse", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetBucketLoggingStatusResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetBucketLoggingStatusResponse object = - new SetBucketLoggingStatusResponse(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetBucketLoggingStatusResponse".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetBucketLoggingStatusResponse)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class User extends Grantee - implements org.apache.axis2.databinding.ADBBean{ - /* This type was generated from the piece of schema that had - name = User - Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ - Namespace Prefix = ns1 - */ - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - User.this.serialize(parentQName,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - parentQName,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":User", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "User", - xmlWriter); - } - - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); - attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","User")); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static User parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - User object = - null; - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"User".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (User)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - throw new org.apache.axis2.databinding.ADBException("The an abstract class can not be instantiated !!!"); - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - public static class SetBucketLoggingStatus - implements org.apache.axis2.databinding.ADBBean{ - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://s3.amazonaws.com/doc/2006-03-01/", - "SetBucketLoggingStatus", - "ns1"); - - - - private static java.lang.String generatePrefix(java.lang.String namespace) { - if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - - - /** - * field for Bucket - */ - - - protected java.lang.String localBucket ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getBucket(){ - return localBucket; - } - - - - /** - * Auto generated setter method - * @param param Bucket - */ - public void setBucket(java.lang.String param){ - - this.localBucket=param; - - - } - - - /** - * field for AWSAccessKeyId - */ - - - protected java.lang.String localAWSAccessKeyId ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localAWSAccessKeyIdTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getAWSAccessKeyId(){ - return localAWSAccessKeyId; - } - - - - /** - * Auto generated setter method - * @param param AWSAccessKeyId - */ - public void setAWSAccessKeyId(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localAWSAccessKeyIdTracker = true; - } else { - localAWSAccessKeyIdTracker = false; - - } - - this.localAWSAccessKeyId=param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localTimestampTracker = false ; - - - /** - * Auto generated getter method - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp(){ - return localTimestamp; - } - - - - /** - * Auto generated setter method - * @param param Timestamp - */ - public void setTimestamp(java.util.Calendar param){ - - if (param != null){ - //update the setting tracker - localTimestampTracker = true; - } else { - localTimestampTracker = false; - - } - - this.localTimestamp=param; - - - } - - - /** - * field for Signature - */ - - - protected java.lang.String localSignature ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localSignatureTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getSignature(){ - return localSignature; - } - - - - /** - * Auto generated setter method - * @param param Signature - */ - public void setSignature(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localSignatureTracker = true; - } else { - localSignatureTracker = false; - - } - - this.localSignature=param; - - - } - - - /** - * field for Credential - */ - - - protected java.lang.String localCredential ; - - /* This tracker boolean wil be used to detect whether the user called the set method - * for this attribute. It will be used to determine whether to include this field - * in the serialized XML - */ - protected boolean localCredentialTracker = false ; - - - /** - * Auto generated getter method - * @return java.lang.String - */ - public java.lang.String getCredential(){ - return localCredential; - } - - - - /** - * Auto generated setter method - * @param param Credential - */ - public void setCredential(java.lang.String param){ - - if (param != null){ - //update the setting tracker - localCredentialTracker = true; - } else { - localCredentialTracker = false; - - } - - this.localCredential=param; - - - } - - - /** - * field for BucketLoggingStatus - */ - - - protected BucketLoggingStatus localBucketLoggingStatus ; - - - /** - * Auto generated getter method - * @return BucketLoggingStatus - */ - public BucketLoggingStatus getBucketLoggingStatus(){ - return localBucketLoggingStatus; - } - - - - /** - * Auto generated setter method - * @param param BucketLoggingStatus - */ - public void setBucketLoggingStatus(BucketLoggingStatus param){ - - this.localBucketLoggingStatus=param; - - - } - - - /** - * isReaderMTOMAware - * @return true if the reader supports MTOM - */ - public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { - boolean isReaderMTOMAware = false; - - try{ - isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); - }catch(java.lang.IllegalArgumentException e){ - isReaderMTOMAware = false; - } - return isReaderMTOMAware; - } - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getOMElement ( - final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ - - - - org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ - - public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - SetBucketLoggingStatus.this.serialize(MY_QNAME,factory,xmlWriter); - } - }; - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( - MY_QNAME,factory,dataSource); - - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - serialize(parentQName,factory,xmlWriter,false); - } - - public void serialize(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory, - org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, - boolean serializeType) - throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ - - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - - if ((namespace != null) && (namespace.trim().length() > 0)) { - java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); - } else { - if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } else { - xmlWriter.writeStartElement(parentQName.getLocalPart()); - } - - if (serializeType){ - - - java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); - if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - namespacePrefix+":SetBucketLoggingStatus", - xmlWriter); - } else { - writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", - "SetBucketLoggingStatus", - xmlWriter); - } - - - } - - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Bucket", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Bucket"); - } - - } else { - xmlWriter.writeStartElement("Bucket"); - } - - - if (localBucket==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localBucket); - - } - - xmlWriter.writeEndElement(); - if (localAWSAccessKeyIdTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); - } - - } else { - xmlWriter.writeStartElement("AWSAccessKeyId"); - } - - - if (localAWSAccessKeyId==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localAWSAccessKeyId); - - } - - xmlWriter.writeEndElement(); - } if (localTimestampTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Timestamp", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Timestamp"); - } - - } else { - xmlWriter.writeStartElement("Timestamp"); - } - - - if (localTimestamp==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - - } - - xmlWriter.writeEndElement(); - } if (localSignatureTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Signature", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Signature"); - } - - } else { - xmlWriter.writeStartElement("Signature"); - } - - - if (localSignature==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localSignature); - - } - - xmlWriter.writeEndElement(); - } if (localCredentialTracker){ - namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; - if (! namespace.equals("")) { - prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - xmlWriter.writeStartElement(prefix,"Credential", namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } else { - xmlWriter.writeStartElement(namespace,"Credential"); - } - - } else { - xmlWriter.writeStartElement("Credential"); - } - - - if (localCredential==null){ - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - - }else{ - - - xmlWriter.writeCharacters(localCredential); - - } - - xmlWriter.writeEndElement(); - } - if (localBucketLoggingStatus==null){ - throw new org.apache.axis2.databinding.ADBException("BucketLoggingStatus cannot be null!!"); - } - localBucketLoggingStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketLoggingStatus"), - factory,xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - - } - - xmlWriter.writeAttribute(namespace,attName,attValue); - - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(java.lang.String namespace,java.lang.String attName, - java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ - if (namespace.equals("")) - { - xmlWriter.writeAttribute(attName,attValue); - } - else - { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace,attName,attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, - javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - /** - * method to handle Qnames - */ - - private void writeQName(javax.xml.namespace.QName qname, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(javax.xml.namespace.QName[] qnames, - javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if ((prefix == null) || (prefix.length() == 0)) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix,namespaceURI); - } - - if (prefix.trim().length() > 0){ - stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - - if (prefix == null) { - prefix = generatePrefix(namespace); - - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) - throws org.apache.axis2.databinding.ADBException{ - - - - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Bucket")); - - if (localBucket != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); - } else { - throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); - } - if (localAWSAccessKeyIdTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "AWSAccessKeyId")); - - if (localAWSAccessKeyId != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); - } else { - throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); - } - } if (localTimestampTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Timestamp")); - - if (localTimestamp != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); - } - } if (localSignatureTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Signature")); - - if (localSignature != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); - } else { - throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); - } - } if (localCredentialTracker){ - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "Credential")); - - if (localCredential != null){ - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); - } else { - throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); - } - } - elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", - "BucketLoggingStatus")); - - - if (localBucketLoggingStatus==null){ - throw new org.apache.axis2.databinding.ADBException("BucketLoggingStatus cannot be null!!"); - } - elementList.add(localBucketLoggingStatus); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory{ - - - - - /** - * static method to create the object - * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable - * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element - * Postcondition: If this object is an element, the reader is positioned at its end element - * If this object is a complex type, the reader is positioned at the end element of its outer element - */ - public static SetBucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ - SetBucketLoggingStatus object = - new SetBucketLoggingStatus(); - - int event; - java.lang.String nillableValue = null; - java.lang.String prefix =""; - java.lang.String namespaceuri =""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ - java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", - "type"); - if (fullTypeName!=null){ - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1){ - nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix==null?"":nsPrefix; - - java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); - - if (!"SetBucketLoggingStatus".equals(type)){ - //find namespace for the prefix - java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SetBucketLoggingStatus)ExtensionMapper.getTypeObject( - nsUri,type,reader); - } - - - } - - - } - - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - java.util.Vector handledAttributes = new java.util.Vector(); - - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setBucket( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setAWSAccessKeyId( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setTimestamp( - org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setSignature( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ - - java.lang.String content = reader.getElementText(); - - object.setCredential( - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketLoggingStatus").equals(reader.getName())){ - - object.setBucketLoggingStatus(BucketLoggingStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else{ - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) - reader.next(); - - if (reader.isStartElement()) - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); - - - - - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }//end of factory class - - - - } - - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.CopyObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CopyObject.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.ListBucket param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListBucket.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.ListBucketResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.PutObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObject.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.PutObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.CreateBucket param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CreateBucket.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObject.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.DeleteBucket param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteBucket.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.DeleteObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteObject.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.PutObjectInline param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectInline.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObjectExtended param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse param, boolean optimizeContent) - throws org.apache.axis2.AxisFault { - - - try{ - return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.CopyObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CopyObject.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.ListBucket param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListBucket.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.PutObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObject.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.CreateBucket param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CreateBucket.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObject.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.DeleteBucket param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteBucket.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.DeleteObject param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteObject.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.PutObjectInline param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectInline.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetObjectExtended param, boolean optimizeContent) - throws org.apache.axis2.AxisFault{ - - - try{ - - org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.MY_QNAME,factory)); - return emptyEnvelope; - } catch(org.apache.axis2.databinding.ADBException e){ - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - /* methods to provide back word compatibility */ - - - - - /** - * get the default envelope - */ - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){ - return factory.getDefaultEnvelope(); - } - - - private java.lang.Object fromOM( - org.apache.axiom.om.OMElement param, - java.lang.Class type, - java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{ - - try { - - if (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.CopyObject.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.CopyObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.ListBucket.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.ListBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.PutObject.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.PutObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.CreateBucket.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.CreateBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.GetObject.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.GetObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.DeleteBucket.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.DeleteBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.DeleteObject.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.DeleteObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.PutObjectInline.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.PutObjectInline.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.class.equals(type)){ - - return com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - } catch (java.lang.Exception e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - return null; - } - - - - - } +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/** + * AmazonS3Stub.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) + */ + package com.amazon.s3.client; + + + + /* + * AmazonS3Stub java implementation + */ + + + public class AmazonS3Stub extends org.apache.axis2.client.Stub + { + protected org.apache.axis2.description.AxisOperation[] _operations; + + //hashmaps to keep the fault mapping + private java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); + private java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); + private java.util.HashMap faultMessageMap = new java.util.HashMap(); + + private static int counter = 0; + + private static synchronized java.lang.String getUniqueSuffix(){ + // reset the counter if it is greater than 99999 + if (counter > 99999){ + counter = 0; + } + counter = counter + 1; + return java.lang.Long.toString(System.currentTimeMillis()) + "_" + counter; + } + + + private void populateAxisService() throws org.apache.axis2.AxisFault { + + //creating the Service with a unique name + _service = new org.apache.axis2.description.AxisService("AmazonS3" + getUniqueSuffix()); + addAnonymousOperations(); + + //creating the operations + org.apache.axis2.description.AxisOperation __operation; + + _operations = new org.apache.axis2.description.AxisOperation[16]; + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getBucketLoggingStatus")); + _service.addOperation(__operation); + + + + + _operations[0]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "copyObject")); + _service.addOperation(__operation); + + + + + _operations[1]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getBucketAccessControlPolicy")); + _service.addOperation(__operation); + + + + + _operations[2]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "listBucket")); + _service.addOperation(__operation); + + + + + _operations[3]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "putObject")); + _service.addOperation(__operation); + + + + + _operations[4]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "createBucket")); + _service.addOperation(__operation); + + + + + _operations[5]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "listAllMyBuckets")); + _service.addOperation(__operation); + + + + + _operations[6]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getObject")); + _service.addOperation(__operation); + + + + + _operations[7]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "deleteBucket")); + _service.addOperation(__operation); + + + + + _operations[8]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "setBucketLoggingStatus")); + _service.addOperation(__operation); + + + + + _operations[9]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getObjectAccessControlPolicy")); + _service.addOperation(__operation); + + + + + _operations[10]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "deleteObject")); + _service.addOperation(__operation); + + + + + _operations[11]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "setBucketAccessControlPolicy")); + _service.addOperation(__operation); + + + + + _operations[12]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "setObjectAccessControlPolicy")); + _service.addOperation(__operation); + + + + + _operations[13]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "putObjectInline")); + _service.addOperation(__operation); + + + + + _operations[14]=__operation; + + + __operation = new org.apache.axis2.description.OutInAxisOperation(); + + + __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getObjectExtended")); + _service.addOperation(__operation); + + + + + _operations[15]=__operation; + + + } + + //populates the faults + private void populateFaults(){ + + + + } + + /** + *Constructor that takes in a configContext + */ + + public AmazonS3Stub(org.apache.axis2.context.ConfigurationContext configurationContext, + java.lang.String targetEndpoint) + throws org.apache.axis2.AxisFault { + this(configurationContext,targetEndpoint,false); + } + + + /** + * Constructor that takes in a configContext and useseperate listner + */ + public AmazonS3Stub(org.apache.axis2.context.ConfigurationContext configurationContext, + java.lang.String targetEndpoint, boolean useSeparateListener) + throws org.apache.axis2.AxisFault { + //To populate AxisService + populateAxisService(); + populateFaults(); + + _serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service); + + + _serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference( + targetEndpoint)); + _serviceClient.getOptions().setUseSeparateListener(useSeparateListener); + + + } + + /** + * Default Constructor + */ + public AmazonS3Stub(org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { + + this(configurationContext,"http://s3.cloud.com/soap" ); + + } + + /** + * Default Constructor + */ + public AmazonS3Stub() throws org.apache.axis2.AxisFault { + + this("http://s3.cloud.com/soap" ); + + } + + /** + * Constructor taking the target endpoint + */ + public AmazonS3Stub(java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { + this(null,targetEndpoint); + } + + + + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#getBucketLoggingStatus + * @param getBucketLoggingStatus0 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse getBucketLoggingStatus( + + com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus getBucketLoggingStatus0) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketLoggingStatusRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + getBucketLoggingStatus0, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "getBucketLoggingStatus"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startgetBucketLoggingStatus + * @param getBucketLoggingStatus0 + + */ + public void startgetBucketLoggingStatus( + + com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus getBucketLoggingStatus0, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketLoggingStatusRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + getBucketLoggingStatus0, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "getBucketLoggingStatus"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultgetBucketLoggingStatus( + (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorgetBucketLoggingStatus(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorgetBucketLoggingStatus(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketLoggingStatus(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketLoggingStatus(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketLoggingStatus(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketLoggingStatus(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketLoggingStatus(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketLoggingStatus(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketLoggingStatus(f); + } + } else { + callback.receiveErrorgetBucketLoggingStatus(f); + } + } else { + callback.receiveErrorgetBucketLoggingStatus(f); + } + } else { + callback.receiveErrorgetBucketLoggingStatus(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorgetBucketLoggingStatus(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[0].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[0].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#copyObject + * @param copyObject2 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse copyObject( + + com.amazon.s3.client.AmazonS3Stub.CopyObject copyObject2) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CopyObjectRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + copyObject2, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "copyObject"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startcopyObject + * @param copyObject2 + + */ + public void startcopyObject( + + com.amazon.s3.client.AmazonS3Stub.CopyObject copyObject2, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CopyObjectRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + copyObject2, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "copyObject"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultcopyObject( + (com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorcopyObject(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorcopyObject(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcopyObject(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcopyObject(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcopyObject(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcopyObject(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcopyObject(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcopyObject(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcopyObject(f); + } + } else { + callback.receiveErrorcopyObject(f); + } + } else { + callback.receiveErrorcopyObject(f); + } + } else { + callback.receiveErrorcopyObject(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorcopyObject(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[1].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[1].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#getBucketAccessControlPolicy + * @param getBucketAccessControlPolicy4 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse getBucketAccessControlPolicy( + + com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy getBucketAccessControlPolicy4) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketAccessControlPolicyRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + getBucketAccessControlPolicy4, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "getBucketAccessControlPolicy"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startgetBucketAccessControlPolicy + * @param getBucketAccessControlPolicy4 + + */ + public void startgetBucketAccessControlPolicy( + + com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy getBucketAccessControlPolicy4, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketAccessControlPolicyRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + getBucketAccessControlPolicy4, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "getBucketAccessControlPolicy"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultgetBucketAccessControlPolicy( + (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorgetBucketAccessControlPolicy(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorgetBucketAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketAccessControlPolicy(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketAccessControlPolicy(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketAccessControlPolicy(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketAccessControlPolicy(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketAccessControlPolicy(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketAccessControlPolicy(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetBucketAccessControlPolicy(f); + } + } else { + callback.receiveErrorgetBucketAccessControlPolicy(f); + } + } else { + callback.receiveErrorgetBucketAccessControlPolicy(f); + } + } else { + callback.receiveErrorgetBucketAccessControlPolicy(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorgetBucketAccessControlPolicy(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[2].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[2].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#listBucket + * @param listBucket6 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.ListBucketResponse listBucket( + + com.amazon.s3.client.AmazonS3Stub.ListBucket listBucket6) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[3].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListBucketRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + listBucket6, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "listBucket"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.ListBucketResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startlistBucket + * @param listBucket6 + + */ + public void startlistBucket( + + com.amazon.s3.client.AmazonS3Stub.ListBucket listBucket6, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[3].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListBucketRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + listBucket6, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "listBucket"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultlistBucket( + (com.amazon.s3.client.AmazonS3Stub.ListBucketResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorlistBucket(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorlistBucket(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistBucket(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistBucket(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistBucket(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistBucket(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistBucket(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistBucket(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistBucket(f); + } + } else { + callback.receiveErrorlistBucket(f); + } + } else { + callback.receiveErrorlistBucket(f); + } + } else { + callback.receiveErrorlistBucket(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorlistBucket(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[3].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[3].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#putObject + * @param putObject8 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.PutObjectResponse putObject( + + com.amazon.s3.client.AmazonS3Stub.PutObject putObject8) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[4].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + putObject8, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "putObject"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.PutObjectResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startputObject + * @param putObject8 + + */ + public void startputObject( + + com.amazon.s3.client.AmazonS3Stub.PutObject putObject8, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[4].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + putObject8, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "putObject"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultputObject( + (com.amazon.s3.client.AmazonS3Stub.PutObjectResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorputObject(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorputObject(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObject(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObject(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObject(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObject(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObject(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObject(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObject(f); + } + } else { + callback.receiveErrorputObject(f); + } + } else { + callback.receiveErrorputObject(f); + } + } else { + callback.receiveErrorputObject(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorputObject(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[4].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[4].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#createBucket + * @param createBucket10 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse createBucket( + + com.amazon.s3.client.AmazonS3Stub.CreateBucket createBucket10) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[5].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CreateBucketRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + createBucket10, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "createBucket"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startcreateBucket + * @param createBucket10 + + */ + public void startcreateBucket( + + com.amazon.s3.client.AmazonS3Stub.CreateBucket createBucket10, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[5].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CreateBucketRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + createBucket10, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "createBucket"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultcreateBucket( + (com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorcreateBucket(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorcreateBucket(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcreateBucket(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcreateBucket(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcreateBucket(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcreateBucket(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcreateBucket(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcreateBucket(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorcreateBucket(f); + } + } else { + callback.receiveErrorcreateBucket(f); + } + } else { + callback.receiveErrorcreateBucket(f); + } + } else { + callback.receiveErrorcreateBucket(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorcreateBucket(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[5].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[5].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#listAllMyBuckets + * @param listAllMyBuckets12 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse listAllMyBuckets( + + com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets listAllMyBuckets12) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[6].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListAllMyBucketsRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + listAllMyBuckets12, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "listAllMyBuckets"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startlistAllMyBuckets + * @param listAllMyBuckets12 + + */ + public void startlistAllMyBuckets( + + com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets listAllMyBuckets12, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[6].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListAllMyBucketsRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + listAllMyBuckets12, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "listAllMyBuckets"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultlistAllMyBuckets( + (com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorlistAllMyBuckets(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorlistAllMyBuckets(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistAllMyBuckets(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistAllMyBuckets(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistAllMyBuckets(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistAllMyBuckets(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistAllMyBuckets(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistAllMyBuckets(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorlistAllMyBuckets(f); + } + } else { + callback.receiveErrorlistAllMyBuckets(f); + } + } else { + callback.receiveErrorlistAllMyBuckets(f); + } + } else { + callback.receiveErrorlistAllMyBuckets(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorlistAllMyBuckets(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[6].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[6].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#getObject + * @param getObject14 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.GetObjectResponse getObject( + + com.amazon.s3.client.AmazonS3Stub.GetObject getObject14) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[7].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + getObject14, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "getObject"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.GetObjectResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startgetObject + * @param getObject14 + + */ + public void startgetObject( + + com.amazon.s3.client.AmazonS3Stub.GetObject getObject14, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[7].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + getObject14, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "getObject"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultgetObject( + (com.amazon.s3.client.AmazonS3Stub.GetObjectResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorgetObject(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorgetObject(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObject(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObject(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObject(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObject(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObject(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObject(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObject(f); + } + } else { + callback.receiveErrorgetObject(f); + } + } else { + callback.receiveErrorgetObject(f); + } + } else { + callback.receiveErrorgetObject(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorgetObject(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[7].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[7].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#deleteBucket + * @param deleteBucket16 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse deleteBucket( + + com.amazon.s3.client.AmazonS3Stub.DeleteBucket deleteBucket16) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[8].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteBucketRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + deleteBucket16, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "deleteBucket"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startdeleteBucket + * @param deleteBucket16 + + */ + public void startdeleteBucket( + + com.amazon.s3.client.AmazonS3Stub.DeleteBucket deleteBucket16, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[8].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteBucketRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + deleteBucket16, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "deleteBucket"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultdeleteBucket( + (com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrordeleteBucket(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrordeleteBucket(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteBucket(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteBucket(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteBucket(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteBucket(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteBucket(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteBucket(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteBucket(f); + } + } else { + callback.receiveErrordeleteBucket(f); + } + } else { + callback.receiveErrordeleteBucket(f); + } + } else { + callback.receiveErrordeleteBucket(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrordeleteBucket(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[8].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[8].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#setBucketLoggingStatus + * @param setBucketLoggingStatus18 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse setBucketLoggingStatus( + + com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus setBucketLoggingStatus18) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[9].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketLoggingStatusRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + setBucketLoggingStatus18, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "setBucketLoggingStatus"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startsetBucketLoggingStatus + * @param setBucketLoggingStatus18 + + */ + public void startsetBucketLoggingStatus( + + com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus setBucketLoggingStatus18, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[9].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketLoggingStatusRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + setBucketLoggingStatus18, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "setBucketLoggingStatus"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultsetBucketLoggingStatus( + (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorsetBucketLoggingStatus(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorsetBucketLoggingStatus(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketLoggingStatus(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketLoggingStatus(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketLoggingStatus(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketLoggingStatus(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketLoggingStatus(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketLoggingStatus(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketLoggingStatus(f); + } + } else { + callback.receiveErrorsetBucketLoggingStatus(f); + } + } else { + callback.receiveErrorsetBucketLoggingStatus(f); + } + } else { + callback.receiveErrorsetBucketLoggingStatus(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorsetBucketLoggingStatus(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[9].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[9].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#getObjectAccessControlPolicy + * @param getObjectAccessControlPolicy20 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse getObjectAccessControlPolicy( + + com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy getObjectAccessControlPolicy20) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[10].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectAccessControlPolicyRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + getObjectAccessControlPolicy20, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "getObjectAccessControlPolicy"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startgetObjectAccessControlPolicy + * @param getObjectAccessControlPolicy20 + + */ + public void startgetObjectAccessControlPolicy( + + com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy getObjectAccessControlPolicy20, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[10].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectAccessControlPolicyRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + getObjectAccessControlPolicy20, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "getObjectAccessControlPolicy"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultgetObjectAccessControlPolicy( + (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorgetObjectAccessControlPolicy(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorgetObjectAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectAccessControlPolicy(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectAccessControlPolicy(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectAccessControlPolicy(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectAccessControlPolicy(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectAccessControlPolicy(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectAccessControlPolicy(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectAccessControlPolicy(f); + } + } else { + callback.receiveErrorgetObjectAccessControlPolicy(f); + } + } else { + callback.receiveErrorgetObjectAccessControlPolicy(f); + } + } else { + callback.receiveErrorgetObjectAccessControlPolicy(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorgetObjectAccessControlPolicy(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[10].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[10].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#deleteObject + * @param deleteObject22 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse deleteObject( + + com.amazon.s3.client.AmazonS3Stub.DeleteObject deleteObject22) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[11].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteObjectRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + deleteObject22, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "deleteObject"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startdeleteObject + * @param deleteObject22 + + */ + public void startdeleteObject( + + com.amazon.s3.client.AmazonS3Stub.DeleteObject deleteObject22, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[11].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteObjectRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + deleteObject22, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "deleteObject"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultdeleteObject( + (com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrordeleteObject(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrordeleteObject(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteObject(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteObject(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteObject(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteObject(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteObject(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteObject(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrordeleteObject(f); + } + } else { + callback.receiveErrordeleteObject(f); + } + } else { + callback.receiveErrordeleteObject(f); + } + } else { + callback.receiveErrordeleteObject(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrordeleteObject(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[11].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[11].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#setBucketAccessControlPolicy + * @param setBucketAccessControlPolicy24 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse setBucketAccessControlPolicy( + + com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy setBucketAccessControlPolicy24) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[12].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketAccessControlPolicyRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + setBucketAccessControlPolicy24, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "setBucketAccessControlPolicy"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startsetBucketAccessControlPolicy + * @param setBucketAccessControlPolicy24 + + */ + public void startsetBucketAccessControlPolicy( + + com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy setBucketAccessControlPolicy24, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[12].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketAccessControlPolicyRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + setBucketAccessControlPolicy24, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "setBucketAccessControlPolicy"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultsetBucketAccessControlPolicy( + (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorsetBucketAccessControlPolicy(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorsetBucketAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketAccessControlPolicy(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketAccessControlPolicy(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketAccessControlPolicy(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketAccessControlPolicy(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketAccessControlPolicy(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketAccessControlPolicy(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetBucketAccessControlPolicy(f); + } + } else { + callback.receiveErrorsetBucketAccessControlPolicy(f); + } + } else { + callback.receiveErrorsetBucketAccessControlPolicy(f); + } + } else { + callback.receiveErrorsetBucketAccessControlPolicy(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorsetBucketAccessControlPolicy(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[12].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[12].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#setObjectAccessControlPolicy + * @param setObjectAccessControlPolicy26 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse setObjectAccessControlPolicy( + + com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy setObjectAccessControlPolicy26) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[13].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetObjectAccessControlPolicyRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + setObjectAccessControlPolicy26, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "setObjectAccessControlPolicy"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startsetObjectAccessControlPolicy + * @param setObjectAccessControlPolicy26 + + */ + public void startsetObjectAccessControlPolicy( + + com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy setObjectAccessControlPolicy26, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[13].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetObjectAccessControlPolicyRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + setObjectAccessControlPolicy26, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "setObjectAccessControlPolicy"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultsetObjectAccessControlPolicy( + (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorsetObjectAccessControlPolicy(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorsetObjectAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetObjectAccessControlPolicy(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetObjectAccessControlPolicy(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetObjectAccessControlPolicy(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetObjectAccessControlPolicy(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetObjectAccessControlPolicy(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetObjectAccessControlPolicy(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorsetObjectAccessControlPolicy(f); + } + } else { + callback.receiveErrorsetObjectAccessControlPolicy(f); + } + } else { + callback.receiveErrorsetObjectAccessControlPolicy(f); + } + } else { + callback.receiveErrorsetObjectAccessControlPolicy(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorsetObjectAccessControlPolicy(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[13].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[13].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#putObjectInline + * @param putObjectInline28 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse putObjectInline( + + com.amazon.s3.client.AmazonS3Stub.PutObjectInline putObjectInline28) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[14].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectInlineRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + putObjectInline28, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "putObjectInline"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startputObjectInline + * @param putObjectInline28 + + */ + public void startputObjectInline( + + com.amazon.s3.client.AmazonS3Stub.PutObjectInline putObjectInline28, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[14].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectInlineRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + putObjectInline28, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "putObjectInline"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultputObjectInline( + (com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorputObjectInline(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorputObjectInline(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObjectInline(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObjectInline(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObjectInline(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObjectInline(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObjectInline(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObjectInline(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorputObjectInline(f); + } + } else { + callback.receiveErrorputObjectInline(f); + } + } else { + callback.receiveErrorputObjectInline(f); + } + } else { + callback.receiveErrorputObjectInline(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorputObjectInline(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[14].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[14].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + /** + * Auto generated method signature + * + * @see com.amazon.s3.client.AmazonS3#getObjectExtended + * @param getObjectExtended30 + + */ + + + + public com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse getObjectExtended( + + com.amazon.s3.client.AmazonS3Stub.GetObjectExtended getObjectExtended30) + + + throws java.rmi.RemoteException + + { + org.apache.axis2.context.MessageContext _messageContext = null; + try{ + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[15].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectExtendedRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + // create a message context + _messageContext = new org.apache.axis2.context.MessageContext(); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env = null; + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + getObjectExtended30, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "getObjectExtended"))); + + //adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // set the message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message contxt to the operation client + _operationClient.addMessageContext(_messageContext); + + //execute the operation client + _operationClient.execute(true); + + + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( + org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); + org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); + + + java.lang.Object object = fromOM( + _returnEnv.getBody().getFirstElement() , + com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.class, + getEnvelopeNamespaces(_returnEnv)); + + + return (com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse)object; + + }catch(org.apache.axis2.AxisFault f){ + + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + throw new java.rmi.RemoteException(ex.getMessage(), ex); + }catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + }catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + throw f; + } + }else{ + throw f; + } + }else{ + throw f; + } + } finally { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } + } + + /** + * Auto generated method signature for Asynchronous Invocations + * + * @see com.amazon.s3.client.AmazonS3#startgetObjectExtended + * @param getObjectExtended30 + + */ + public void startgetObjectExtended( + + com.amazon.s3.client.AmazonS3Stub.GetObjectExtended getObjectExtended30, + + final com.amazon.s3.client.AmazonS3CallbackHandler callback) + + throws java.rmi.RemoteException{ + + org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[15].getName()); + _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectExtendedRequest"); + _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); + + + + addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); + + + + // create SOAP envelope with that payload + org.apache.axiom.soap.SOAPEnvelope env=null; + final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); + + + //Style is Doc. + + + env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), + getObjectExtended30, + optimizeContent(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "getObjectExtended"))); + + // adding SOAP soap_headers + _serviceClient.addHeadersToEnvelope(env); + // create message context with that soap envelope + _messageContext.setEnvelope(env); + + // add the message context to the operation client + _operationClient.addMessageContext(_messageContext); + + + + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { + public void onMessage(org.apache.axis2.context.MessageContext resultContext) { + try { + org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); + + java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), + com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.class, + getEnvelopeNamespaces(resultEnv)); + callback.receiveResultgetObjectExtended( + (com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse)object); + + } catch (org.apache.axis2.AxisFault e) { + callback.receiveErrorgetObjectExtended(e); + } + } + + public void onError(java.lang.Exception error) { + if (error instanceof org.apache.axis2.AxisFault) { + org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; + org.apache.axiom.om.OMElement faultElt = f.getDetail(); + if (faultElt!=null){ + if (faultExceptionNameMap.containsKey(faultElt.getQName())){ + //make the fault by reflection + try{ + java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); + java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); + java.lang.Exception ex= + (java.lang.Exception) exceptionClass.newInstance(); + //message class + java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); + java.lang.Class messageClass = java.lang.Class.forName(messageClassName); + java.lang.Object messageObject = fromOM(faultElt,messageClass,null); + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", + new java.lang.Class[]{messageClass}); + m.invoke(ex,new java.lang.Object[]{messageObject}); + + + callback.receiveErrorgetObjectExtended(new java.rmi.RemoteException(ex.getMessage(), ex)); + } catch(java.lang.ClassCastException e){ + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectExtended(f); + } catch (java.lang.ClassNotFoundException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectExtended(f); + } catch (java.lang.NoSuchMethodException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectExtended(f); + } catch (java.lang.reflect.InvocationTargetException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectExtended(f); + } catch (java.lang.IllegalAccessException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectExtended(f); + } catch (java.lang.InstantiationException e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectExtended(f); + } catch (org.apache.axis2.AxisFault e) { + // we cannot intantiate the class - throw the original Axis fault + callback.receiveErrorgetObjectExtended(f); + } + } else { + callback.receiveErrorgetObjectExtended(f); + } + } else { + callback.receiveErrorgetObjectExtended(f); + } + } else { + callback.receiveErrorgetObjectExtended(error); + } + } + + public void onFault(org.apache.axis2.context.MessageContext faultContext) { + org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); + onError(fault); + } + + public void onComplete() { + try { + _messageContext.getTransportOut().getSender().cleanup(_messageContext); + } catch (org.apache.axis2.AxisFault axisFault) { + callback.receiveErrorgetObjectExtended(axisFault); + } + } + }); + + + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; + if ( _operations[15].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { + _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); + _operations[15].setMessageReceiver( + _callbackReceiver); + } + + //execute the operation client + _operationClient.execute(false); + + } + + + + /** + * A utility method that copies the namepaces from the SOAPEnvelope + */ + private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){ + java.util.Map returnMap = new java.util.HashMap(); + java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); + while (namespaceIterator.hasNext()) { + org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); + returnMap.put(ns.getPrefix(),ns.getNamespaceURI()); + } + return returnMap; + } + + + + private javax.xml.namespace.QName[] opNameArray = null; + private boolean optimizeContent(javax.xml.namespace.QName opName) { + + + if (opNameArray == null) { + return false; + } + for (int i = 0; i < opNameArray.length; i++) { + if (opName.equals(opNameArray[i])) { + return true; + } + } + return false; + } + //http://s3.cloud.com/soap + public static class ListAllMyBuckets + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "ListAllMyBuckets", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListAllMyBuckets.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListAllMyBuckets", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListAllMyBuckets", + xmlWriter); + } + + + } + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListAllMyBuckets parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListAllMyBuckets object = + new ListAllMyBuckets(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListAllMyBuckets".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListAllMyBuckets)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class ListAllMyBucketsEntry + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListAllMyBucketsEntry + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Name + */ + + + protected java.lang.String localName ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getName(){ + return localName; + } + + + + /** + * Auto generated setter method + * @param param Name + */ + public void setName(java.lang.String param){ + + this.localName=param; + + + } + + + /** + * field for CreationDate + */ + + + protected java.util.Calendar localCreationDate ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getCreationDate(){ + return localCreationDate; + } + + + + /** + * Auto generated setter method + * @param param CreationDate + */ + public void setCreationDate(java.util.Calendar param){ + + this.localCreationDate=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListAllMyBucketsEntry.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListAllMyBucketsEntry", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListAllMyBucketsEntry", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Name", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Name"); + } + + } else { + xmlWriter.writeStartElement("Name"); + } + + + if (localName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localName); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"CreationDate", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"CreationDate"); + } + + } else { + xmlWriter.writeStartElement("CreationDate"); + } + + + if (localCreationDate==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("CreationDate cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCreationDate)); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Name")); + + if (localName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); + } else { + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CreationDate")); + + if (localCreationDate != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCreationDate)); + } else { + throw new org.apache.axis2.databinding.ADBException("CreationDate cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListAllMyBucketsEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListAllMyBucketsEntry object = + new ListAllMyBucketsEntry(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListAllMyBucketsEntry".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListAllMyBucketsEntry)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreationDate").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCreationDate( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class ListBucketResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListBucketResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Metadata + * This was an Array! + */ + + + protected MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return MetadataEntry[] + */ + public MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(MetadataEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param MetadataEntry + */ + public void addMetadata(MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (MetadataEntry[])list.toArray( + new MetadataEntry[list.size()]); + + } + + + /** + * field for Name + */ + + + protected java.lang.String localName ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getName(){ + return localName; + } + + + + /** + * Auto generated setter method + * @param param Name + */ + public void setName(java.lang.String param){ + + this.localName=param; + + + } + + + /** + * field for Prefix + */ + + + protected java.lang.String localPrefix ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getPrefix(){ + return localPrefix; + } + + + + /** + * Auto generated setter method + * @param param Prefix + */ + public void setPrefix(java.lang.String param){ + + this.localPrefix=param; + + + } + + + /** + * field for Marker + */ + + + protected java.lang.String localMarker ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getMarker(){ + return localMarker; + } + + + + /** + * Auto generated setter method + * @param param Marker + */ + public void setMarker(java.lang.String param){ + + this.localMarker=param; + + + } + + + /** + * field for NextMarker + */ + + + protected java.lang.String localNextMarker ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localNextMarkerTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getNextMarker(){ + return localNextMarker; + } + + + + /** + * Auto generated setter method + * @param param NextMarker + */ + public void setNextMarker(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localNextMarkerTracker = true; + } else { + localNextMarkerTracker = false; + + } + + this.localNextMarker=param; + + + } + + + /** + * field for MaxKeys + */ + + + protected int localMaxKeys ; + + + /** + * Auto generated getter method + * @return int + */ + public int getMaxKeys(){ + return localMaxKeys; + } + + + + /** + * Auto generated setter method + * @param param MaxKeys + */ + public void setMaxKeys(int param){ + + this.localMaxKeys=param; + + + } + + + /** + * field for Delimiter + */ + + + protected java.lang.String localDelimiter ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localDelimiterTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDelimiter(){ + return localDelimiter; + } + + + + /** + * Auto generated setter method + * @param param Delimiter + */ + public void setDelimiter(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localDelimiterTracker = true; + } else { + localDelimiterTracker = false; + + } + + this.localDelimiter=param; + + + } + + + /** + * field for IsTruncated + */ + + + protected boolean localIsTruncated ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getIsTruncated(){ + return localIsTruncated; + } + + + + /** + * Auto generated setter method + * @param param IsTruncated + */ + public void setIsTruncated(boolean param){ + + this.localIsTruncated=param; + + + } + + + /** + * field for Contents + * This was an Array! + */ + + + protected ListEntry[] localContents ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localContentsTracker = false ; + + + /** + * Auto generated getter method + * @return ListEntry[] + */ + public ListEntry[] getContents(){ + return localContents; + } + + + + + + + /** + * validate the array for Contents + */ + protected void validateContents(ListEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param Contents + */ + public void setContents(ListEntry[] param){ + + validateContents(param); + + + if (param != null){ + //update the setting tracker + localContentsTracker = true; + } else { + localContentsTracker = false; + + } + + this.localContents=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param ListEntry + */ + public void addContents(ListEntry param){ + if (localContents == null){ + localContents = new ListEntry[]{}; + } + + + //update the setting tracker + localContentsTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localContents); + list.add(param); + this.localContents = + (ListEntry[])list.toArray( + new ListEntry[list.size()]); + + } + + + /** + * field for CommonPrefixes + * This was an Array! + */ + + + protected PrefixEntry[] localCommonPrefixes ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCommonPrefixesTracker = false ; + + + /** + * Auto generated getter method + * @return PrefixEntry[] + */ + public PrefixEntry[] getCommonPrefixes(){ + return localCommonPrefixes; + } + + + + + + + /** + * validate the array for CommonPrefixes + */ + protected void validateCommonPrefixes(PrefixEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param CommonPrefixes + */ + public void setCommonPrefixes(PrefixEntry[] param){ + + validateCommonPrefixes(param); + + + if (param != null){ + //update the setting tracker + localCommonPrefixesTracker = true; + } else { + localCommonPrefixesTracker = false; + + } + + this.localCommonPrefixes=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param PrefixEntry + */ + public void addCommonPrefixes(PrefixEntry param){ + if (localCommonPrefixes == null){ + localCommonPrefixes = new PrefixEntry[]{}; + } + + + //update the setting tracker + localCommonPrefixesTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localCommonPrefixes); + list.add(param); + this.localCommonPrefixes = + (PrefixEntry[])list.toArray( + new PrefixEntry[list.size()]); + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListBucketResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListBucketResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListBucketResult", + xmlWriter); + } + + + } + if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Name", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Name"); + } + + } else { + xmlWriter.writeStartElement("Name"); + } + + + if (localName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localName); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Prefix", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Prefix"); + } + + } else { + xmlWriter.writeStartElement("Prefix"); + } + + + if (localPrefix==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localPrefix); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Marker", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Marker"); + } + + } else { + xmlWriter.writeStartElement("Marker"); + } + + + if (localMarker==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localMarker); + + } + + xmlWriter.writeEndElement(); + if (localNextMarkerTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"NextMarker", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"NextMarker"); + } + + } else { + xmlWriter.writeStartElement("NextMarker"); + } + + + if (localNextMarker==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("NextMarker cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localNextMarker); + + } + + xmlWriter.writeEndElement(); + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"MaxKeys", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"MaxKeys"); + } + + } else { + xmlWriter.writeStartElement("MaxKeys"); + } + + if (localMaxKeys==java.lang.Integer.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); + } + + xmlWriter.writeEndElement(); + if (localDelimiterTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Delimiter", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Delimiter"); + } + + } else { + xmlWriter.writeStartElement("Delimiter"); + } + + + if (localDelimiter==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDelimiter); + + } + + xmlWriter.writeEndElement(); + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"IsTruncated", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IsTruncated"); + } + + } else { + xmlWriter.writeStartElement("IsTruncated"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("IsTruncated cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); + } + + xmlWriter.writeEndElement(); + if (localContentsTracker){ + if (localContents!=null){ + for (int i = 0;i < localContents.length;i++){ + if (localContents[i] != null){ + localContents[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Contents cannot be null!!"); + + } + } if (localCommonPrefixesTracker){ + if (localCommonPrefixes!=null){ + for (int i = 0;i < localCommonPrefixes.length;i++){ + if (localCommonPrefixes[i] != null){ + localCommonPrefixes[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); + + } + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Name")); + + if (localName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); + } else { + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Prefix")); + + if (localPrefix != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); + } else { + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Marker")); + + if (localMarker != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMarker)); + } else { + throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); + } + if (localNextMarkerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "NextMarker")); + + if (localNextMarker != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNextMarker)); + } else { + throw new org.apache.axis2.databinding.ADBException("NextMarker cannot be null!!"); + } + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "MaxKeys")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); + if (localDelimiterTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Delimiter")); + + if (localDelimiter != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); + } else { + throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); + } + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IsTruncated")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); + if (localContentsTracker){ + if (localContents!=null) { + for (int i = 0;i < localContents.length;i++){ + + if (localContents[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Contents")); + elementList.add(localContents[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Contents cannot be null!!"); + + } + + } if (localCommonPrefixesTracker){ + if (localCommonPrefixes!=null) { + for (int i = 0;i < localCommonPrefixes.length;i++){ + + if (localCommonPrefixes[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CommonPrefixes")); + elementList.add(localCommonPrefixes[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); + + } + + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListBucketResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListBucketResult object = + new ListBucketResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListBucketResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListBucketResult)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list1 = new java.util.ArrayList(); + + java.util.ArrayList list9 = new java.util.ArrayList(); + + java.util.ArrayList list10 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list1.add(MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone1 = false; + while(!loopDone1){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone1 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list1.add(MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone1 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + MetadataEntry.class, + list1)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setPrefix( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Marker").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setMarker( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","NextMarker").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setNextMarker( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MaxKeys").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setMaxKeys( + org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Delimiter").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDelimiter( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IsTruncated").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setIsTruncated( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list9.add(ListEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone9 = false; + while(!loopDone9){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone9 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Contents").equals(reader.getName())){ + list9.add(ListEntry.Factory.parse(reader)); + + }else{ + loopDone9 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setContents((ListEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + ListEntry.class, + list9)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list10.add(PrefixEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone10 = false; + while(!loopDone10){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone10 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CommonPrefixes").equals(reader.getName())){ + list10.add(PrefixEntry.Factory.parse(reader)); + + }else{ + loopDone10 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setCommonPrefixes((PrefixEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + PrefixEntry.class, + list10)); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class DeleteObject + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteObject", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + DeleteObject.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":DeleteObject", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "DeleteObject", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static DeleteObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + DeleteObject object = + new DeleteObject(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"DeleteObject".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (DeleteObject)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class ListAllMyBucketsList + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListAllMyBucketsList + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + * This was an Array! + */ + + + protected ListAllMyBucketsEntry[] localBucket ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localBucketTracker = false ; + + + /** + * Auto generated getter method + * @return ListAllMyBucketsEntry[] + */ + public ListAllMyBucketsEntry[] getBucket(){ + return localBucket; + } + + + + + + + /** + * validate the array for Bucket + */ + protected void validateBucket(ListAllMyBucketsEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(ListAllMyBucketsEntry[] param){ + + validateBucket(param); + + + if (param != null){ + //update the setting tracker + localBucketTracker = true; + } else { + localBucketTracker = false; + + } + + this.localBucket=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param ListAllMyBucketsEntry + */ + public void addBucket(ListAllMyBucketsEntry param){ + if (localBucket == null){ + localBucket = new ListAllMyBucketsEntry[]{}; + } + + + //update the setting tracker + localBucketTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localBucket); + list.add(param); + this.localBucket = + (ListAllMyBucketsEntry[])list.toArray( + new ListAllMyBucketsEntry[list.size()]); + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListAllMyBucketsList.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListAllMyBucketsList", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListAllMyBucketsList", + xmlWriter); + } + + + } + if (localBucketTracker){ + if (localBucket!=null){ + for (int i = 0;i < localBucket.length;i++){ + if (localBucket[i] != null){ + localBucket[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + } + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localBucketTracker){ + if (localBucket!=null) { + for (int i = 0;i < localBucket.length;i++){ + + if (localBucket[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + elementList.add(localBucket[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + } + + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListAllMyBucketsList parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListAllMyBucketsList object = + new ListAllMyBucketsList(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListAllMyBucketsList".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListAllMyBucketsList)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list1 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list1.add(ListAllMyBucketsEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone1 = false; + while(!loopDone1){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone1 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + list1.add(ListAllMyBucketsEntry.Factory.parse(reader)); + + }else{ + loopDone1 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setBucket((ListAllMyBucketsEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + ListAllMyBucketsEntry.class, + list1)); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class PutObjectInline + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "PutObjectInline", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for Metadata + * This was an Array! + */ + + + protected MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return MetadataEntry[] + */ + public MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(MetadataEntry[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param MetadataEntry + */ + public void addMetadata(MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (MetadataEntry[])list.toArray( + new MetadataEntry[list.size()]); + + } + + + /** + * field for Data + */ + + + protected javax.activation.DataHandler localData ; + + + /** + * Auto generated getter method + * @return javax.activation.DataHandler + */ + public javax.activation.DataHandler getData(){ + return localData; + } + + + + /** + * Auto generated setter method + * @param param Data + */ + public void setData(javax.activation.DataHandler param){ + + this.localData=param; + + + } + + + /** + * field for ContentLength + */ + + + protected long localContentLength ; + + + /** + * Auto generated getter method + * @return long + */ + public long getContentLength(){ + return localContentLength; + } + + + + /** + * Auto generated setter method + * @param param ContentLength + */ + public void setContentLength(long param){ + + this.localContentLength=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected AccessControlList localAccessControlList ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAccessControlListTracker = false ; + + + /** + * Auto generated getter method + * @return AccessControlList + */ + public AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(AccessControlList param){ + + if (param != null){ + //update the setting tracker + localAccessControlListTracker = true; + } else { + localAccessControlListTracker = false; + + } + + this.localAccessControlList=param; + + + } + + + /** + * field for StorageClass + */ + + + protected StorageClass localStorageClass ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localStorageClassTracker = false ; + + + /** + * Auto generated getter method + * @return StorageClass + */ + public StorageClass getStorageClass(){ + return localStorageClass; + } + + + + /** + * Auto generated setter method + * @param param StorageClass + */ + public void setStorageClass(StorageClass param){ + + if (param != null){ + //update the setting tracker + localStorageClassTracker = true; + } else { + localStorageClassTracker = false; + + } + + this.localStorageClass=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PutObjectInline.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PutObjectInline", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PutObjectInline", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Data", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Data"); + } + + } else { + xmlWriter.writeStartElement("Data"); + } + + + if (localData!=null) + { + xmlWriter.writeDataHandler(localData); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ContentLength", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ContentLength"); + } + + } else { + xmlWriter.writeStartElement("ContentLength"); + } + + if (localContentLength==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("ContentLength cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); + } + + xmlWriter.writeEndElement(); + if (localAccessControlListTracker){ + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + } if (localStorageClassTracker){ + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), + factory,xmlWriter); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Data")); + + elementList.add(localData); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ContentLength")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); + if (localAccessControlListTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + } if (localStorageClassTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass")); + + + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + elementList.add(localStorageClass); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PutObjectInline parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PutObjectInline object = + new PutObjectInline(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PutObjectInline".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PutObjectInline)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list3 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list3.add(MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone3 = false; + while(!loopDone3){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone3 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list3.add(MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone3 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + MetadataEntry.class, + list3)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Data").equals(reader.getName())){ + reader.next(); + if (isReaderMTOMAware(reader) + && + java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))) + { + //MTOM aware reader - get the datahandler directly and put it in the object + object.setData( + (javax.activation.DataHandler) reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER)); + } else { + if (reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT && reader.getName().equals(new javax.xml.namespace.QName(org.apache.axiom.om.impl.MTOMConstants.XOP_NAMESPACE_URI, org.apache.axiom.om.impl.MTOMConstants.XOP_INCLUDE))) + { + java.lang.String id = org.apache.axiom.om.util.ElementHelper.getContentID(reader, "UTF-8"); + object.setData(((org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder) ((org.apache.axiom.om.impl.llom.OMStAXWrapper) reader).getBuilder()).getDataHandler(id)); + reader.next(); + + reader.next(); + + } else if(reader.hasText()) { + //Do the usual conversion + java.lang.String content = reader.getText(); + object.setData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBase64Binary(content)); + + reader.next(); + + } + } + + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ContentLength").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setContentLength( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ + + object.setStorageClass(StorageClass.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class CreateBucketResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = CreateBucketResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for BucketName + */ + + + protected java.lang.String localBucketName ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucketName(){ + return localBucketName; + } + + + + /** + * Auto generated setter method + * @param param BucketName + */ + public void setBucketName(java.lang.String param){ + + this.localBucketName=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CreateBucketResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CreateBucketResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CreateBucketResult", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"BucketName", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"BucketName"); + } + + } else { + xmlWriter.writeStartElement("BucketName"); + } + + + if (localBucketName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("BucketName cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucketName); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "BucketName")); + + if (localBucketName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucketName)); + } else { + throw new org.apache.axis2.databinding.ADBException("BucketName cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CreateBucketResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CreateBucketResult object = + new CreateBucketResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CreateBucketResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CreateBucketResult)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketName").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucketName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class Status + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = Status + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Code + */ + + + protected int localCode ; + + + /** + * Auto generated getter method + * @return int + */ + public int getCode(){ + return localCode; + } + + + + /** + * Auto generated setter method + * @param param Code + */ + public void setCode(int param){ + + this.localCode=param; + + + } + + + /** + * field for Description + */ + + + protected java.lang.String localDescription ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDescription(){ + return localDescription; + } + + + + /** + * Auto generated setter method + * @param param Description + */ + public void setDescription(java.lang.String param){ + + this.localDescription=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Status.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Status", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Status", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Code", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Code"); + } + + } else { + xmlWriter.writeStartElement("Code"); + } + + if (localCode==java.lang.Integer.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("Code cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCode)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Description", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Description"); + } + + } else { + xmlWriter.writeStartElement("Description"); + } + + + if (localDescription==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Description cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDescription); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Code")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCode)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Description")); + + if (localDescription != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDescription)); + } else { + throw new org.apache.axis2.databinding.ADBException("Description cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Status parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Status object = + new Status(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"Status".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (Status)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Code").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCode( + org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Description").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDescription( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class CreateBucketResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "CreateBucketResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for CreateBucketReturn + */ + + + protected CreateBucketResult localCreateBucketReturn ; + + + /** + * Auto generated getter method + * @return CreateBucketResult + */ + public CreateBucketResult getCreateBucketReturn(){ + return localCreateBucketReturn; + } + + + + /** + * Auto generated setter method + * @param param CreateBucketReturn + */ + public void setCreateBucketReturn(CreateBucketResult param){ + + this.localCreateBucketReturn=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CreateBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CreateBucketResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CreateBucketResponse", + xmlWriter); + } + + + } + + if (localCreateBucketReturn==null){ + throw new org.apache.axis2.databinding.ADBException("CreateBucketReturn cannot be null!!"); + } + localCreateBucketReturn.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreateBucketReturn"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CreateBucketReturn")); + + + if (localCreateBucketReturn==null){ + throw new org.apache.axis2.databinding.ADBException("CreateBucketReturn cannot be null!!"); + } + elementList.add(localCreateBucketReturn); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CreateBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CreateBucketResponse object = + new CreateBucketResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CreateBucketResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CreateBucketResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CreateBucketReturn").equals(reader.getName())){ + + object.setCreateBucketReturn(CreateBucketResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetObjectExtended + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectExtended", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for GetMetadata + */ + + + protected boolean localGetMetadata ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getGetMetadata(){ + return localGetMetadata; + } + + + + /** + * Auto generated setter method + * @param param GetMetadata + */ + public void setGetMetadata(boolean param){ + + this.localGetMetadata=param; + + + } + + + /** + * field for GetData + */ + + + protected boolean localGetData ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getGetData(){ + return localGetData; + } + + + + /** + * Auto generated setter method + * @param param GetData + */ + public void setGetData(boolean param){ + + this.localGetData=param; + + + } + + + /** + * field for InlineData + */ + + + protected boolean localInlineData ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getInlineData(){ + return localInlineData; + } + + + + /** + * Auto generated setter method + * @param param InlineData + */ + public void setInlineData(boolean param){ + + this.localInlineData=param; + + + } + + + /** + * field for ByteRangeStart + */ + + + protected long localByteRangeStart ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localByteRangeStartTracker = false ; + + + /** + * Auto generated getter method + * @return long + */ + public long getByteRangeStart(){ + return localByteRangeStart; + } + + + + /** + * Auto generated setter method + * @param param ByteRangeStart + */ + public void setByteRangeStart(long param){ + + // setting primitive attribute tracker to true + + if (param==java.lang.Long.MIN_VALUE) { + localByteRangeStartTracker = false; + + } else { + localByteRangeStartTracker = true; + } + + this.localByteRangeStart=param; + + + } + + + /** + * field for ByteRangeEnd + */ + + + protected long localByteRangeEnd ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localByteRangeEndTracker = false ; + + + /** + * Auto generated getter method + * @return long + */ + public long getByteRangeEnd(){ + return localByteRangeEnd; + } + + + + /** + * Auto generated setter method + * @param param ByteRangeEnd + */ + public void setByteRangeEnd(long param){ + + // setting primitive attribute tracker to true + + if (param==java.lang.Long.MIN_VALUE) { + localByteRangeEndTracker = false; + + } else { + localByteRangeEndTracker = true; + } + + this.localByteRangeEnd=param; + + + } + + + /** + * field for IfModifiedSince + */ + + + protected java.util.Calendar localIfModifiedSince ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localIfModifiedSinceTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getIfModifiedSince(){ + return localIfModifiedSince; + } + + + + /** + * Auto generated setter method + * @param param IfModifiedSince + */ + public void setIfModifiedSince(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localIfModifiedSinceTracker = true; + } else { + localIfModifiedSinceTracker = false; + + } + + this.localIfModifiedSince=param; + + + } + + + /** + * field for IfUnmodifiedSince + */ + + + protected java.util.Calendar localIfUnmodifiedSince ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localIfUnmodifiedSinceTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getIfUnmodifiedSince(){ + return localIfUnmodifiedSince; + } + + + + /** + * Auto generated setter method + * @param param IfUnmodifiedSince + */ + public void setIfUnmodifiedSince(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localIfUnmodifiedSinceTracker = true; + } else { + localIfUnmodifiedSinceTracker = false; + + } + + this.localIfUnmodifiedSince=param; + + + } + + + /** + * field for IfMatch + * This was an Array! + */ + + + protected java.lang.String[] localIfMatch ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localIfMatchTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String[] + */ + public java.lang.String[] getIfMatch(){ + return localIfMatch; + } + + + + + + + /** + * validate the array for IfMatch + */ + protected void validateIfMatch(java.lang.String[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param IfMatch + */ + public void setIfMatch(java.lang.String[] param){ + + validateIfMatch(param); + + + if (param != null){ + //update the setting tracker + localIfMatchTracker = true; + } else { + localIfMatchTracker = false; + + } + + this.localIfMatch=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param java.lang.String + */ + public void addIfMatch(java.lang.String param){ + if (localIfMatch == null){ + localIfMatch = new java.lang.String[]{}; + } + + + //update the setting tracker + localIfMatchTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localIfMatch); + list.add(param); + this.localIfMatch = + (java.lang.String[])list.toArray( + new java.lang.String[list.size()]); + + } + + + /** + * field for IfNoneMatch + * This was an Array! + */ + + + protected java.lang.String[] localIfNoneMatch ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localIfNoneMatchTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String[] + */ + public java.lang.String[] getIfNoneMatch(){ + return localIfNoneMatch; + } + + + + + + + /** + * validate the array for IfNoneMatch + */ + protected void validateIfNoneMatch(java.lang.String[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param IfNoneMatch + */ + public void setIfNoneMatch(java.lang.String[] param){ + + validateIfNoneMatch(param); + + + if (param != null){ + //update the setting tracker + localIfNoneMatchTracker = true; + } else { + localIfNoneMatchTracker = false; + + } + + this.localIfNoneMatch=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param java.lang.String + */ + public void addIfNoneMatch(java.lang.String param){ + if (localIfNoneMatch == null){ + localIfNoneMatch = new java.lang.String[]{}; + } + + + //update the setting tracker + localIfNoneMatchTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localIfNoneMatch); + list.add(param); + this.localIfNoneMatch = + (java.lang.String[])list.toArray( + new java.lang.String[list.size()]); + + } + + + /** + * field for ReturnCompleteObjectOnConditionFailure + */ + + + protected boolean localReturnCompleteObjectOnConditionFailure ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localReturnCompleteObjectOnConditionFailureTracker = false ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getReturnCompleteObjectOnConditionFailure(){ + return localReturnCompleteObjectOnConditionFailure; + } + + + + /** + * Auto generated setter method + * @param param ReturnCompleteObjectOnConditionFailure + */ + public void setReturnCompleteObjectOnConditionFailure(boolean param){ + + // setting primitive attribute tracker to true + + if (false) { + localReturnCompleteObjectOnConditionFailureTracker = false; + + } else { + localReturnCompleteObjectOnConditionFailureTracker = true; + } + + this.localReturnCompleteObjectOnConditionFailure=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectExtended.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectExtended", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectExtended", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"GetMetadata", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"GetMetadata"); + } + + } else { + xmlWriter.writeStartElement("GetMetadata"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("GetMetadata cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"GetData", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"GetData"); + } + + } else { + xmlWriter.writeStartElement("GetData"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("GetData cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"InlineData", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"InlineData"); + } + + } else { + xmlWriter.writeStartElement("InlineData"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("InlineData cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); + } + + xmlWriter.writeEndElement(); + if (localByteRangeStartTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ByteRangeStart", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ByteRangeStart"); + } + + } else { + xmlWriter.writeStartElement("ByteRangeStart"); + } + + if (localByteRangeStart==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("ByteRangeStart cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeStart)); + } + + xmlWriter.writeEndElement(); + } if (localByteRangeEndTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ByteRangeEnd", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ByteRangeEnd"); + } + + } else { + xmlWriter.writeStartElement("ByteRangeEnd"); + } + + if (localByteRangeEnd==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("ByteRangeEnd cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeEnd)); + } + + xmlWriter.writeEndElement(); + } if (localIfModifiedSinceTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"IfModifiedSince", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IfModifiedSince"); + } + + } else { + xmlWriter.writeStartElement("IfModifiedSince"); + } + + + if (localIfModifiedSince==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("IfModifiedSince cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfModifiedSince)); + + } + + xmlWriter.writeEndElement(); + } if (localIfUnmodifiedSinceTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"IfUnmodifiedSince", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IfUnmodifiedSince"); + } + + } else { + xmlWriter.writeStartElement("IfUnmodifiedSince"); + } + + + if (localIfUnmodifiedSince==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("IfUnmodifiedSince cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfUnmodifiedSince)); + + } + + xmlWriter.writeEndElement(); + } if (localIfMatchTracker){ + if (localIfMatch!=null) { + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + boolean emptyNamespace = namespace == null || namespace.length() == 0; + prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); + for (int i = 0;i < localIfMatch.length;i++){ + + if (localIfMatch[i] != null){ + + if (!emptyNamespace) { + if (prefix == null) { + java.lang.String prefix2 = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix2,"IfMatch", namespace); + xmlWriter.writeNamespace(prefix2, namespace); + xmlWriter.setPrefix(prefix2, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IfMatch"); + } + + } else { + xmlWriter.writeStartElement("IfMatch"); + } + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfMatch[i])); + + xmlWriter.writeEndElement(); + + } else { + + // we have to do nothing since minOccurs is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("IfMatch cannot be null!!"); + + } + + } if (localIfNoneMatchTracker){ + if (localIfNoneMatch!=null) { + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + boolean emptyNamespace = namespace == null || namespace.length() == 0; + prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); + for (int i = 0;i < localIfNoneMatch.length;i++){ + + if (localIfNoneMatch[i] != null){ + + if (!emptyNamespace) { + if (prefix == null) { + java.lang.String prefix2 = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix2,"IfNoneMatch", namespace); + xmlWriter.writeNamespace(prefix2, namespace); + xmlWriter.setPrefix(prefix2, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"IfNoneMatch"); + } + + } else { + xmlWriter.writeStartElement("IfNoneMatch"); + } + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfNoneMatch[i])); + + xmlWriter.writeEndElement(); + + } else { + + // we have to do nothing since minOccurs is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("IfNoneMatch cannot be null!!"); + + } + + } if (localReturnCompleteObjectOnConditionFailureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ReturnCompleteObjectOnConditionFailure", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ReturnCompleteObjectOnConditionFailure"); + } + + } else { + xmlWriter.writeStartElement("ReturnCompleteObjectOnConditionFailure"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("ReturnCompleteObjectOnConditionFailure cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReturnCompleteObjectOnConditionFailure)); + } + + xmlWriter.writeEndElement(); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetMetadata")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetData")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "InlineData")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); + if (localByteRangeStartTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ByteRangeStart")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeStart)); + } if (localByteRangeEndTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ByteRangeEnd")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeEnd)); + } if (localIfModifiedSinceTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IfModifiedSince")); + + if (localIfModifiedSince != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfModifiedSince)); + } else { + throw new org.apache.axis2.databinding.ADBException("IfModifiedSince cannot be null!!"); + } + } if (localIfUnmodifiedSinceTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IfUnmodifiedSince")); + + if (localIfUnmodifiedSince != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfUnmodifiedSince)); + } else { + throw new org.apache.axis2.databinding.ADBException("IfUnmodifiedSince cannot be null!!"); + } + } if (localIfMatchTracker){ + if (localIfMatch!=null){ + for (int i = 0;i < localIfMatch.length;i++){ + + if (localIfMatch[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IfMatch")); + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfMatch[i])); + } else { + + // have to do nothing + + } + + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("IfMatch cannot be null!!"); + + } + + } if (localIfNoneMatchTracker){ + if (localIfNoneMatch!=null){ + for (int i = 0;i < localIfNoneMatch.length;i++){ + + if (localIfNoneMatch[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "IfNoneMatch")); + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfNoneMatch[i])); + } else { + + // have to do nothing + + } + + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("IfNoneMatch cannot be null!!"); + + } + + } if (localReturnCompleteObjectOnConditionFailureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ReturnCompleteObjectOnConditionFailure")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReturnCompleteObjectOnConditionFailure)); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectExtended parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectExtended object = + new GetObjectExtended(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectExtended".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectExtended)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list10 = new java.util.ArrayList(); + + java.util.ArrayList list11 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetMetadata").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setGetMetadata( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetData").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setGetData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","InlineData").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setInlineData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ByteRangeStart").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setByteRangeStart( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + object.setByteRangeStart(java.lang.Long.MIN_VALUE); + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ByteRangeEnd").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setByteRangeEnd( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + object.setByteRangeEnd(java.lang.Long.MIN_VALUE); + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfModifiedSince").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setIfModifiedSince( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfUnmodifiedSince").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setIfUnmodifiedSince( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfMatch").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list10.add(reader.getElementText()); + + //loop until we find a start element that is not part of this array + boolean loopDone10 = false; + while(!loopDone10){ + // Ensure we are at the EndElement + while (!reader.isEndElement()){ + reader.next(); + } + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone10 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfMatch").equals(reader.getName())){ + list10.add(reader.getElementText()); + + }else{ + loopDone10 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setIfMatch((java.lang.String[]) + list10.toArray(new java.lang.String[list10.size()])); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfNoneMatch").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list11.add(reader.getElementText()); + + //loop until we find a start element that is not part of this array + boolean loopDone11 = false; + while(!loopDone11){ + // Ensure we are at the EndElement + while (!reader.isEndElement()){ + reader.next(); + } + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone11 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","IfNoneMatch").equals(reader.getName())){ + list11.add(reader.getElementText()); + + }else{ + loopDone11 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setIfNoneMatch((java.lang.String[]) + list11.toArray(new java.lang.String[list11.size()])); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ReturnCompleteObjectOnConditionFailure").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setReturnCompleteObjectOnConditionFailure( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class ListAllMyBucketsResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "ListAllMyBucketsResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for ListAllMyBucketsResponse + */ + + + protected ListAllMyBucketsResult localListAllMyBucketsResponse ; + + + /** + * Auto generated getter method + * @return ListAllMyBucketsResult + */ + public ListAllMyBucketsResult getListAllMyBucketsResponse(){ + return localListAllMyBucketsResponse; + } + + + + /** + * Auto generated setter method + * @param param ListAllMyBucketsResponse + */ + public void setListAllMyBucketsResponse(ListAllMyBucketsResult param){ + + this.localListAllMyBucketsResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListAllMyBucketsResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListAllMyBucketsResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListAllMyBucketsResponse", + xmlWriter); + } + + + } + + if (localListAllMyBucketsResponse==null){ + throw new org.apache.axis2.databinding.ADBException("ListAllMyBucketsResponse cannot be null!!"); + } + localListAllMyBucketsResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListAllMyBucketsResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ListAllMyBucketsResponse")); + + + if (localListAllMyBucketsResponse==null){ + throw new org.apache.axis2.databinding.ADBException("ListAllMyBucketsResponse cannot be null!!"); + } + elementList.add(localListAllMyBucketsResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListAllMyBucketsResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListAllMyBucketsResponse object = + new ListAllMyBucketsResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListAllMyBucketsResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListAllMyBucketsResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListAllMyBucketsResponse").equals(reader.getName())){ + + object.setListAllMyBucketsResponse(ListAllMyBucketsResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class SetBucketAccessControlPolicy + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetBucketAccessControlPolicy", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected AccessControlList localAccessControlList ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAccessControlListTracker = false ; + + + /** + * Auto generated getter method + * @return AccessControlList + */ + public AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(AccessControlList param){ + + if (param != null){ + //update the setting tracker + localAccessControlListTracker = true; + } else { + localAccessControlListTracker = false; + + } + + this.localAccessControlList=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetBucketAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetBucketAccessControlPolicy", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetBucketAccessControlPolicy", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAccessControlListTracker){ + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAccessControlListTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetBucketAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetBucketAccessControlPolicy object = + new SetBucketAccessControlPolicy(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetBucketAccessControlPolicy".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetBucketAccessControlPolicy)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetObjectAccessControlPolicyResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectAccessControlPolicyResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetObjectAccessControlPolicyResponse + */ + + + protected AccessControlPolicy localGetObjectAccessControlPolicyResponse ; + + + /** + * Auto generated getter method + * @return AccessControlPolicy + */ + public AccessControlPolicy getGetObjectAccessControlPolicyResponse(){ + return localGetObjectAccessControlPolicyResponse; + } + + + + /** + * Auto generated setter method + * @param param GetObjectAccessControlPolicyResponse + */ + public void setGetObjectAccessControlPolicyResponse(AccessControlPolicy param){ + + this.localGetObjectAccessControlPolicyResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectAccessControlPolicyResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectAccessControlPolicyResponse", + xmlWriter); + } + + + } + + if (localGetObjectAccessControlPolicyResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectAccessControlPolicyResponse cannot be null!!"); + } + localGetObjectAccessControlPolicyResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectAccessControlPolicyResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectAccessControlPolicyResponse")); + + + if (localGetObjectAccessControlPolicyResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectAccessControlPolicyResponse cannot be null!!"); + } + elementList.add(localGetObjectAccessControlPolicyResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectAccessControlPolicyResponse object = + new GetObjectAccessControlPolicyResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectAccessControlPolicyResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectAccessControlPolicyResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectAccessControlPolicyResponse").equals(reader.getName())){ + + object.setGetObjectAccessControlPolicyResponse(AccessControlPolicy.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class DeleteObjectResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteObjectResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for DeleteObjectResponse + */ + + + protected Status localDeleteObjectResponse ; + + + /** + * Auto generated getter method + * @return Status + */ + public Status getDeleteObjectResponse(){ + return localDeleteObjectResponse; + } + + + + /** + * Auto generated setter method + * @param param DeleteObjectResponse + */ + public void setDeleteObjectResponse(Status param){ + + this.localDeleteObjectResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + DeleteObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":DeleteObjectResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "DeleteObjectResponse", + xmlWriter); + } + + + } + + if (localDeleteObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("DeleteObjectResponse cannot be null!!"); + } + localDeleteObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteObjectResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteObjectResponse")); + + + if (localDeleteObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("DeleteObjectResponse cannot be null!!"); + } + elementList.add(localDeleteObjectResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static DeleteObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + DeleteObjectResponse object = + new DeleteObjectResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"DeleteObjectResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (DeleteObjectResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteObjectResponse").equals(reader.getName())){ + + object.setDeleteObjectResponse(Status.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetBucketLoggingStatus + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketLoggingStatus", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetBucketLoggingStatus.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetBucketLoggingStatus", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetBucketLoggingStatus", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetBucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetBucketLoggingStatus object = + new GetBucketLoggingStatus(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetBucketLoggingStatus".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetBucketLoggingStatus)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class LoggingSettings + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = LoggingSettings + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for TargetBucket + */ + + + protected java.lang.String localTargetBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getTargetBucket(){ + return localTargetBucket; + } + + + + /** + * Auto generated setter method + * @param param TargetBucket + */ + public void setTargetBucket(java.lang.String param){ + + this.localTargetBucket=param; + + + } + + + /** + * field for TargetPrefix + */ + + + protected java.lang.String localTargetPrefix ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getTargetPrefix(){ + return localTargetPrefix; + } + + + + /** + * Auto generated setter method + * @param param TargetPrefix + */ + public void setTargetPrefix(java.lang.String param){ + + this.localTargetPrefix=param; + + + } + + + /** + * field for TargetGrants + */ + + + protected AccessControlList localTargetGrants ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTargetGrantsTracker = false ; + + + /** + * Auto generated getter method + * @return AccessControlList + */ + public AccessControlList getTargetGrants(){ + return localTargetGrants; + } + + + + /** + * Auto generated setter method + * @param param TargetGrants + */ + public void setTargetGrants(AccessControlList param){ + + if (param != null){ + //update the setting tracker + localTargetGrantsTracker = true; + } else { + localTargetGrantsTracker = false; + + } + + this.localTargetGrants=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + LoggingSettings.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":LoggingSettings", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "LoggingSettings", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"TargetBucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"TargetBucket"); + } + + } else { + xmlWriter.writeStartElement("TargetBucket"); + } + + + if (localTargetBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("TargetBucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localTargetBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"TargetPrefix", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"TargetPrefix"); + } + + } else { + xmlWriter.writeStartElement("TargetPrefix"); + } + + + if (localTargetPrefix==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("TargetPrefix cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localTargetPrefix); + + } + + xmlWriter.writeEndElement(); + if (localTargetGrantsTracker){ + if (localTargetGrants==null){ + throw new org.apache.axis2.databinding.ADBException("TargetGrants cannot be null!!"); + } + localTargetGrants.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetGrants"), + factory,xmlWriter); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "TargetBucket")); + + if (localTargetBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTargetBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("TargetBucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "TargetPrefix")); + + if (localTargetPrefix != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTargetPrefix)); + } else { + throw new org.apache.axis2.databinding.ADBException("TargetPrefix cannot be null!!"); + } + if (localTargetGrantsTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "TargetGrants")); + + + if (localTargetGrants==null){ + throw new org.apache.axis2.databinding.ADBException("TargetGrants cannot be null!!"); + } + elementList.add(localTargetGrants); + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static LoggingSettings parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + LoggingSettings object = + new LoggingSettings(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"LoggingSettings".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (LoggingSettings)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetBucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTargetBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetPrefix").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTargetPrefix( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","TargetGrants").equals(reader.getName())){ + + object.setTargetGrants(AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class ExtensionMapper{ + + public static java.lang.Object getTypeObject(java.lang.String namespaceURI, + java.lang.String typeName, + javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListAllMyBucketsResult".equals(typeName)){ + + return ListAllMyBucketsResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "PutObjectResult".equals(typeName)){ + + return PutObjectResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "BucketLoggingStatus".equals(typeName)){ + + return BucketLoggingStatus.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "AccessControlList".equals(typeName)){ + + return AccessControlList.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListAllMyBucketsEntry".equals(typeName)){ + + return ListAllMyBucketsEntry.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "MetadataDirective".equals(typeName)){ + + return MetadataDirective.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListBucketResult".equals(typeName)){ + + return ListBucketResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "AccessControlPolicy".equals(typeName)){ + + return AccessControlPolicy.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "PrefixEntry".equals(typeName)){ + + return PrefixEntry.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "GetObjectResult".equals(typeName)){ + + return GetObjectResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Grant".equals(typeName)){ + + return Grant.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListAllMyBucketsList".equals(typeName)){ + + return ListAllMyBucketsList.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "CreateBucketResult".equals(typeName)){ + + return CreateBucketResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Status".equals(typeName)){ + + return Status.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "MetadataEntry".equals(typeName)){ + + return MetadataEntry.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "LoggingSettings".equals(typeName)){ + + return LoggingSettings.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "CopyObjectResult".equals(typeName)){ + + return CopyObjectResult.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "CanonicalUser".equals(typeName)){ + + return CanonicalUser.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "ListEntry".equals(typeName)){ + + return ListEntry.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Grantee".equals(typeName)){ + + return Grantee.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "StorageClass".equals(typeName)){ + + return StorageClass.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Permission".equals(typeName)){ + + return Permission.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "Result".equals(typeName)){ + + return Result.Factory.parse(reader); + + + } + + + if ( + "http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && + "User".equals(typeName)){ + + return User.Factory.parse(reader); + + + } + + + throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); + } + + } + + public static class DeleteBucket + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteBucket", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + DeleteBucket.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":DeleteBucket", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "DeleteBucket", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static DeleteBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + DeleteBucket object = + new DeleteBucket(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"DeleteBucket".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (DeleteBucket)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class DeleteBucketResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteBucketResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for DeleteBucketResponse + */ + + + protected Status localDeleteBucketResponse ; + + + /** + * Auto generated getter method + * @return Status + */ + public Status getDeleteBucketResponse(){ + return localDeleteBucketResponse; + } + + + + /** + * Auto generated setter method + * @param param DeleteBucketResponse + */ + public void setDeleteBucketResponse(Status param){ + + this.localDeleteBucketResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + DeleteBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":DeleteBucketResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "DeleteBucketResponse", + xmlWriter); + } + + + } + + if (localDeleteBucketResponse==null){ + throw new org.apache.axis2.databinding.ADBException("DeleteBucketResponse cannot be null!!"); + } + localDeleteBucketResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteBucketResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DeleteBucketResponse")); + + + if (localDeleteBucketResponse==null){ + throw new org.apache.axis2.databinding.ADBException("DeleteBucketResponse cannot be null!!"); + } + elementList.add(localDeleteBucketResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static DeleteBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + DeleteBucketResponse object = + new DeleteBucketResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"DeleteBucketResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (DeleteBucketResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DeleteBucketResponse").equals(reader.getName())){ + + object.setDeleteBucketResponse(Status.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class CopyObjectResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = CopyObjectResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for LastModified + */ + + + protected java.util.Calendar localLastModified ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getLastModified(){ + return localLastModified; + } + + + + /** + * Auto generated setter method + * @param param LastModified + */ + public void setLastModified(java.util.Calendar param){ + + this.localLastModified=param; + + + } + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CopyObjectResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CopyObjectResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CopyObjectResult", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"LastModified", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"LastModified"); + } + + } else { + xmlWriter.writeStartElement("LastModified"); + } + + + if (localLastModified==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LastModified")); + + if (localLastModified != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + } else { + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CopyObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CopyObjectResult object = + new CopyObjectResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CopyObjectResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CopyObjectResult)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLastModified( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class ListEntry + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListEntry + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for LastModified + */ + + + protected java.util.Calendar localLastModified ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getLastModified(){ + return localLastModified; + } + + + + /** + * Auto generated setter method + * @param param LastModified + */ + public void setLastModified(java.util.Calendar param){ + + this.localLastModified=param; + + + } + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * field for Size + */ + + + protected long localSize ; + + + /** + * Auto generated getter method + * @return long + */ + public long getSize(){ + return localSize; + } + + + + /** + * Auto generated setter method + * @param param Size + */ + public void setSize(long param){ + + this.localSize=param; + + + } + + + /** + * field for Owner + */ + + + protected CanonicalUser localOwner ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localOwnerTracker = false ; + + + /** + * Auto generated getter method + * @return CanonicalUser + */ + public CanonicalUser getOwner(){ + return localOwner; + } + + + + /** + * Auto generated setter method + * @param param Owner + */ + public void setOwner(CanonicalUser param){ + + if (param != null){ + //update the setting tracker + localOwnerTracker = true; + } else { + localOwnerTracker = false; + + } + + this.localOwner=param; + + + } + + + /** + * field for StorageClass + */ + + + protected StorageClass localStorageClass ; + + + /** + * Auto generated getter method + * @return StorageClass + */ + public StorageClass getStorageClass(){ + return localStorageClass; + } + + + + /** + * Auto generated setter method + * @param param StorageClass + */ + public void setStorageClass(StorageClass param){ + + this.localStorageClass=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListEntry.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListEntry", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListEntry", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"LastModified", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"LastModified"); + } + + } else { + xmlWriter.writeStartElement("LastModified"); + } + + + if (localLastModified==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Size", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Size"); + } + + } else { + xmlWriter.writeStartElement("Size"); + } + + if (localSize==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("Size cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); + } + + xmlWriter.writeEndElement(); + if (localOwnerTracker){ + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), + factory,xmlWriter); + } + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LastModified")); + + if (localLastModified != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + } else { + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Size")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); + if (localOwnerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Owner")); + + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + elementList.add(localOwner); + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass")); + + + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + elementList.add(localStorageClass); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListEntry object = + new ListEntry(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListEntry".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListEntry)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLastModified( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Size").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSize( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ + + object.setOwner(CanonicalUser.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ + + object.setStorageClass(StorageClass.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class Permission + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "Permission", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Permission + */ + + + protected java.lang.String localPermission ; + + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + + protected Permission(java.lang.String value, boolean isRegisterValue) { + localPermission = value; + if (isRegisterValue){ + + _table_.put(localPermission, this); + + } + + } + + public static final java.lang.String _READ = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("READ"); + + public static final java.lang.String _WRITE = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("WRITE"); + + public static final java.lang.String _READ_ACP = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("READ_ACP"); + + public static final java.lang.String _WRITE_ACP = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("WRITE_ACP"); + + public static final java.lang.String _FULL_CONTROL = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FULL_CONTROL"); + + public static final Permission READ = + new Permission(_READ,true); + + public static final Permission WRITE = + new Permission(_WRITE,true); + + public static final Permission READ_ACP = + new Permission(_READ_ACP,true); + + public static final Permission WRITE_ACP = + new Permission(_WRITE_ACP,true); + + public static final Permission FULL_CONTROL = + new Permission(_FULL_CONTROL,true); + + + public java.lang.String getValue() { return localPermission;} + + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { + + return localPermission.toString(); + + + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Permission.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + //We can safely assume an element has only one type associated with it + + java.lang.String namespace = parentQName.getNamespaceURI(); + java.lang.String localName = parentQName.getLocalPart(); + + if (! namespace.equals("")) { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix, localName, namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace, localName); + } + + } else { + xmlWriter.writeStartElement(localName); + } + + // add the type details if this is used in a simple type + if (serializeType){ + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Permission", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Permission", + xmlWriter); + } + } + + if (localPermission==null){ + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); + + }else{ + + xmlWriter.writeCharacters(localPermission); + + } + + xmlWriter.writeEndElement(); + + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + + //We can safely assume an element has only one type associated with it + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, + new java.lang.Object[]{ + org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPermission) + }, + null); + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + public static Permission fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + Permission enumeration = (Permission) + + _table_.get(value); + + + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static Permission fromString(java.lang.String value,java.lang.String namespaceURI) + throws java.lang.IllegalArgumentException { + try { + + return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); + + + } catch (java.lang.Exception e) { + throw new java.lang.IllegalArgumentException(); + } + } + + public static Permission fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, + java.lang.String content) { + if (content.indexOf(":") > -1){ + java.lang.String prefix = content.substring(0,content.indexOf(":")); + java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); + return Permission.Factory.fromString(content,namespaceUri); + } else { + return Permission.Factory.fromString(content,""); + } + } + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Permission parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Permission object = null; + // initialize a hash map to keep values + java.util.Map attributeMap = new java.util.HashMap(); + java.util.List extraAttributeList = new java.util.ArrayList(); + + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + while(!reader.isEndElement()) { + if (reader.isStartElement() || reader.hasText()){ + + java.lang.String content = reader.getElementText(); + + if (content.indexOf(":") > 0) { + // this seems to be a Qname so find the namespace and send + prefix = content.substring(0, content.indexOf(":")); + namespaceuri = reader.getNamespaceURI(prefix); + object = Permission.Factory.fromString(content,namespaceuri); + } else { + // this seems to be not a qname send and empty namespace incase of it is + // check is done in fromString method + object = Permission.Factory.fromString(content,""); + } + + + } else { + reader.next(); + } + } // end of while loop + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class Grantee + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = Grantee + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Grantee.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Grantee", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Grantee", + xmlWriter); + } + + + } + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Grantee parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Grantee object = + null; + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"Grantee".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (Grantee)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + throw new org.apache.axis2.databinding.ADBException("The an abstract class can not be instantiated !!!"); + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class ListAllMyBucketsResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = ListAllMyBucketsResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Owner + */ + + + protected CanonicalUser localOwner ; + + + /** + * Auto generated getter method + * @return CanonicalUser + */ + public CanonicalUser getOwner(){ + return localOwner; + } + + + + /** + * Auto generated setter method + * @param param Owner + */ + public void setOwner(CanonicalUser param){ + + this.localOwner=param; + + + } + + + /** + * field for Buckets + */ + + + protected ListAllMyBucketsList localBuckets ; + + + /** + * Auto generated getter method + * @return ListAllMyBucketsList + */ + public ListAllMyBucketsList getBuckets(){ + return localBuckets; + } + + + + /** + * Auto generated setter method + * @param param Buckets + */ + public void setBuckets(ListAllMyBucketsList param){ + + this.localBuckets=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListAllMyBucketsResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListAllMyBucketsResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListAllMyBucketsResult", + xmlWriter); + } + + + } + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), + factory,xmlWriter); + + if (localBuckets==null){ + throw new org.apache.axis2.databinding.ADBException("Buckets cannot be null!!"); + } + localBuckets.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Buckets"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Owner")); + + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + elementList.add(localOwner); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Buckets")); + + + if (localBuckets==null){ + throw new org.apache.axis2.databinding.ADBException("Buckets cannot be null!!"); + } + elementList.add(localBuckets); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListAllMyBucketsResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListAllMyBucketsResult object = + new ListAllMyBucketsResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListAllMyBucketsResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListAllMyBucketsResult)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ + + object.setOwner(CanonicalUser.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Buckets").equals(reader.getName())){ + + object.setBuckets(ListAllMyBucketsList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class CopyObject + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "CopyObject", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for SourceBucket + */ + + + protected java.lang.String localSourceBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSourceBucket(){ + return localSourceBucket; + } + + + + /** + * Auto generated setter method + * @param param SourceBucket + */ + public void setSourceBucket(java.lang.String param){ + + this.localSourceBucket=param; + + + } + + + /** + * field for SourceKey + */ + + + protected java.lang.String localSourceKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSourceKey(){ + return localSourceKey; + } + + + + /** + * Auto generated setter method + * @param param SourceKey + */ + public void setSourceKey(java.lang.String param){ + + this.localSourceKey=param; + + + } + + + /** + * field for DestinationBucket + */ + + + protected java.lang.String localDestinationBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDestinationBucket(){ + return localDestinationBucket; + } + + + + /** + * Auto generated setter method + * @param param DestinationBucket + */ + public void setDestinationBucket(java.lang.String param){ + + this.localDestinationBucket=param; + + + } + + + /** + * field for DestinationKey + */ + + + protected java.lang.String localDestinationKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDestinationKey(){ + return localDestinationKey; + } + + + + /** + * Auto generated setter method + * @param param DestinationKey + */ + public void setDestinationKey(java.lang.String param){ + + this.localDestinationKey=param; + + + } + + + /** + * field for MetadataDirective + */ + + + protected MetadataDirective localMetadataDirective ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataDirectiveTracker = false ; + + + /** + * Auto generated getter method + * @return MetadataDirective + */ + public MetadataDirective getMetadataDirective(){ + return localMetadataDirective; + } + + + + /** + * Auto generated setter method + * @param param MetadataDirective + */ + public void setMetadataDirective(MetadataDirective param){ + + if (param != null){ + //update the setting tracker + localMetadataDirectiveTracker = true; + } else { + localMetadataDirectiveTracker = false; + + } + + this.localMetadataDirective=param; + + + } + + + /** + * field for Metadata + * This was an Array! + */ + + + protected MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return MetadataEntry[] + */ + public MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(MetadataEntry[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param MetadataEntry + */ + public void addMetadata(MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (MetadataEntry[])list.toArray( + new MetadataEntry[list.size()]); + + } + + + /** + * field for AccessControlList + */ + + + protected AccessControlList localAccessControlList ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAccessControlListTracker = false ; + + + /** + * Auto generated getter method + * @return AccessControlList + */ + public AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(AccessControlList param){ + + if (param != null){ + //update the setting tracker + localAccessControlListTracker = true; + } else { + localAccessControlListTracker = false; + + } + + this.localAccessControlList=param; + + + } + + + /** + * field for CopySourceIfModifiedSince + */ + + + protected java.util.Calendar localCopySourceIfModifiedSince ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCopySourceIfModifiedSinceTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getCopySourceIfModifiedSince(){ + return localCopySourceIfModifiedSince; + } + + + + /** + * Auto generated setter method + * @param param CopySourceIfModifiedSince + */ + public void setCopySourceIfModifiedSince(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localCopySourceIfModifiedSinceTracker = true; + } else { + localCopySourceIfModifiedSinceTracker = false; + + } + + this.localCopySourceIfModifiedSince=param; + + + } + + + /** + * field for CopySourceIfUnmodifiedSince + */ + + + protected java.util.Calendar localCopySourceIfUnmodifiedSince ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCopySourceIfUnmodifiedSinceTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getCopySourceIfUnmodifiedSince(){ + return localCopySourceIfUnmodifiedSince; + } + + + + /** + * Auto generated setter method + * @param param CopySourceIfUnmodifiedSince + */ + public void setCopySourceIfUnmodifiedSince(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localCopySourceIfUnmodifiedSinceTracker = true; + } else { + localCopySourceIfUnmodifiedSinceTracker = false; + + } + + this.localCopySourceIfUnmodifiedSince=param; + + + } + + + /** + * field for CopySourceIfMatch + * This was an Array! + */ + + + protected java.lang.String[] localCopySourceIfMatch ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCopySourceIfMatchTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String[] + */ + public java.lang.String[] getCopySourceIfMatch(){ + return localCopySourceIfMatch; + } + + + + + + + /** + * validate the array for CopySourceIfMatch + */ + protected void validateCopySourceIfMatch(java.lang.String[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param CopySourceIfMatch + */ + public void setCopySourceIfMatch(java.lang.String[] param){ + + validateCopySourceIfMatch(param); + + + if (param != null){ + //update the setting tracker + localCopySourceIfMatchTracker = true; + } else { + localCopySourceIfMatchTracker = false; + + } + + this.localCopySourceIfMatch=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param java.lang.String + */ + public void addCopySourceIfMatch(java.lang.String param){ + if (localCopySourceIfMatch == null){ + localCopySourceIfMatch = new java.lang.String[]{}; + } + + + //update the setting tracker + localCopySourceIfMatchTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localCopySourceIfMatch); + list.add(param); + this.localCopySourceIfMatch = + (java.lang.String[])list.toArray( + new java.lang.String[list.size()]); + + } + + + /** + * field for CopySourceIfNoneMatch + * This was an Array! + */ + + + protected java.lang.String[] localCopySourceIfNoneMatch ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCopySourceIfNoneMatchTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String[] + */ + public java.lang.String[] getCopySourceIfNoneMatch(){ + return localCopySourceIfNoneMatch; + } + + + + + + + /** + * validate the array for CopySourceIfNoneMatch + */ + protected void validateCopySourceIfNoneMatch(java.lang.String[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param CopySourceIfNoneMatch + */ + public void setCopySourceIfNoneMatch(java.lang.String[] param){ + + validateCopySourceIfNoneMatch(param); + + + if (param != null){ + //update the setting tracker + localCopySourceIfNoneMatchTracker = true; + } else { + localCopySourceIfNoneMatchTracker = false; + + } + + this.localCopySourceIfNoneMatch=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param java.lang.String + */ + public void addCopySourceIfNoneMatch(java.lang.String param){ + if (localCopySourceIfNoneMatch == null){ + localCopySourceIfNoneMatch = new java.lang.String[]{}; + } + + + //update the setting tracker + localCopySourceIfNoneMatchTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localCopySourceIfNoneMatch); + list.add(param); + this.localCopySourceIfNoneMatch = + (java.lang.String[])list.toArray( + new java.lang.String[list.size()]); + + } + + + /** + * field for StorageClass + */ + + + protected StorageClass localStorageClass ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localStorageClassTracker = false ; + + + /** + * Auto generated getter method + * @return StorageClass + */ + public StorageClass getStorageClass(){ + return localStorageClass; + } + + + + /** + * Auto generated setter method + * @param param StorageClass + */ + public void setStorageClass(StorageClass param){ + + if (param != null){ + //update the setting tracker + localStorageClassTracker = true; + } else { + localStorageClassTracker = false; + + } + + this.localStorageClass=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CopyObject.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CopyObject", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CopyObject", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"SourceBucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"SourceBucket"); + } + + } else { + xmlWriter.writeStartElement("SourceBucket"); + } + + + if (localSourceBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("SourceBucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSourceBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"SourceKey", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"SourceKey"); + } + + } else { + xmlWriter.writeStartElement("SourceKey"); + } + + + if (localSourceKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("SourceKey cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSourceKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"DestinationBucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"DestinationBucket"); + } + + } else { + xmlWriter.writeStartElement("DestinationBucket"); + } + + + if (localDestinationBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("DestinationBucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDestinationBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"DestinationKey", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"DestinationKey"); + } + + } else { + xmlWriter.writeStartElement("DestinationKey"); + } + + + if (localDestinationKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("DestinationKey cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDestinationKey); + + } + + xmlWriter.writeEndElement(); + if (localMetadataDirectiveTracker){ + if (localMetadataDirective==null){ + throw new org.apache.axis2.databinding.ADBException("MetadataDirective cannot be null!!"); + } + localMetadataDirective.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MetadataDirective"), + factory,xmlWriter); + } if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } if (localAccessControlListTracker){ + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + } if (localCopySourceIfModifiedSinceTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"CopySourceIfModifiedSince", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"CopySourceIfModifiedSince"); + } + + } else { + xmlWriter.writeStartElement("CopySourceIfModifiedSince"); + } + + + if (localCopySourceIfModifiedSince==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfModifiedSince cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfModifiedSince)); + + } + + xmlWriter.writeEndElement(); + } if (localCopySourceIfUnmodifiedSinceTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"CopySourceIfUnmodifiedSince", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"CopySourceIfUnmodifiedSince"); + } + + } else { + xmlWriter.writeStartElement("CopySourceIfUnmodifiedSince"); + } + + + if (localCopySourceIfUnmodifiedSince==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfUnmodifiedSince cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfUnmodifiedSince)); + + } + + xmlWriter.writeEndElement(); + } if (localCopySourceIfMatchTracker){ + if (localCopySourceIfMatch!=null) { + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + boolean emptyNamespace = namespace == null || namespace.length() == 0; + prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); + for (int i = 0;i < localCopySourceIfMatch.length;i++){ + + if (localCopySourceIfMatch[i] != null){ + + if (!emptyNamespace) { + if (prefix == null) { + java.lang.String prefix2 = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix2,"CopySourceIfMatch", namespace); + xmlWriter.writeNamespace(prefix2, namespace); + xmlWriter.setPrefix(prefix2, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"CopySourceIfMatch"); + } + + } else { + xmlWriter.writeStartElement("CopySourceIfMatch"); + } + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfMatch[i])); + + xmlWriter.writeEndElement(); + + } else { + + // we have to do nothing since minOccurs is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfMatch cannot be null!!"); + + } + + } if (localCopySourceIfNoneMatchTracker){ + if (localCopySourceIfNoneMatch!=null) { + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + boolean emptyNamespace = namespace == null || namespace.length() == 0; + prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); + for (int i = 0;i < localCopySourceIfNoneMatch.length;i++){ + + if (localCopySourceIfNoneMatch[i] != null){ + + if (!emptyNamespace) { + if (prefix == null) { + java.lang.String prefix2 = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix2,"CopySourceIfNoneMatch", namespace); + xmlWriter.writeNamespace(prefix2, namespace); + xmlWriter.setPrefix(prefix2, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"CopySourceIfNoneMatch"); + } + + } else { + xmlWriter.writeStartElement("CopySourceIfNoneMatch"); + } + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfNoneMatch[i])); + + xmlWriter.writeEndElement(); + + } else { + + // we have to do nothing since minOccurs is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfNoneMatch cannot be null!!"); + + } + + } if (localStorageClassTracker){ + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), + factory,xmlWriter); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "SourceBucket")); + + if (localSourceBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSourceBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("SourceBucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "SourceKey")); + + if (localSourceKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSourceKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("SourceKey cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DestinationBucket")); + + if (localDestinationBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDestinationBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("DestinationBucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DestinationKey")); + + if (localDestinationKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDestinationKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("DestinationKey cannot be null!!"); + } + if (localMetadataDirectiveTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "MetadataDirective")); + + + if (localMetadataDirective==null){ + throw new org.apache.axis2.databinding.ADBException("MetadataDirective cannot be null!!"); + } + elementList.add(localMetadataDirective); + } if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } if (localAccessControlListTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + } if (localCopySourceIfModifiedSinceTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CopySourceIfModifiedSince")); + + if (localCopySourceIfModifiedSince != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfModifiedSince)); + } else { + throw new org.apache.axis2.databinding.ADBException("CopySourceIfModifiedSince cannot be null!!"); + } + } if (localCopySourceIfUnmodifiedSinceTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CopySourceIfUnmodifiedSince")); + + if (localCopySourceIfUnmodifiedSince != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfUnmodifiedSince)); + } else { + throw new org.apache.axis2.databinding.ADBException("CopySourceIfUnmodifiedSince cannot be null!!"); + } + } if (localCopySourceIfMatchTracker){ + if (localCopySourceIfMatch!=null){ + for (int i = 0;i < localCopySourceIfMatch.length;i++){ + + if (localCopySourceIfMatch[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CopySourceIfMatch")); + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfMatch[i])); + } else { + + // have to do nothing + + } + + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfMatch cannot be null!!"); + + } + + } if (localCopySourceIfNoneMatchTracker){ + if (localCopySourceIfNoneMatch!=null){ + for (int i = 0;i < localCopySourceIfNoneMatch.length;i++){ + + if (localCopySourceIfNoneMatch[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CopySourceIfNoneMatch")); + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfNoneMatch[i])); + } else { + + // have to do nothing + + } + + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("CopySourceIfNoneMatch cannot be null!!"); + + } + + } if (localStorageClassTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass")); + + + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + elementList.add(localStorageClass); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CopyObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CopyObject object = + new CopyObject(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CopyObject".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CopyObject)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list6 = new java.util.ArrayList(); + + java.util.ArrayList list10 = new java.util.ArrayList(); + + java.util.ArrayList list11 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","SourceBucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSourceBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","SourceKey").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSourceKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DestinationBucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDestinationBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DestinationKey").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDestinationKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MetadataDirective").equals(reader.getName())){ + + object.setMetadataDirective(MetadataDirective.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list6.add(MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone6 = false; + while(!loopDone6){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone6 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list6.add(MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone6 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + MetadataEntry.class, + list6)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfModifiedSince").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCopySourceIfModifiedSince( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfUnmodifiedSince").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCopySourceIfUnmodifiedSince( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfMatch").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list10.add(reader.getElementText()); + + //loop until we find a start element that is not part of this array + boolean loopDone10 = false; + while(!loopDone10){ + // Ensure we are at the EndElement + while (!reader.isEndElement()){ + reader.next(); + } + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone10 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfMatch").equals(reader.getName())){ + list10.add(reader.getElementText()); + + }else{ + loopDone10 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setCopySourceIfMatch((java.lang.String[]) + list10.toArray(new java.lang.String[list10.size()])); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfNoneMatch").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list11.add(reader.getElementText()); + + //loop until we find a start element that is not part of this array + boolean loopDone11 = false; + while(!loopDone11){ + // Ensure we are at the EndElement + while (!reader.isEndElement()){ + reader.next(); + } + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone11 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopySourceIfNoneMatch").equals(reader.getName())){ + list11.add(reader.getElementText()); + + }else{ + loopDone11 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setCopySourceIfNoneMatch((java.lang.String[]) + list11.toArray(new java.lang.String[list11.size()])); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ + + object.setStorageClass(StorageClass.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class BucketLoggingStatus + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = BucketLoggingStatus + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for LoggingEnabled + */ + + + protected LoggingSettings localLoggingEnabled ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localLoggingEnabledTracker = false ; + + + /** + * Auto generated getter method + * @return LoggingSettings + */ + public LoggingSettings getLoggingEnabled(){ + return localLoggingEnabled; + } + + + + /** + * Auto generated setter method + * @param param LoggingEnabled + */ + public void setLoggingEnabled(LoggingSettings param){ + + if (param != null){ + //update the setting tracker + localLoggingEnabledTracker = true; + } else { + localLoggingEnabledTracker = false; + + } + + this.localLoggingEnabled=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + BucketLoggingStatus.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":BucketLoggingStatus", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "BucketLoggingStatus", + xmlWriter); + } + + + } + if (localLoggingEnabledTracker){ + if (localLoggingEnabled==null){ + throw new org.apache.axis2.databinding.ADBException("LoggingEnabled cannot be null!!"); + } + localLoggingEnabled.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LoggingEnabled"), + factory,xmlWriter); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localLoggingEnabledTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LoggingEnabled")); + + + if (localLoggingEnabled==null){ + throw new org.apache.axis2.databinding.ADBException("LoggingEnabled cannot be null!!"); + } + elementList.add(localLoggingEnabled); + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static BucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + BucketLoggingStatus object = + new BucketLoggingStatus(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"BucketLoggingStatus".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (BucketLoggingStatus)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LoggingEnabled").equals(reader.getName())){ + + object.setLoggingEnabled(LoggingSettings.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class PutObject + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "PutObject", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for Metadata + * This was an Array! + */ + + + protected MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return MetadataEntry[] + */ + public MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(MetadataEntry[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param MetadataEntry + */ + public void addMetadata(MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (MetadataEntry[])list.toArray( + new MetadataEntry[list.size()]); + + } + + + /** + * field for ContentLength + */ + + + protected long localContentLength ; + + + /** + * Auto generated getter method + * @return long + */ + public long getContentLength(){ + return localContentLength; + } + + + + /** + * Auto generated setter method + * @param param ContentLength + */ + public void setContentLength(long param){ + + this.localContentLength=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected AccessControlList localAccessControlList ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAccessControlListTracker = false ; + + + /** + * Auto generated getter method + * @return AccessControlList + */ + public AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(AccessControlList param){ + + if (param != null){ + //update the setting tracker + localAccessControlListTracker = true; + } else { + localAccessControlListTracker = false; + + } + + this.localAccessControlList=param; + + + } + + + /** + * field for StorageClass + */ + + + protected StorageClass localStorageClass ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localStorageClassTracker = false ; + + + /** + * Auto generated getter method + * @return StorageClass + */ + public StorageClass getStorageClass(){ + return localStorageClass; + } + + + + /** + * Auto generated setter method + * @param param StorageClass + */ + public void setStorageClass(StorageClass param){ + + if (param != null){ + //update the setting tracker + localStorageClassTracker = true; + } else { + localStorageClassTracker = false; + + } + + this.localStorageClass=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PutObject.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PutObject", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PutObject", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ContentLength", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ContentLength"); + } + + } else { + xmlWriter.writeStartElement("ContentLength"); + } + + if (localContentLength==java.lang.Long.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("ContentLength cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); + } + + xmlWriter.writeEndElement(); + if (localAccessControlListTracker){ + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + } if (localStorageClassTracker){ + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass"), + factory,xmlWriter); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ContentLength")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); + if (localAccessControlListTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + } if (localStorageClassTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass")); + + + if (localStorageClass==null){ + throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); + } + elementList.add(localStorageClass); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PutObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PutObject object = + new PutObject(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PutObject".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PutObject)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list3 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list3.add(MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone3 = false; + while(!loopDone3){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone3 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list3.add(MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone3 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + MetadataEntry.class, + list3)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ContentLength").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setContentLength( + org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","StorageClass").equals(reader.getName())){ + + object.setStorageClass(StorageClass.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class MetadataDirective + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "MetadataDirective", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for MetadataDirective + */ + + + protected java.lang.String localMetadataDirective ; + + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + + protected MetadataDirective(java.lang.String value, boolean isRegisterValue) { + localMetadataDirective = value; + if (isRegisterValue){ + + _table_.put(localMetadataDirective, this); + + } + + } + + public static final java.lang.String _COPY = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("COPY"); + + public static final java.lang.String _REPLACE = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("REPLACE"); + + public static final MetadataDirective COPY = + new MetadataDirective(_COPY,true); + + public static final MetadataDirective REPLACE = + new MetadataDirective(_REPLACE,true); + + + public java.lang.String getValue() { return localMetadataDirective;} + + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { + + return localMetadataDirective.toString(); + + + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + MetadataDirective.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + //We can safely assume an element has only one type associated with it + + java.lang.String namespace = parentQName.getNamespaceURI(); + java.lang.String localName = parentQName.getLocalPart(); + + if (! namespace.equals("")) { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix, localName, namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace, localName); + } + + } else { + xmlWriter.writeStartElement(localName); + } + + // add the type details if this is used in a simple type + if (serializeType){ + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":MetadataDirective", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "MetadataDirective", + xmlWriter); + } + } + + if (localMetadataDirective==null){ + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); + + }else{ + + xmlWriter.writeCharacters(localMetadataDirective); + + } + + xmlWriter.writeEndElement(); + + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + + //We can safely assume an element has only one type associated with it + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, + new java.lang.Object[]{ + org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMetadataDirective) + }, + null); + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + public static MetadataDirective fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + MetadataDirective enumeration = (MetadataDirective) + + _table_.get(value); + + + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static MetadataDirective fromString(java.lang.String value,java.lang.String namespaceURI) + throws java.lang.IllegalArgumentException { + try { + + return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); + + + } catch (java.lang.Exception e) { + throw new java.lang.IllegalArgumentException(); + } + } + + public static MetadataDirective fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, + java.lang.String content) { + if (content.indexOf(":") > -1){ + java.lang.String prefix = content.substring(0,content.indexOf(":")); + java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); + return MetadataDirective.Factory.fromString(content,namespaceUri); + } else { + return MetadataDirective.Factory.fromString(content,""); + } + } + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static MetadataDirective parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + MetadataDirective object = null; + // initialize a hash map to keep values + java.util.Map attributeMap = new java.util.HashMap(); + java.util.List extraAttributeList = new java.util.ArrayList(); + + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + while(!reader.isEndElement()) { + if (reader.isStartElement() || reader.hasText()){ + + java.lang.String content = reader.getElementText(); + + if (content.indexOf(":") > 0) { + // this seems to be a Qname so find the namespace and send + prefix = content.substring(0, content.indexOf(":")); + namespaceuri = reader.getNamespaceURI(prefix); + object = MetadataDirective.Factory.fromString(content,namespaceuri); + } else { + // this seems to be not a qname send and empty namespace incase of it is + // check is done in fromString method + object = MetadataDirective.Factory.fromString(content,""); + } + + + } else { + reader.next(); + } + } // end of while loop + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetObjectResult extends Result + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = GetObjectResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Metadata + * This was an Array! + */ + + + protected MetadataEntry[] localMetadata ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMetadataTracker = false ; + + + /** + * Auto generated getter method + * @return MetadataEntry[] + */ + public MetadataEntry[] getMetadata(){ + return localMetadata; + } + + + + + + + /** + * validate the array for Metadata + */ + protected void validateMetadata(MetadataEntry[] param){ + + } + + + /** + * Auto generated setter method + * @param param Metadata + */ + public void setMetadata(MetadataEntry[] param){ + + validateMetadata(param); + + + if (param != null){ + //update the setting tracker + localMetadataTracker = true; + } else { + localMetadataTracker = false; + + } + + this.localMetadata=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param MetadataEntry + */ + public void addMetadata(MetadataEntry param){ + if (localMetadata == null){ + localMetadata = new MetadataEntry[]{}; + } + + + //update the setting tracker + localMetadataTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); + list.add(param); + this.localMetadata = + (MetadataEntry[])list.toArray( + new MetadataEntry[list.size()]); + + } + + + /** + * field for Data + */ + + + protected javax.activation.DataHandler localData ; + + + /** + * Auto generated getter method + * @return javax.activation.DataHandler + */ + public javax.activation.DataHandler getData(){ + return localData; + } + + + + /** + * Auto generated setter method + * @param param Data + */ + public void setData(javax.activation.DataHandler param){ + + this.localData=param; + + + } + + + /** + * field for LastModified + */ + + + protected java.util.Calendar localLastModified ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getLastModified(){ + return localLastModified; + } + + + + /** + * Auto generated setter method + * @param param LastModified + */ + public void setLastModified(java.util.Calendar param){ + + this.localLastModified=param; + + + } + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectResult", + xmlWriter); + } + + + if (localStatus==null){ + throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); + } + localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status"), + factory,xmlWriter); + if (localMetadataTracker){ + if (localMetadata!=null){ + for (int i = 0;i < localMetadata.length;i++){ + if (localMetadata[i] != null){ + localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + } + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Data", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Data"); + } + + } else { + xmlWriter.writeStartElement("Data"); + } + + + if (localData!=null) + { + xmlWriter.writeDataHandler(localData); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"LastModified", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"LastModified"); + } + + } else { + xmlWriter.writeStartElement("LastModified"); + } + + + if (localLastModified==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); + attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResult")); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Status")); + + + if (localStatus==null){ + throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); + } + elementList.add(localStatus); + if (localMetadataTracker){ + if (localMetadata!=null) { + for (int i = 0;i < localMetadata.length;i++){ + + if (localMetadata[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Metadata")); + elementList.add(localMetadata[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); + + } + + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Data")); + + elementList.add(localData); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LastModified")); + + if (localLastModified != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + } else { + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectResult object = + new GetObjectResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectResult)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list2 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status").equals(reader.getName())){ + + object.setStatus(Status.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list2.add(MetadataEntry.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone2 = false; + while(!loopDone2){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone2 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Metadata").equals(reader.getName())){ + list2.add(MetadataEntry.Factory.parse(reader)); + + }else{ + loopDone2 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setMetadata((MetadataEntry[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + MetadataEntry.class, + list2)); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Data").equals(reader.getName())){ + reader.next(); + if (isReaderMTOMAware(reader) + && + java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))) + { + //MTOM aware reader - get the datahandler directly and put it in the object + object.setData( + (javax.activation.DataHandler) reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER)); + } else { + if (reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT && reader.getName().equals(new javax.xml.namespace.QName(org.apache.axiom.om.impl.MTOMConstants.XOP_NAMESPACE_URI, org.apache.axiom.om.impl.MTOMConstants.XOP_INCLUDE))) + { + java.lang.String id = org.apache.axiom.om.util.ElementHelper.getContentID(reader, "UTF-8"); + object.setData(((org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder) ((org.apache.axiom.om.impl.llom.OMStAXWrapper) reader).getBuilder()).getDataHandler(id)); + reader.next(); + + reader.next(); + + } else if(reader.hasText()) { + //Do the usual conversion + java.lang.String content = reader.getText(); + object.setData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBase64Binary(content)); + + reader.next(); + + } + } + + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLastModified( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class Grant + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = Grant + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Grantee + */ + + + protected Grantee localGrantee ; + + + /** + * Auto generated getter method + * @return Grantee + */ + public Grantee getGrantee(){ + return localGrantee; + } + + + + /** + * Auto generated setter method + * @param param Grantee + */ + public void setGrantee(Grantee param){ + + this.localGrantee=param; + + + } + + + /** + * field for Permission + */ + + + protected Permission localPermission ; + + + /** + * Auto generated getter method + * @return Permission + */ + public Permission getPermission(){ + return localPermission; + } + + + + /** + * Auto generated setter method + * @param param Permission + */ + public void setPermission(Permission param){ + + this.localPermission=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Grant.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Grant", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Grant", + xmlWriter); + } + + + } + + if (localGrantee==null){ + throw new org.apache.axis2.databinding.ADBException("Grantee cannot be null!!"); + } + localGrantee.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grantee"), + factory,xmlWriter); + + if (localPermission==null){ + throw new org.apache.axis2.databinding.ADBException("Permission cannot be null!!"); + } + localPermission.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Permission"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Grantee")); + + + if (localGrantee==null){ + throw new org.apache.axis2.databinding.ADBException("Grantee cannot be null!!"); + } + elementList.add(localGrantee); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Permission")); + + + if (localPermission==null){ + throw new org.apache.axis2.databinding.ADBException("Permission cannot be null!!"); + } + elementList.add(localPermission); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Grant parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Grant object = + new Grant(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"Grant".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (Grant)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grantee").equals(reader.getName())){ + + object.setGrantee(Grantee.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Permission").equals(reader.getName())){ + + object.setPermission(Permission.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetBucketAccessControlPolicyResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketAccessControlPolicyResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetBucketAccessControlPolicyResponse + */ + + + protected AccessControlPolicy localGetBucketAccessControlPolicyResponse ; + + + /** + * Auto generated getter method + * @return AccessControlPolicy + */ + public AccessControlPolicy getGetBucketAccessControlPolicyResponse(){ + return localGetBucketAccessControlPolicyResponse; + } + + + + /** + * Auto generated setter method + * @param param GetBucketAccessControlPolicyResponse + */ + public void setGetBucketAccessControlPolicyResponse(AccessControlPolicy param){ + + this.localGetBucketAccessControlPolicyResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetBucketAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetBucketAccessControlPolicyResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetBucketAccessControlPolicyResponse", + xmlWriter); + } + + + } + + if (localGetBucketAccessControlPolicyResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetBucketAccessControlPolicyResponse cannot be null!!"); + } + localGetBucketAccessControlPolicyResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketAccessControlPolicyResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketAccessControlPolicyResponse")); + + + if (localGetBucketAccessControlPolicyResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetBucketAccessControlPolicyResponse cannot be null!!"); + } + elementList.add(localGetBucketAccessControlPolicyResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetBucketAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetBucketAccessControlPolicyResponse object = + new GetBucketAccessControlPolicyResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetBucketAccessControlPolicyResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetBucketAccessControlPolicyResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketAccessControlPolicyResponse").equals(reader.getName())){ + + object.setGetBucketAccessControlPolicyResponse(AccessControlPolicy.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class SetObjectAccessControlPolicyResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetObjectAccessControlPolicyResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetObjectAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetObjectAccessControlPolicyResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetObjectAccessControlPolicyResponse", + xmlWriter); + } + + + } + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetObjectAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetObjectAccessControlPolicyResponse object = + new SetObjectAccessControlPolicyResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetObjectAccessControlPolicyResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetObjectAccessControlPolicyResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class SetObjectAccessControlPolicy + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetObjectAccessControlPolicy", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected AccessControlList localAccessControlList ; + + + /** + * Auto generated getter method + * @return AccessControlList + */ + public AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(AccessControlList param){ + + this.localAccessControlList=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetObjectAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetObjectAccessControlPolicy", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetObjectAccessControlPolicy", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetObjectAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetObjectAccessControlPolicy object = + new SetObjectAccessControlPolicy(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetObjectAccessControlPolicy".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetObjectAccessControlPolicy)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class ListBucket + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "ListBucket", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Prefix + */ + + + protected java.lang.String localPrefix ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localPrefixTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getPrefix(){ + return localPrefix; + } + + + + /** + * Auto generated setter method + * @param param Prefix + */ + public void setPrefix(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localPrefixTracker = true; + } else { + localPrefixTracker = false; + + } + + this.localPrefix=param; + + + } + + + /** + * field for Marker + */ + + + protected java.lang.String localMarker ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMarkerTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getMarker(){ + return localMarker; + } + + + + /** + * Auto generated setter method + * @param param Marker + */ + public void setMarker(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localMarkerTracker = true; + } else { + localMarkerTracker = false; + + } + + this.localMarker=param; + + + } + + + /** + * field for MaxKeys + */ + + + protected int localMaxKeys ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localMaxKeysTracker = false ; + + + /** + * Auto generated getter method + * @return int + */ + public int getMaxKeys(){ + return localMaxKeys; + } + + + + /** + * Auto generated setter method + * @param param MaxKeys + */ + public void setMaxKeys(int param){ + + // setting primitive attribute tracker to true + + if (param==java.lang.Integer.MIN_VALUE) { + localMaxKeysTracker = false; + + } else { + localMaxKeysTracker = true; + } + + this.localMaxKeys=param; + + + } + + + /** + * field for Delimiter + */ + + + protected java.lang.String localDelimiter ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localDelimiterTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDelimiter(){ + return localDelimiter; + } + + + + /** + * Auto generated setter method + * @param param Delimiter + */ + public void setDelimiter(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localDelimiterTracker = true; + } else { + localDelimiterTracker = false; + + } + + this.localDelimiter=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListBucket.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListBucket", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListBucket", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localPrefixTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Prefix", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Prefix"); + } + + } else { + xmlWriter.writeStartElement("Prefix"); + } + + + if (localPrefix==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localPrefix); + + } + + xmlWriter.writeEndElement(); + } if (localMarkerTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Marker", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Marker"); + } + + } else { + xmlWriter.writeStartElement("Marker"); + } + + + if (localMarker==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localMarker); + + } + + xmlWriter.writeEndElement(); + } if (localMaxKeysTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"MaxKeys", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"MaxKeys"); + } + + } else { + xmlWriter.writeStartElement("MaxKeys"); + } + + if (localMaxKeys==java.lang.Integer.MIN_VALUE) { + + throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); + } + + xmlWriter.writeEndElement(); + } if (localDelimiterTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Delimiter", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Delimiter"); + } + + } else { + xmlWriter.writeStartElement("Delimiter"); + } + + + if (localDelimiter==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDelimiter); + + } + + xmlWriter.writeEndElement(); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localPrefixTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Prefix")); + + if (localPrefix != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); + } else { + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + } + } if (localMarkerTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Marker")); + + if (localMarker != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMarker)); + } else { + throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); + } + } if (localMaxKeysTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "MaxKeys")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); + } if (localDelimiterTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Delimiter")); + + if (localDelimiter != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); + } else { + throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); + } + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListBucket object = + new ListBucket(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListBucket".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListBucket)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setPrefix( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Marker").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setMarker( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","MaxKeys").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setMaxKeys( + org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + object.setMaxKeys(java.lang.Integer.MIN_VALUE); + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Delimiter").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDelimiter( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class MetadataEntry + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = MetadataEntry + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Name + */ + + + protected java.lang.String localName ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getName(){ + return localName; + } + + + + /** + * Auto generated setter method + * @param param Name + */ + public void setName(java.lang.String param){ + + this.localName=param; + + + } + + + /** + * field for Value + */ + + + protected java.lang.String localValue ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getValue(){ + return localValue; + } + + + + /** + * Auto generated setter method + * @param param Value + */ + public void setValue(java.lang.String param){ + + this.localValue=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + MetadataEntry.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":MetadataEntry", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "MetadataEntry", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Name", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Name"); + } + + } else { + xmlWriter.writeStartElement("Name"); + } + + + if (localName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localName); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Value", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Value"); + } + + } else { + xmlWriter.writeStartElement("Value"); + } + + + if (localValue==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localValue); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Name")); + + if (localName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); + } else { + throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Value")); + + if (localValue != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue)); + } else { + throw new org.apache.axis2.databinding.ADBException("Value cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static MetadataEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + MetadataEntry object = + new MetadataEntry(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"MetadataEntry".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (MetadataEntry)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Name").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Value").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setValue( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetBucketAccessControlPolicy + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketAccessControlPolicy", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetBucketAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetBucketAccessControlPolicy", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetBucketAccessControlPolicy", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetBucketAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetBucketAccessControlPolicy object = + new GetBucketAccessControlPolicy(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetBucketAccessControlPolicy".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetBucketAccessControlPolicy)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetObjectExtendedResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectExtendedResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetObjectResponse + */ + + + protected GetObjectResult localGetObjectResponse ; + + + /** + * Auto generated getter method + * @return GetObjectResult + */ + public GetObjectResult getGetObjectResponse(){ + return localGetObjectResponse; + } + + + + /** + * Auto generated setter method + * @param param GetObjectResponse + */ + public void setGetObjectResponse(GetObjectResult param){ + + this.localGetObjectResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectExtendedResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectExtendedResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectExtendedResponse", + xmlWriter); + } + + + } + + if (localGetObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); + } + localGetObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectResponse")); + + + if (localGetObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); + } + elementList.add(localGetObjectResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectExtendedResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectExtendedResponse object = + new GetObjectExtendedResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectExtendedResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectExtendedResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse").equals(reader.getName())){ + + object.setGetObjectResponse(GetObjectResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class StorageClass + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "StorageClass", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for StorageClass + */ + + + protected java.lang.String localStorageClass ; + + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + + protected StorageClass(java.lang.String value, boolean isRegisterValue) { + localStorageClass = value; + if (isRegisterValue){ + + _table_.put(localStorageClass, this); + + } + + } + + public static final java.lang.String _STANDARD = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("STANDARD"); + + public static final java.lang.String _UNKNOWN = + org.apache.axis2.databinding.utils.ConverterUtil.convertToString("UNKNOWN"); + + public static final StorageClass STANDARD = + new StorageClass(_STANDARD,true); + + public static final StorageClass UNKNOWN = + new StorageClass(_UNKNOWN,true); + + + public java.lang.String getValue() { return localStorageClass;} + + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { + + return localStorageClass.toString(); + + + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + StorageClass.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + //We can safely assume an element has only one type associated with it + + java.lang.String namespace = parentQName.getNamespaceURI(); + java.lang.String localName = parentQName.getLocalPart(); + + if (! namespace.equals("")) { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix, localName, namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace, localName); + } + + } else { + xmlWriter.writeStartElement(localName); + } + + // add the type details if this is used in a simple type + if (serializeType){ + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":StorageClass", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "StorageClass", + xmlWriter); + } + } + + if (localStorageClass==null){ + + throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); + + }else{ + + xmlWriter.writeCharacters(localStorageClass); + + } + + xmlWriter.writeEndElement(); + + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + + //We can safely assume an element has only one type associated with it + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, + new java.lang.Object[]{ + org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStorageClass) + }, + null); + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + public static StorageClass fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + StorageClass enumeration = (StorageClass) + + _table_.get(value); + + + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static StorageClass fromString(java.lang.String value,java.lang.String namespaceURI) + throws java.lang.IllegalArgumentException { + try { + + return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); + + + } catch (java.lang.Exception e) { + throw new java.lang.IllegalArgumentException(); + } + } + + public static StorageClass fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, + java.lang.String content) { + if (content.indexOf(":") > -1){ + java.lang.String prefix = content.substring(0,content.indexOf(":")); + java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); + return StorageClass.Factory.fromString(content,namespaceUri); + } else { + return StorageClass.Factory.fromString(content,""); + } + } + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static StorageClass parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + StorageClass object = null; + // initialize a hash map to keep values + java.util.Map attributeMap = new java.util.HashMap(); + java.util.List extraAttributeList = new java.util.ArrayList(); + + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + while(!reader.isEndElement()) { + if (reader.isStartElement() || reader.hasText()){ + + java.lang.String content = reader.getElementText(); + + if (content.indexOf(":") > 0) { + // this seems to be a Qname so find the namespace and send + prefix = content.substring(0, content.indexOf(":")); + namespaceuri = reader.getNamespaceURI(prefix); + object = StorageClass.Factory.fromString(content,namespaceuri); + } else { + // this seems to be not a qname send and empty namespace incase of it is + // check is done in fromString method + object = StorageClass.Factory.fromString(content,""); + } + + + } else { + reader.next(); + } + } // end of while loop + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class PutObjectResult + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = PutObjectResult + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * field for LastModified + */ + + + protected java.util.Calendar localLastModified ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getLastModified(){ + return localLastModified; + } + + + + /** + * Auto generated setter method + * @param param LastModified + */ + public void setLastModified(java.util.Calendar param){ + + this.localLastModified=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PutObjectResult.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PutObjectResult", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PutObjectResult", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"LastModified", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"LastModified"); + } + + } else { + xmlWriter.writeStartElement("LastModified"); + } + + + if (localLastModified==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "LastModified")); + + if (localLastModified != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); + } else { + throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PutObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PutObjectResult object = + new PutObjectResult(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PutObjectResult".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PutObjectResult)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","LastModified").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLastModified( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class AccessControlList + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = AccessControlList + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Grant + * This was an Array! + */ + + + protected Grant[] localGrant ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localGrantTracker = false ; + + + /** + * Auto generated getter method + * @return Grant[] + */ + public Grant[] getGrant(){ + return localGrant; + } + + + + + + + /** + * validate the array for Grant + */ + protected void validateGrant(Grant[] param){ + + if ((param != null) && (param.length > 100)){ + throw new java.lang.RuntimeException(); + } + + } + + + /** + * Auto generated setter method + * @param param Grant + */ + public void setGrant(Grant[] param){ + + validateGrant(param); + + + if (param != null){ + //update the setting tracker + localGrantTracker = true; + } else { + localGrantTracker = false; + + } + + this.localGrant=param; + } + + + + /** + * Auto generated add method for the array for convenience + * @param param Grant + */ + public void addGrant(Grant param){ + if (localGrant == null){ + localGrant = new Grant[]{}; + } + + + //update the setting tracker + localGrantTracker = true; + + + java.util.List list = + org.apache.axis2.databinding.utils.ConverterUtil.toList(localGrant); + list.add(param); + this.localGrant = + (Grant[])list.toArray( + new Grant[list.size()]); + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + AccessControlList.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":AccessControlList", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "AccessControlList", + xmlWriter); + } + + + } + if (localGrantTracker){ + if (localGrant!=null){ + for (int i = 0;i < localGrant.length;i++){ + if (localGrant[i] != null){ + localGrant[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant"), + factory,xmlWriter); + } else { + + // we don't have to do any thing since minOccures is zero + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Grant cannot be null!!"); + + } + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localGrantTracker){ + if (localGrant!=null) { + for (int i = 0;i < localGrant.length;i++){ + + if (localGrant[i] != null){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Grant")); + elementList.add(localGrant[i]); + } else { + + // nothing to do + + } + + } + } else { + + throw new org.apache.axis2.databinding.ADBException("Grant cannot be null!!"); + + } + + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static AccessControlList parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + AccessControlList object = + new AccessControlList(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"AccessControlList".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (AccessControlList)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + java.util.ArrayList list1 = new java.util.ArrayList(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant").equals(reader.getName())){ + + + + // Process the array and step past its final element's end. + list1.add(Grant.Factory.parse(reader)); + + //loop until we find a start element that is not part of this array + boolean loopDone1 = false; + while(!loopDone1){ + // We should be at the end element, but make sure + while (!reader.isEndElement()) + reader.next(); + // Step out of this element + reader.next(); + // Step to next element event. + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + if (reader.isEndElement()){ + //two continuous end elements means we are exiting the xml structure + loopDone1 = true; + } else { + if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Grant").equals(reader.getName())){ + list1.add(Grant.Factory.parse(reader)); + + }else{ + loopDone1 = true; + } + } + } + // call the converter utility to convert and set the array + + object.setGrant((Grant[]) + org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( + Grant.class, + list1)); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class ListBucketResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "ListBucketResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for ListBucketResponse + */ + + + protected ListBucketResult localListBucketResponse ; + + + /** + * Auto generated getter method + * @return ListBucketResult + */ + public ListBucketResult getListBucketResponse(){ + return localListBucketResponse; + } + + + + /** + * Auto generated setter method + * @param param ListBucketResponse + */ + public void setListBucketResponse(ListBucketResult param){ + + this.localListBucketResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + ListBucketResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":ListBucketResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "ListBucketResponse", + xmlWriter); + } + + + } + + if (localListBucketResponse==null){ + throw new org.apache.axis2.databinding.ADBException("ListBucketResponse cannot be null!!"); + } + localListBucketResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListBucketResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ListBucketResponse")); + + + if (localListBucketResponse==null){ + throw new org.apache.axis2.databinding.ADBException("ListBucketResponse cannot be null!!"); + } + elementList.add(localListBucketResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static ListBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + ListBucketResponse object = + new ListBucketResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"ListBucketResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (ListBucketResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ListBucketResponse").equals(reader.getName())){ + + object.setListBucketResponse(ListBucketResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class AccessControlPolicy + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = AccessControlPolicy + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Owner + */ + + + protected CanonicalUser localOwner ; + + + /** + * Auto generated getter method + * @return CanonicalUser + */ + public CanonicalUser getOwner(){ + return localOwner; + } + + + + /** + * Auto generated setter method + * @param param Owner + */ + public void setOwner(CanonicalUser param){ + + this.localOwner=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected AccessControlList localAccessControlList ; + + + /** + * Auto generated getter method + * @return AccessControlList + */ + public AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(AccessControlList param){ + + this.localAccessControlList=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + AccessControlPolicy.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":AccessControlPolicy", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "AccessControlPolicy", + xmlWriter); + } + + + } + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner"), + factory,xmlWriter); + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Owner")); + + + if (localOwner==null){ + throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); + } + elementList.add(localOwner); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static AccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + AccessControlPolicy object = + new AccessControlPolicy(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"AccessControlPolicy".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (AccessControlPolicy)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Owner").equals(reader.getName())){ + + object.setOwner(CanonicalUser.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class PrefixEntry + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = PrefixEntry + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Prefix + */ + + + protected java.lang.String localPrefix ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getPrefix(){ + return localPrefix; + } + + + + /** + * Auto generated setter method + * @param param Prefix + */ + public void setPrefix(java.lang.String param){ + + this.localPrefix=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PrefixEntry.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PrefixEntry", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PrefixEntry", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Prefix", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Prefix"); + } + + } else { + xmlWriter.writeStartElement("Prefix"); + } + + + if (localPrefix==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localPrefix); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Prefix")); + + if (localPrefix != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); + } else { + throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PrefixEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PrefixEntry object = + new PrefixEntry(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PrefixEntry".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PrefixEntry)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Prefix").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setPrefix( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetObjectAccessControlPolicy + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectAccessControlPolicy", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectAccessControlPolicy.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectAccessControlPolicy", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectAccessControlPolicy", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectAccessControlPolicy object = + new GetObjectAccessControlPolicy(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectAccessControlPolicy".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectAccessControlPolicy)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetObject + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObject", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for GetMetadata + */ + + + protected boolean localGetMetadata ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getGetMetadata(){ + return localGetMetadata; + } + + + + /** + * Auto generated setter method + * @param param GetMetadata + */ + public void setGetMetadata(boolean param){ + + this.localGetMetadata=param; + + + } + + + /** + * field for GetData + */ + + + protected boolean localGetData ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getGetData(){ + return localGetData; + } + + + + /** + * Auto generated setter method + * @param param GetData + */ + public void setGetData(boolean param){ + + this.localGetData=param; + + + } + + + /** + * field for InlineData + */ + + + protected boolean localInlineData ; + + + /** + * Auto generated getter method + * @return boolean + */ + public boolean getInlineData(){ + return localInlineData; + } + + + + /** + * Auto generated setter method + * @param param InlineData + */ + public void setInlineData(boolean param){ + + this.localInlineData=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObject.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObject", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObject", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"GetMetadata", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"GetMetadata"); + } + + } else { + xmlWriter.writeStartElement("GetMetadata"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("GetMetadata cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"GetData", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"GetData"); + } + + } else { + xmlWriter.writeStartElement("GetData"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("GetData cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"InlineData", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"InlineData"); + } + + } else { + xmlWriter.writeStartElement("InlineData"); + } + + if (false) { + + throw new org.apache.axis2.databinding.ADBException("InlineData cannot be null!!"); + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetMetadata")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetData")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "InlineData")); + + elementList.add( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObject object = + new GetObject(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObject".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObject)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetMetadata").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setGetMetadata( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetData").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setGetData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","InlineData").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setInlineData( + org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class CanonicalUser extends User + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = CanonicalUser + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for ID + */ + + + protected java.lang.String localID ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getID(){ + return localID; + } + + + + /** + * Auto generated setter method + * @param param ID + */ + public void setID(java.lang.String param){ + + this.localID=param; + + + } + + + /** + * field for DisplayName + */ + + + protected java.lang.String localDisplayName ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localDisplayNameTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getDisplayName(){ + return localDisplayName; + } + + + + /** + * Auto generated setter method + * @param param DisplayName + */ + public void setDisplayName(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localDisplayNameTracker = true; + } else { + localDisplayNameTracker = false; + + } + + this.localDisplayName=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CanonicalUser.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CanonicalUser", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CanonicalUser", + xmlWriter); + } + + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ID", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ID"); + } + + } else { + xmlWriter.writeStartElement("ID"); + } + + + if (localID==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ID cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localID); + + } + + xmlWriter.writeEndElement(); + if (localDisplayNameTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"DisplayName", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"DisplayName"); + } + + } else { + xmlWriter.writeStartElement("DisplayName"); + } + + + if (localDisplayName==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("DisplayName cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localDisplayName); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); + attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CanonicalUser")); + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ID")); + + if (localID != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localID)); + } else { + throw new org.apache.axis2.databinding.ADBException("ID cannot be null!!"); + } + if (localDisplayNameTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "DisplayName")); + + if (localDisplayName != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDisplayName)); + } else { + throw new org.apache.axis2.databinding.ADBException("DisplayName cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CanonicalUser parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CanonicalUser object = + new CanonicalUser(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CanonicalUser".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CanonicalUser)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ID").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setID( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","DisplayName").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setDisplayName( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetBucketLoggingStatusResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketLoggingStatusResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetBucketLoggingStatusResponse + */ + + + protected BucketLoggingStatus localGetBucketLoggingStatusResponse ; + + + /** + * Auto generated getter method + * @return BucketLoggingStatus + */ + public BucketLoggingStatus getGetBucketLoggingStatusResponse(){ + return localGetBucketLoggingStatusResponse; + } + + + + /** + * Auto generated setter method + * @param param GetBucketLoggingStatusResponse + */ + public void setGetBucketLoggingStatusResponse(BucketLoggingStatus param){ + + this.localGetBucketLoggingStatusResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetBucketLoggingStatusResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetBucketLoggingStatusResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetBucketLoggingStatusResponse", + xmlWriter); + } + + + } + + if (localGetBucketLoggingStatusResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetBucketLoggingStatusResponse cannot be null!!"); + } + localGetBucketLoggingStatusResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketLoggingStatusResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetBucketLoggingStatusResponse")); + + + if (localGetBucketLoggingStatusResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetBucketLoggingStatusResponse cannot be null!!"); + } + elementList.add(localGetBucketLoggingStatusResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetBucketLoggingStatusResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetBucketLoggingStatusResponse object = + new GetBucketLoggingStatusResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetBucketLoggingStatusResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetBucketLoggingStatusResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetBucketLoggingStatusResponse").equals(reader.getName())){ + + object.setGetBucketLoggingStatusResponse(BucketLoggingStatus.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class Result + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = Result + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Status + */ + + + protected Status localStatus ; + + + /** + * Auto generated getter method + * @return Status + */ + public Status getStatus(){ + return localStatus; + } + + + + /** + * Auto generated setter method + * @param param Status + */ + public void setStatus(Status param){ + + this.localStatus=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + Result.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":Result", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "Result", + xmlWriter); + } + + + } + + if (localStatus==null){ + throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); + } + localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Status")); + + + if (localStatus==null){ + throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); + } + elementList.add(localStatus); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static Result parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + Result object = + new Result(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"Result".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (Result)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Status").equals(reader.getName())){ + + object.setStatus(Status.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class CopyObjectResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "CopyObjectResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for CopyObjectResult + */ + + + protected CopyObjectResult localCopyObjectResult ; + + + /** + * Auto generated getter method + * @return CopyObjectResult + */ + public CopyObjectResult getCopyObjectResult(){ + return localCopyObjectResult; + } + + + + /** + * Auto generated setter method + * @param param CopyObjectResult + */ + public void setCopyObjectResult(CopyObjectResult param){ + + this.localCopyObjectResult=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CopyObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CopyObjectResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CopyObjectResponse", + xmlWriter); + } + + + } + + if (localCopyObjectResult==null){ + throw new org.apache.axis2.databinding.ADBException("CopyObjectResult cannot be null!!"); + } + localCopyObjectResult.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopyObjectResult"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "CopyObjectResult")); + + + if (localCopyObjectResult==null){ + throw new org.apache.axis2.databinding.ADBException("CopyObjectResult cannot be null!!"); + } + elementList.add(localCopyObjectResult); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CopyObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CopyObjectResponse object = + new CopyObjectResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CopyObjectResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CopyObjectResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","CopyObjectResult").equals(reader.getName())){ + + object.setCopyObjectResult(CopyObjectResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class GetObjectResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetObjectResponse + */ + + + protected GetObjectResult localGetObjectResponse ; + + + /** + * Auto generated getter method + * @return GetObjectResult + */ + public GetObjectResult getGetObjectResponse(){ + return localGetObjectResponse; + } + + + + /** + * Auto generated setter method + * @param param GetObjectResponse + */ + public void setGetObjectResponse(GetObjectResult param){ + + this.localGetObjectResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":GetObjectResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "GetObjectResponse", + xmlWriter); + } + + + } + + if (localGetObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); + } + localGetObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "GetObjectResponse")); + + + if (localGetObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); + } + elementList.add(localGetObjectResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetObjectResponse object = + new GetObjectResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"GetObjectResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetObjectResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","GetObjectResponse").equals(reader.getName())){ + + object.setGetObjectResponse(GetObjectResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class PutObjectInlineResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "PutObjectInlineResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for PutObjectInlineResponse + */ + + + protected PutObjectResult localPutObjectInlineResponse ; + + + /** + * Auto generated getter method + * @return PutObjectResult + */ + public PutObjectResult getPutObjectInlineResponse(){ + return localPutObjectInlineResponse; + } + + + + /** + * Auto generated setter method + * @param param PutObjectInlineResponse + */ + public void setPutObjectInlineResponse(PutObjectResult param){ + + this.localPutObjectInlineResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PutObjectInlineResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PutObjectInlineResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PutObjectInlineResponse", + xmlWriter); + } + + + } + + if (localPutObjectInlineResponse==null){ + throw new org.apache.axis2.databinding.ADBException("PutObjectInlineResponse cannot be null!!"); + } + localPutObjectInlineResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectInlineResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "PutObjectInlineResponse")); + + + if (localPutObjectInlineResponse==null){ + throw new org.apache.axis2.databinding.ADBException("PutObjectInlineResponse cannot be null!!"); + } + elementList.add(localPutObjectInlineResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PutObjectInlineResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PutObjectInlineResponse object = + new PutObjectInlineResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PutObjectInlineResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PutObjectInlineResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectInlineResponse").equals(reader.getName())){ + + object.setPutObjectInlineResponse(PutObjectResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class CreateBucket + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "CreateBucket", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AccessControlList + */ + + + protected AccessControlList localAccessControlList ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAccessControlListTracker = false ; + + + /** + * Auto generated getter method + * @return AccessControlList + */ + public AccessControlList getAccessControlList(){ + return localAccessControlList; + } + + + + /** + * Auto generated setter method + * @param param AccessControlList + */ + public void setAccessControlList(AccessControlList param){ + + if (param != null){ + //update the setting tracker + localAccessControlListTracker = true; + } else { + localAccessControlListTracker = false; + + } + + this.localAccessControlList=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + CreateBucket.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":CreateBucket", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "CreateBucket", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAccessControlListTracker){ + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList"), + factory,xmlWriter); + } if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAccessControlListTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AccessControlList")); + + + if (localAccessControlList==null){ + throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); + } + elementList.add(localAccessControlList); + } if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static CreateBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + CreateBucket object = + new CreateBucket(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"CreateBucket".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (CreateBucket)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AccessControlList").equals(reader.getName())){ + + object.setAccessControlList(AccessControlList.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class PutObjectResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "PutObjectResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for PutObjectResponse + */ + + + protected PutObjectResult localPutObjectResponse ; + + + /** + * Auto generated getter method + * @return PutObjectResult + */ + public PutObjectResult getPutObjectResponse(){ + return localPutObjectResponse; + } + + + + /** + * Auto generated setter method + * @param param PutObjectResponse + */ + public void setPutObjectResponse(PutObjectResult param){ + + this.localPutObjectResponse=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PutObjectResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PutObjectResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PutObjectResponse", + xmlWriter); + } + + + } + + if (localPutObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("PutObjectResponse cannot be null!!"); + } + localPutObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectResponse"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "PutObjectResponse")); + + + if (localPutObjectResponse==null){ + throw new org.apache.axis2.databinding.ADBException("PutObjectResponse cannot be null!!"); + } + elementList.add(localPutObjectResponse); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PutObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PutObjectResponse object = + new PutObjectResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PutObjectResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PutObjectResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","PutObjectResponse").equals(reader.getName())){ + + object.setPutObjectResponse(PutObjectResult.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class PostResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "PostResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Location + */ + + + protected org.apache.axis2.databinding.types.URI localLocation ; + + + /** + * Auto generated getter method + * @return org.apache.axis2.databinding.types.URI + */ + public org.apache.axis2.databinding.types.URI getLocation(){ + return localLocation; + } + + + + /** + * Auto generated setter method + * @param param Location + */ + public void setLocation(org.apache.axis2.databinding.types.URI param){ + + this.localLocation=param; + + + } + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for Key + */ + + + protected java.lang.String localKey ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getKey(){ + return localKey; + } + + + + /** + * Auto generated setter method + * @param param Key + */ + public void setKey(java.lang.String param){ + + this.localKey=param; + + + } + + + /** + * field for ETag + */ + + + protected java.lang.String localETag ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getETag(){ + return localETag; + } + + + + /** + * Auto generated setter method + * @param param ETag + */ + public void setETag(java.lang.String param){ + + this.localETag=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + PostResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":PostResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "PostResponse", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Location", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Location"); + } + + } else { + xmlWriter.writeStartElement("Location"); + } + + + if (localLocation==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Location cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocation)); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Key", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Key"); + } + + } else { + xmlWriter.writeStartElement("Key"); + } + + + if (localKey==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localKey); + + } + + xmlWriter.writeEndElement(); + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"ETag", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"ETag"); + } + + } else { + xmlWriter.writeStartElement("ETag"); + } + + + if (localETag==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localETag); + + } + + xmlWriter.writeEndElement(); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Location")); + + if (localLocation != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocation)); + } else { + throw new org.apache.axis2.databinding.ADBException("Location cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Key")); + + if (localKey != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); + } else { + throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); + } + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "ETag")); + + if (localETag != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); + } else { + throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); + } + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static PostResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + PostResponse object = + new PostResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"PostResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (PostResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Location").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setLocation( + org.apache.axis2.databinding.utils.ConverterUtil.convertToAnyURI(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Key").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setKey( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","ETag").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setETag( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class SetBucketAccessControlPolicyResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetBucketAccessControlPolicyResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetBucketAccessControlPolicyResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetBucketAccessControlPolicyResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetBucketAccessControlPolicyResponse", + xmlWriter); + } + + + } + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetBucketAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetBucketAccessControlPolicyResponse object = + new SetBucketAccessControlPolicyResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetBucketAccessControlPolicyResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetBucketAccessControlPolicyResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class SetBucketLoggingStatusResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetBucketLoggingStatusResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetBucketLoggingStatusResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetBucketLoggingStatusResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetBucketLoggingStatusResponse", + xmlWriter); + } + + + } + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetBucketLoggingStatusResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetBucketLoggingStatusResponse object = + new SetBucketLoggingStatusResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetBucketLoggingStatusResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetBucketLoggingStatusResponse)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class User extends Grantee + implements org.apache.axis2.databinding.ADBBean{ + /* This type was generated from the piece of schema that had + name = User + Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ + Namespace Prefix = ns1 + */ + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,parentQName){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + User.this.serialize(parentQName,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + parentQName,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":User", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "User", + xmlWriter); + } + + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + attribList.add(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema-instance","type")); + attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","User")); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static User parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + User object = + null; + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"User".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (User)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + throw new org.apache.axis2.databinding.ADBException("The an abstract class can not be instantiated !!!"); + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + public static class SetBucketLoggingStatus + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://s3.amazonaws.com/doc/2006-03-01/", + "SetBucketLoggingStatus", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for Bucket + */ + + + protected java.lang.String localBucket ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getBucket(){ + return localBucket; + } + + + + /** + * Auto generated setter method + * @param param Bucket + */ + public void setBucket(java.lang.String param){ + + this.localBucket=param; + + + } + + + /** + * field for AWSAccessKeyId + */ + + + protected java.lang.String localAWSAccessKeyId ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localAWSAccessKeyIdTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getAWSAccessKeyId(){ + return localAWSAccessKeyId; + } + + + + /** + * Auto generated setter method + * @param param AWSAccessKeyId + */ + public void setAWSAccessKeyId(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localAWSAccessKeyIdTracker = true; + } else { + localAWSAccessKeyIdTracker = false; + + } + + this.localAWSAccessKeyId=param; + + + } + + + /** + * field for Timestamp + */ + + + protected java.util.Calendar localTimestamp ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localTimestampTracker = false ; + + + /** + * Auto generated getter method + * @return java.util.Calendar + */ + public java.util.Calendar getTimestamp(){ + return localTimestamp; + } + + + + /** + * Auto generated setter method + * @param param Timestamp + */ + public void setTimestamp(java.util.Calendar param){ + + if (param != null){ + //update the setting tracker + localTimestampTracker = true; + } else { + localTimestampTracker = false; + + } + + this.localTimestamp=param; + + + } + + + /** + * field for Signature + */ + + + protected java.lang.String localSignature ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localSignatureTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getSignature(){ + return localSignature; + } + + + + /** + * Auto generated setter method + * @param param Signature + */ + public void setSignature(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localSignatureTracker = true; + } else { + localSignatureTracker = false; + + } + + this.localSignature=param; + + + } + + + /** + * field for Credential + */ + + + protected java.lang.String localCredential ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localCredentialTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getCredential(){ + return localCredential; + } + + + + /** + * Auto generated setter method + * @param param Credential + */ + public void setCredential(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localCredentialTracker = true; + } else { + localCredentialTracker = false; + + } + + this.localCredential=param; + + + } + + + /** + * field for BucketLoggingStatus + */ + + + protected BucketLoggingStatus localBucketLoggingStatus ; + + + /** + * Auto generated getter method + * @return BucketLoggingStatus + */ + public BucketLoggingStatus getBucketLoggingStatus(){ + return localBucketLoggingStatus; + } + + + + /** + * Auto generated setter method + * @param param BucketLoggingStatus + */ + public void setBucketLoggingStatus(BucketLoggingStatus param){ + + this.localBucketLoggingStatus=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + SetBucketLoggingStatus.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://s3.amazonaws.com/doc/2006-03-01/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":SetBucketLoggingStatus", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "SetBucketLoggingStatus", + xmlWriter); + } + + + } + + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Bucket", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Bucket"); + } + + } else { + xmlWriter.writeStartElement("Bucket"); + } + + + if (localBucket==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localBucket); + + } + + xmlWriter.writeEndElement(); + if (localAWSAccessKeyIdTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"AWSAccessKeyId", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"AWSAccessKeyId"); + } + + } else { + xmlWriter.writeStartElement("AWSAccessKeyId"); + } + + + if (localAWSAccessKeyId==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localAWSAccessKeyId); + + } + + xmlWriter.writeEndElement(); + } if (localTimestampTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Timestamp", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Timestamp"); + } + + } else { + xmlWriter.writeStartElement("Timestamp"); + } + + + if (localTimestamp==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + + } + + xmlWriter.writeEndElement(); + } if (localSignatureTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Signature", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Signature"); + } + + } else { + xmlWriter.writeStartElement("Signature"); + } + + + if (localSignature==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localSignature); + + } + + xmlWriter.writeEndElement(); + } if (localCredentialTracker){ + namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"Credential", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"Credential"); + } + + } else { + xmlWriter.writeStartElement("Credential"); + } + + + if (localCredential==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localCredential); + + } + + xmlWriter.writeEndElement(); + } + if (localBucketLoggingStatus==null){ + throw new org.apache.axis2.databinding.ADBException("BucketLoggingStatus cannot be null!!"); + } + localBucketLoggingStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketLoggingStatus"), + factory,xmlWriter); + + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Bucket")); + + if (localBucket != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); + } else { + throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); + } + if (localAWSAccessKeyIdTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "AWSAccessKeyId")); + + if (localAWSAccessKeyId != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); + } else { + throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); + } + } if (localTimestampTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Timestamp")); + + if (localTimestamp != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); + } else { + throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); + } + } if (localSignatureTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Signature")); + + if (localSignature != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); + } else { + throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); + } + } if (localCredentialTracker){ + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "Credential")); + + if (localCredential != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); + } else { + throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); + } + } + elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", + "BucketLoggingStatus")); + + + if (localBucketLoggingStatus==null){ + throw new org.apache.axis2.databinding.ADBException("BucketLoggingStatus cannot be null!!"); + } + elementList.add(localBucketLoggingStatus); + + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static SetBucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + SetBucketLoggingStatus object = + new SetBucketLoggingStatus(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"SetBucketLoggingStatus".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (SetBucketLoggingStatus)ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Bucket").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setBucket( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","AWSAccessKeyId").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setAWSAccessKeyId( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Timestamp").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setTimestamp( + org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Signature").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setSignature( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","Credential").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setCredential( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/","BucketLoggingStatus").equals(reader.getName())){ + + object.setBucketLoggingStatus(BucketLoggingStatus.Factory.parse(reader)); + + reader.next(); + + } // End of if for expected property start element + + else{ + // A start element we are not expecting indicates an invalid parameter was passed + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.CopyObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CopyObject.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.ListBucket param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListBucket.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.ListBucketResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.PutObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObject.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.PutObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.CreateBucket param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CreateBucket.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObject.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.DeleteBucket param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteBucket.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.DeleteObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteObject.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.PutObjectInline param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectInline.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObjectExtended param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.CopyObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CopyObject.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.ListBucket param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListBucket.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.PutObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObject.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.CreateBucket param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CreateBucket.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObject.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.DeleteBucket param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteBucket.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.DeleteObject param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteObject.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.PutObjectInline param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectInline.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetObjectExtended param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + + + try{ + + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.MY_QNAME,factory)); + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + + /* methods to provide back word compatibility */ + + + + + /** + * get the default envelope + */ + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){ + return factory.getDefaultEnvelope(); + } + + + private java.lang.Object fromOM( + org.apache.axiom.om.OMElement param, + java.lang.Class type, + java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{ + + try { + + if (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.CopyObject.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.CopyObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.ListBucket.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.ListBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.PutObject.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.PutObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.CreateBucket.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.CreateBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.GetObject.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.GetObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.DeleteBucket.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.DeleteBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.DeleteObject.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.DeleteObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.PutObjectInline.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.PutObjectInline.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.class.equals(type)){ + + return com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + } catch (java.lang.Exception e) { + throw org.apache.axis2.AxisFault.makeFault(e); + } + return null; + } + + + + + } \ No newline at end of file diff --git a/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationHandler.java b/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationHandler.java index 3974654b4f4..f17e49393cd 100644 --- a/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationHandler.java +++ b/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationHandler.java @@ -1,153 +1,169 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.auth.ec2; - -import org.apache.axiom.soap.SOAPEnvelope; -import org.apache.log4j.Logger; -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.engine.Handler; -import org.apache.axis2.AxisFault; -import org.apache.axis2.description.HandlerDescription; -import org.apache.axis2.description.Parameter; -import org.apache.commons.codec.binary.Base64; - -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import java.security.cert.Certificate; -import java.security.cert.CertificateFactory; -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import com.cloud.bridge.model.UserCredentials; -import com.cloud.bridge.persist.dao.UserCredentialsDao; -import com.cloud.bridge.service.UserContext; -import com.cloud.bridge.util.AuthenticationUtils; - - -public class AuthenticationHandler implements Handler { - protected final static Logger logger = Logger.getLogger(AuthenticationHandler.class); - - private DocumentBuilderFactory dbf = null; - - protected HandlerDescription handlerDesc = new HandlerDescription( "EC2AuthenticationHandler" ); - private String name = "EC2AuthenticationHandler"; - - public void init( HandlerDescription handlerdesc ) - { - dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware( true ); - - this.handlerDesc = handlerdesc; - } - - public String getName() - { - return name; - } - - public String toString() - { - return (name != null) ? name.toString() : null; - } - - public HandlerDescription getHandlerDesc() - { - return handlerDesc; - } - - public Parameter getParameter( String name ) - { - return handlerDesc.getParameter( name ); - } - - - /** - * For EC2 SOAP calls this function's goal is to extract the X509 certificate that is - * part of the WS-Security wrapped SOAP request. We need the cert in order to - * map it to the user's Cloud API key and Cloud Secret Key. - */ - public InvocationResponse invoke(MessageContext msgContext) throws AxisFault - { - // -> the certificate we want is embedded into the soap header - try - { SOAPEnvelope soapEnvelope = msgContext.getEnvelope(); - String xmlHeader = soapEnvelope.toString(); - //System.out.println( "entire request: " + xmlHeader ); - - InputStream is = new ByteArrayInputStream( xmlHeader.getBytes("UTF-8")); - DocumentBuilder db = dbf.newDocumentBuilder(); - Document request = db.parse( is ); - NodeList certs = request.getElementsByTagNameNS( "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "BinarySecurityToken" ); - if (0 < certs.getLength()) { - Node item = certs.item(0); - String result = new String( item.getFirstChild().getNodeValue()); - byte[] certBytes = Base64.decodeBase64( result.getBytes()); - - Certificate userCert = null; - CertificateFactory cf = CertificateFactory.getInstance( "X.509" ); - ByteArrayInputStream bs = new ByteArrayInputStream( certBytes ); - while (bs.available() > 0) userCert = cf.generateCertificate(bs); - //System.out.println( "cert: " + userCert.toString()); - String uniqueId = AuthenticationUtils.X509CertUniqueId( userCert ); - logger.debug( "X509 cert's uniqueId: " + uniqueId ); - - // -> find the Cloud API key and the secret key from the cert's uniqueId - UserCredentialsDao credentialDao = new UserCredentialsDao(); - UserCredentials cloudKeys = credentialDao.getByCertUniqueId( uniqueId ); - if ( null == cloudKeys ) { - logger.error( "Cert does not map to Cloud API keys: " + uniqueId ); - throw new AxisFault( "User not properly registered: Certificate does not map to Cloud API Keys", "Client.Blocked" ); - } - else UserContext.current().initContext( cloudKeys.getAccessKey(), cloudKeys.getSecretKey(), cloudKeys.getAccessKey(), "SOAP Request", null ); - //System.out.println( "end of cert match: " + UserContext.current().getSecretKey()); - } - } - catch (AxisFault e) { - throw e; - } - catch( Exception e ) { - logger.error("EC2 Authentication Handler: ", e); - throw new AxisFault( "An unknown error occurred.", "Server.InternalError" ); - } - return InvocationResponse.CONTINUE; - } - - - public void revoke(MessageContext msgContext) - { - logger.info(msgContext.getEnvelope().toString()); - } - - public void setName(String name) - { - this.name = name; - } - - @Override - public void cleanup() - { - } - - @Override - public void flowComplete( MessageContext arg0 ) - { - } +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.auth.ec2; + +import org.apache.axiom.soap.SOAPEnvelope; +import org.apache.log4j.Logger; +import org.apache.axis2.context.MessageContext; +import org.apache.axis2.engine.Handler; +import org.apache.axis2.AxisFault; +import org.apache.axis2.description.HandlerDescription; +import org.apache.axis2.description.Parameter; +import org.apache.commons.codec.binary.Base64; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import java.security.cert.Certificate; +import java.security.cert.CertificateFactory; +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import com.cloud.bridge.model.UserCredentials; +import com.cloud.bridge.persist.dao.UserCredentialsDao; +import com.cloud.bridge.service.UserContext; +import com.cloud.bridge.util.AuthenticationUtils; + + +public class AuthenticationHandler implements Handler { + protected final static Logger logger = Logger.getLogger(AuthenticationHandler.class); + + private DocumentBuilderFactory dbf = null; + + protected HandlerDescription handlerDesc = new HandlerDescription( "EC2AuthenticationHandler" ); + private String name = "EC2AuthenticationHandler"; + + public void init( HandlerDescription handlerdesc ) + { + dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware( true ); + + this.handlerDesc = handlerdesc; + } + + public String getName() + { + return name; + } + + public String toString() + { + return (name != null) ? name.toString() : null; + } + + public HandlerDescription getHandlerDesc() + { + return handlerDesc; + } + + public Parameter getParameter( String name ) + { + return handlerDesc.getParameter( name ); + } + + + /** + * For EC2 SOAP calls this function's goal is to extract the X509 certificate that is + * part of the WS-Security wrapped SOAP request. We need the cert in order to + * map it to the user's Cloud API key and Cloud Secret Key. + */ + public InvocationResponse invoke(MessageContext msgContext) throws AxisFault + { + // -> the certificate we want is embedded into the soap header + try + { SOAPEnvelope soapEnvelope = msgContext.getEnvelope(); + String xmlHeader = soapEnvelope.toString(); + //System.out.println( "entire request: " + xmlHeader ); + + InputStream is = new ByteArrayInputStream( xmlHeader.getBytes("UTF-8")); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document request = db.parse( is ); + NodeList certs = request.getElementsByTagNameNS( "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "BinarySecurityToken" ); + if (0 < certs.getLength()) { + Node item = certs.item(0); + String result = new String( item.getFirstChild().getNodeValue()); + byte[] certBytes = Base64.decodeBase64( result.getBytes()); + + Certificate userCert = null; + CertificateFactory cf = CertificateFactory.getInstance( "X.509" ); + ByteArrayInputStream bs = new ByteArrayInputStream( certBytes ); + while (bs.available() > 0) userCert = cf.generateCertificate(bs); + //System.out.println( "cert: " + userCert.toString()); + String uniqueId = AuthenticationUtils.X509CertUniqueId( userCert ); + logger.debug( "X509 cert's uniqueId: " + uniqueId ); + + // -> find the Cloud API key and the secret key from the cert's uniqueId + UserCredentialsDao credentialDao = new UserCredentialsDao(); + UserCredentials cloudKeys = credentialDao.getByCertUniqueId( uniqueId ); + if ( null == cloudKeys ) { + logger.error( "Cert does not map to Cloud API keys: " + uniqueId ); + throw new AxisFault( "User not properly registered: Certificate does not map to Cloud API Keys", "Client.Blocked" ); + } + else UserContext.current().initContext( cloudKeys.getAccessKey(), cloudKeys.getSecretKey(), cloudKeys.getAccessKey(), "SOAP Request", null ); + //System.out.println( "end of cert match: " + UserContext.current().getSecretKey()); + } + } + catch (AxisFault e) { + throw e; + } + catch( Exception e ) { + logger.error("EC2 Authentication Handler: ", e); + throw new AxisFault( "An unknown error occurred.", "Server.InternalError" ); + } + return InvocationResponse.CONTINUE; + } + + + public void revoke(MessageContext msgContext) + { + logger.info(msgContext.getEnvelope().toString()); + } + + public void setName(String name) + { + this.name = name; + } + + @Override + public void cleanup() + { + } + + @Override + public void flowComplete( MessageContext arg0 ) + { + } } diff --git a/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationModule.java b/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationModule.java index 6234aee8fb2..7c446d25bde 100644 --- a/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationModule.java +++ b/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationModule.java @@ -1,57 +1,73 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.auth.ec2; - -import org.apache.axis2.modules.Module; - -import org.apache.log4j.Logger; -import org.apache.axis2.AxisFault; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.description.AxisDescription; -import org.apache.axis2.description.AxisModule; -import org.apache.neethi.Assertion; -import org.apache.neethi.Policy; - -public class AuthenticationModule implements Module { - protected final static Logger logger = Logger.getLogger(AuthenticationModule.class); - - public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault - { - logger.debug( "init entry EC2 AuthenticationModule" ); - } - - public String[] getPolicyNamespaces() - { - return null; - } - - public void engageNotify(AxisDescription axisDescription) throws AxisFault - { - } - - public boolean canSupportAssertion(Assertion assertion) - { - return true; - } - - public void applyPolicy(Policy policy, AxisDescription axisDescription) throws AxisFault - { - } - - public void shutdown(ConfigurationContext configurationContext) throws AxisFault - { - } +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.auth.ec2; + +import org.apache.axis2.modules.Module; + +import org.apache.log4j.Logger; +import org.apache.axis2.AxisFault; +import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.description.AxisDescription; +import org.apache.axis2.description.AxisModule; +import org.apache.neethi.Assertion; +import org.apache.neethi.Policy; + +public class AuthenticationModule implements Module { + protected final static Logger logger = Logger.getLogger(AuthenticationModule.class); + + public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault + { + logger.debug( "init entry EC2 AuthenticationModule" ); + } + + public String[] getPolicyNamespaces() + { + return null; + } + + public void engageNotify(AxisDescription axisDescription) throws AxisFault + { + } + + public boolean canSupportAssertion(Assertion assertion) + { + return true; + } + + public void applyPolicy(Policy policy, AxisDescription axisDescription) throws AxisFault + { + } + + public void shutdown(ConfigurationContext configurationContext) throws AxisFault + { + } } diff --git a/awsapi/src/com/cloud/bridge/auth/ec2/module.xml b/awsapi/src/com/cloud/bridge/auth/ec2/module.xml index 70d6cee9631..0cbd8041083 100644 --- a/awsapi/src/com/cloud/bridge/auth/ec2/module.xml +++ b/awsapi/src/com/cloud/bridge/auth/ec2/module.xml @@ -1,17 +1,17 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationHandler.java b/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationHandler.java index e7a29dd29ef..ac2fa55c789 100644 --- a/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationHandler.java +++ b/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationHandler.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationModule.java b/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationModule.java index c9a9314ba0e..3e6bcacb620 100644 --- a/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationModule.java +++ b/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationModule.java @@ -1,59 +1,75 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.auth.s3; - -import org.apache.axis2.modules.Module; - -import org.apache.log4j.Logger; -import org.apache.axis2.AxisFault; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.description.AxisDescription; -import org.apache.axis2.description.AxisModule; -import org.apache.neethi.Assertion; -import org.apache.neethi.Policy; - -public class AuthenticationModule implements Module { - protected final static Logger logger = Logger.getLogger(AuthenticationModule.class); - - public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault - { - logger.debug( "init entry S3 AuthenticationModule" ); - } - - public String[] getPolicyNamespaces() - { - return null; - } - - public void engageNotify(AxisDescription axisDescription) throws AxisFault - { - //logger.info( "engageNotify entry S3AuthenticationModule" ); - } - - public boolean canSupportAssertion(Assertion assertion) - { - return true; - } - - public void applyPolicy(Policy policy, AxisDescription axisDescription) throws AxisFault - { - } - - public void shutdown(ConfigurationContext configurationContext) throws AxisFault - { - //logger.info( "shutdown entry S3AuthenticationModule" ); - } +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.auth.s3; + +import org.apache.axis2.modules.Module; + +import org.apache.log4j.Logger; +import org.apache.axis2.AxisFault; +import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.description.AxisDescription; +import org.apache.axis2.description.AxisModule; +import org.apache.neethi.Assertion; +import org.apache.neethi.Policy; + +public class AuthenticationModule implements Module { + protected final static Logger logger = Logger.getLogger(AuthenticationModule.class); + + public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault + { + logger.debug( "init entry S3 AuthenticationModule" ); + } + + public String[] getPolicyNamespaces() + { + return null; + } + + public void engageNotify(AxisDescription axisDescription) throws AxisFault + { + //logger.info( "engageNotify entry S3AuthenticationModule" ); + } + + public boolean canSupportAssertion(Assertion assertion) + { + return true; + } + + public void applyPolicy(Policy policy, AxisDescription axisDescription) throws AxisFault + { + } + + public void shutdown(ConfigurationContext configurationContext) throws AxisFault + { + //logger.info( "shutdown entry S3AuthenticationModule" ); + } } diff --git a/awsapi/src/com/cloud/bridge/auth/s3/module.xml b/awsapi/src/com/cloud/bridge/auth/s3/module.xml index 7e3f3e94b4b..cb22ed2bb4a 100644 --- a/awsapi/src/com/cloud/bridge/auth/s3/module.xml +++ b/awsapi/src/com/cloud/bridge/auth/s3/module.xml @@ -1,17 +1,17 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/io/DimeDelimitedInputStream.java b/awsapi/src/com/cloud/bridge/io/DimeDelimitedInputStream.java index bad5164127d..4a981f83336 100644 --- a/awsapi/src/com/cloud/bridge/io/DimeDelimitedInputStream.java +++ b/awsapi/src/com/cloud/bridge/io/DimeDelimitedInputStream.java @@ -1,617 +1,633 @@ -/* Took the basic code from Axis 1.2 and modified to fit into the cloud code base */ - -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.io; - -import java.io.IOException; -import java.io.InputStream; -import java.io.FilterInputStream; -import org.apache.log4j.Logger; - - -/** - * This class takes the input stream and turns it multiple streams. - DIME version 0 format -
    - 0                   1                   2                   3
    - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ---
    - | VERSION |B|E|C| TYPE_T| OPT_T |         OPTIONS_LENGTH        |   A
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    - |          ID_LENGTH          |             TYPE_LENGTH         |   Always present 12 bytes
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   even on chunked data.
    - |                          DATA_LENGTH                          |   V
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ---
    - |                                                               /
    - /                       OPTIONS + PADDING                       /
    - /                     (absent for version 0)                    |
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    - |                                                               /
    - /                        ID + PADDING                           /
    - /                                                               |
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    - |                                                               /
    - /                        TYPE + PADDING                         /
    - /                                                               |
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    - |                                                               /
    - /                        DATA + PADDING                         /
    - /                                                               |
    - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    -
    - * This implementation of input stream does not support marking operations. - * - * Incoming data is DIME encoded when its MIME type is "application/dime". - * Then use this class to pull out 2 streams: - * (1) The first stream is the SOAP request, - * (2) The second stream is a chunked attachment (e.g., a file to store) - * - * The DIME format is defined at this reference: - * http://msdn.microsoft.com/en-us/library/aa480488.aspx - * - * @author Rick Rineholt - */ -public class DimeDelimitedInputStream extends FilterInputStream -{ - protected final static Logger logger = Logger.getLogger(DimeDelimitedInputStream.class); - - InputStream is = null; //The source input stream. - boolean closed = true; //The stream has been closed. - boolean theEnd = false; //There are no more streams left. - boolean moreChunks = false; //More chunks are a coming! - boolean MB = false; //Message begin flag - boolean ME = false; //Message end flag - String type = null; // - String id = null; // - String tnf = null; //DIME type format - long recordLength = 0L; //length of the current record. - long bytesRead = 0L; //How many bytes of the current record have been read. - int dataPadLength = 0; //How many pad bytes there are. - - protected int streamNo = 0; - protected IOException streamInError = null; - - private static byte[] trash = new byte[4]; - protected static int streamCount = 0; //number of streams produced. - - protected static synchronized int newStreamNo() - { - logger.debug( "streamNo " + (streamCount + 1)); - return ++streamCount; - } - - - /** - * There can be multiple streams in a DIME encoding. For example, the first - * stream can be a SOAP message, and the second stream a binary attachment (e.g., - * a file). During reading after an EOF is returned, this function should be - * called to see if there is another stream following the last. - * - * @return the dime delimited stream, null if there are no more streams - * @throws IOException if there was an error loading the data for the next stream - */ - public synchronized DimeDelimitedInputStream getNextStream() throws IOException - { - if (null != streamInError) throw streamInError; - if (theEnd) return null; - - //Each Stream must be read in succession - if (bytesRead < recordLength || moreChunks) - throw new RuntimeException("attach.dimeReadFullyError"); - - dataPadLength -= readPad(dataPadLength); - - //Create an new dime stream that comes after this one. - return new DimeDelimitedInputStream( this.is ); - } - - - /** - * Create a new dime stream. - * - * @param is the InputStream to wrap - * @throws IOException if anything goes wrong - */ - public DimeDelimitedInputStream( InputStream is ) throws IOException - { - super(null); - streamNo = newStreamNo(); - closed = false; - this.is = is; - readHeader( false ); - } - - - /** - * Make sure to skip the pad which appear in several parts of a DIME message. - * @param size - * @return - * @throws IOException - */ - private final int readPad( int size ) throws IOException - { - if (0 == size) return 0; - int read = readFromStream(trash, 0, size); - - if (size != read) - { - streamInError = new IOException("attach.dimeNotPaddedCorrectly"); - throw streamInError; - } - return read; - } - - - private final int readFromStream( byte[] b ) throws IOException - { - return readFromStream( b, 0, b.length ); - } - - private final int readFromStream( byte[] b, int start, int length ) throws IOException - { - int br = 0; - int brTotal = 0; - - if (length == 0) return 0; - - do - { try - { - br = is.read( b, brTotal + start, length - brTotal ); - } - catch (IOException e) - { - streamInError = e; - throw e; - } - if (br > 0) brTotal += br; - } - while( br > -1 && brTotal < length ); - - return br > -1 ? brTotal : br; - } - - - /** - * Get the id for this stream part. - * @return the id; - */ - public String getContentId() - { - return id; - } - - public String getDimeTypeNameFormat() - { - return tnf; - } - - /** - * Get the type, as read from the header. - * @return the type of this dime - */ - public String getType() - { - return type; - } - - - /** - * Read from the DIME stream. - * - * @param b is the array to read into. - * @param off is the offset - * @return the number of bytes read. -1 if endof stream - * @throws IOException if data could not be read from the stream - */ - public synchronized int read( byte[] b, int off, int len ) throws IOException - { - if (closed) - { - dataPadLength -= readPad(dataPadLength); - throw new IOException( "streamClosed" ); - } - return _read( b, off, len ); - } - - - protected int _read( byte[] b, int off, int len ) throws IOException - { - int totalbytesread = 0; - int bytes2read = 0; - - if (len < 0) - throw new IllegalArgumentException( "attach.readLengthError" + len ); - - if (off < 0) - throw new IllegalArgumentException( "attach.readOffsetError" + off ); - - if (b == null) - throw new IllegalArgumentException( "attach.readArrayNullError" ); - - if (b.length < off + len) - throw new IllegalArgumentException("attach.readArraySizeError " + b.length + " " + len + " " + off ); - - if (null != streamInError) throw streamInError; - if (0 == len) return 0; //quick. - - // odd case no data to read -- give back 0 next time -1; - if (recordLength == 0 && bytesRead == 0 && !moreChunks) - { - ++bytesRead; - if (ME) finalClose(); - return 0; - } - if (bytesRead >= recordLength && !moreChunks) - { - dataPadLength -= readPad( dataPadLength ); - if (ME) finalClose(); - return -1; - } - - - do - { if (bytesRead >= recordLength && moreChunks) readHeader( true ); - bytes2read = (int) Math.min( recordLength - bytesRead, (long)len - totalbytesread ); - - try - { bytes2read = is.read( b, off + totalbytesread, bytes2read ); - } - catch (IOException e) - { - streamInError = e; - throw e; - } - - if (0 < bytes2read) - { - totalbytesread += bytes2read; - bytesRead += bytes2read; - } - } - while( bytes2read > -1 && totalbytesread < len && (bytesRead < recordLength || moreChunks)); - - if ( 0 > bytes2read ) - { - if (moreChunks) - { - streamInError = new IOException("attach.DimeStreamError0"); - throw streamInError; - } - if (bytesRead < recordLength) - { - streamInError = new IOException("attach.DimeStreamError1 " + (recordLength - bytesRead)); - throw streamInError; - } - if (!ME) - { - streamInError = new IOException("attach.DimeStreamError0"); - throw streamInError; - } - //in theory the last chunk of data should also have been padded, but lets be tolerant of that. - dataPadLength = 0; - } - else if (bytesRead >= recordLength) - { - //get rid of pading. - try - { dataPadLength -= readPad( dataPadLength ); - } - catch (IOException e) - { - //in theory the last chunk of data should also have been padded, but lets be tolerant of that. - if (!ME) throw e; - else - { - dataPadLength = 0; - streamInError = null; - } - } - } - - if (bytesRead >= recordLength && ME) finalClose(); - - return totalbytesread >= 0 ? totalbytesread : -1; - } - - - /** - * The DIME header is read into local class data fields and are not - * passed as part of the stream data. - * - * @param isChunk - * @throws IOException - */ - protected void readHeader( boolean isChunk ) throws IOException - { - bytesRead = 0; //How many bytes of the record have been read. - - if (isChunk) - { - if (!moreChunks) throw new RuntimeException("attach.DimeStreamError2"); - dataPadLength -= readPad(dataPadLength); //Just in case it was left over. - } - - byte[] header = new byte[12]; - - if (header.length != readFromStream( header) ) - { - streamInError = new IOException("attach.DimeStreamError3 " + header.length ); - throw streamInError; - } - - //VERSION - byte version = (byte) ((header[0] >>> 3) & 0x1f); - if (version > 1) - { - streamInError = new IOException("attach.DimeStreamError4 " + version ); - throw streamInError; - } - - //B, E, C - MB = 0 != (0x4 & header[0]); - ME = 0 != (0x2 & header[0]); - moreChunks = 0 != (0x1 & header[0]); - - //TYPE_T - if (!isChunk) - { - switch( ((header[1] >>> 4) & (byte)0x0f) ) { - case 0x00: tnf = "UNCHANGED"; break; - case 0x01: tnf = "MIME"; break; - case 0x02: tnf = "URI"; break; - default: tnf = "UNKNOWN"; break; - } - } - - //OPTIONS_LENGTH - int optionsLength = ((((int) header[2]) << 8) & 0xff00) | ((int) header[3]); - - //ID_LENGTH - int idLength = ((((int) header[4]) << 8) & 0xff00) | ((int) header[5]); - - //TYPE_LENGTH - int typeLength = ((((int) header[6]) << 8) & 0xff00) | ((int) header[7]); - - //DATA_LENGTH - recordLength = ((((long) header[8] ) << 24) & 0xff000000L) | - ((((long) header[9] ) << 16) & 0xff0000L ) | - ((((long) header[10]) << 8 ) & 0xff00L ) | - ((long) header[11] & 0xffL ); - - //OPTIONS + PADDING - if (0 != optionsLength) - { - byte[] optBytes = new byte[optionsLength]; - - if (optionsLength != readFromStream( optBytes )) - { - streamInError = new IOException("attach.DimeStreamError5 " + optionsLength ); - throw streamInError; - } - optBytes = null; // throw it away, don't know anything about options. - - int pad = (int) ((4L - (optionsLength & 0x3L)) & 0x03L); - - if (pad != readFromStream( header, 0, pad )) - { - streamInError = new IOException("attach.DimeStreamError7"); - throw streamInError; - } - } - - // ID + PADDING - if (0 < idLength) - { - byte[] idBytes = new byte[ idLength]; - - if (idLength != readFromStream( idBytes )) - { - streamInError = new IOException("attach.DimeStreamError8"); - throw streamInError; - } - if (idLength != 0 && !isChunk) id = new String(idBytes); - - int pad = (int) ((4L - (idLength & 0x3L)) & 0x03L); - - if (pad != readFromStream( header, 0, pad )) - { - streamInError = new IOException("attach.DimeStreamError9"); - throw streamInError; - } - } - - //TYPE + PADDING - if (0 < typeLength) - { - byte[] typeBytes = new byte[typeLength]; - - if (typeLength != readFromStream( typeBytes )) - { - streamInError = new IOException("attach.DimeStreamError10"); - throw streamInError; - } - if (typeLength != 0 && !isChunk) type = new String(typeBytes); - - int pad = (int) ((4L - (typeLength & 0x3L)) & 0x03L); - - if (pad != readFromStream( header, 0, pad )) - { - streamInError = new IOException("attach.DimeStreamError11"); - throw streamInError; - } - } - logger.debug("MB:" + MB + ", ME:" + ME + ", CF:" + moreChunks + - "Option length:" + optionsLength + - ", ID length:" + idLength + - ", typeLength:" + typeLength + ", TYPE_T:" + tnf); - logger.debug("id:\"" + id + "\""); - logger.debug("type:\"" + type + "\""); - logger.debug("recordlength:\"" + recordLength + "\""); - - dataPadLength = (int) ((4L - (recordLength & 0x3L)) & 0x03L); - } - - - /** - * Read from the delimited stream. - * - * @param b is the array to read into. Read as much as possible - * into the size of this array. - * @return the number of bytes read. -1 if endof stream - * @throws IOException if data could not be read from the stream - */ - public int read( byte[] b ) throws IOException - { - return read( b, 0, b.length ); - } - - - // fixme: this seems a bit inefficient - /** - * Read from the boundary delimited stream. - * - * @return the byte read, or -1 if endof stream - * @throws IOException if there was an error reading the data - */ - public int read() throws IOException - { - byte[] b = new byte[1]; - int read = read( b, 0, 1 ); - - if (read < 0) return -1; // fixme: should we also check for read != 1? - return (b[0] & 0xff); // convert byte value to a positive int - } - - - /** - * Closes the stream. - * This will take care of flushing any remaining data to the stream. - * Multiple calls to this method will result in the stream being closed once - * and then all subsequent calls being ignored. - * - * @throws IOException if the stream could not be closed - */ - public void close() throws IOException - { - synchronized( this ) - { - if (closed) return; - closed = true; //mark it closed. - } - logger.debug("bStreamClosed " + streamNo); - - if (bytesRead < recordLength || moreChunks) - { - //We need get this off the stream. Easy way to flush through the stream; - byte[] readrest = new byte[1024 * 16]; - int bread = 0; - - do - { bread = _read( readrest, 0, readrest.length ); //should also close the original stream. - } - while( bread > -1 ); - } - dataPadLength -= readPad( dataPadLength ); - } - - - /** - * Skip n bytes of data in the DIME stream, while reading and processing - * any headers in the current stream. - * - * @param n - number of data bytes to skip - * @return number of bytes actually skipped - * @throws IOException - */ - public long skip( long n ) throws IOException - { - long bytesSkipped = 0; - long bytes2Read = 0; - byte[] dumpbytes = new byte[1024]; - - while( n > 0 ) - { - bytes2Read = (n > 1024 ? 1024 : n); - bytes2Read = _read( dumpbytes, 0, (int)bytes2Read ); - - n -= bytes2Read; - bytesSkipped += bytes2Read; - } - - return bytesSkipped; - } - - - /** - * Mark the stream. This is not supported. - */ - public void mark( int readlimit ) - { //do nothing - } - - public void reset() throws IOException - { - streamInError = new IOException("attach.bounday.mns"); - throw streamInError; - } - - public boolean markSupported() - { - return false; - } - - - public synchronized int available() throws IOException - { - if (null != streamInError) throw streamInError; - - int chunkAvail = (int) Math.min((long)Integer.MAX_VALUE, recordLength - bytesRead); - int streamAvail = 0; - - try - { streamAvail = is.available(); - } - catch( IOException e ) - { - streamInError = e; - throw e; - } - - if (chunkAvail == 0 && moreChunks && (12 + dataPadLength) <= streamAvail) - { - dataPadLength -= readPad(dataPadLength); - readHeader( true ); - return available(); - } - return Math.min( streamAvail, chunkAvail ); - } - - - protected void finalClose() throws IOException - { - try - { theEnd = true; - if(null != is) is.close(); - } - finally - { - is= null; - } - } -} - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* Took the basic code from Axis 1.2 and modified to fit into the cloud code base */ + +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.io; + +import java.io.IOException; +import java.io.InputStream; +import java.io.FilterInputStream; +import org.apache.log4j.Logger; + + +/** + * This class takes the input stream and turns it multiple streams. + DIME version 0 format +
    + 0                   1                   2                   3
    + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ---
    + | VERSION |B|E|C| TYPE_T| OPT_T |         OPTIONS_LENGTH        |   A
    + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    + |          ID_LENGTH          |             TYPE_LENGTH         |   Always present 12 bytes
    + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   even on chunked data.
    + |                          DATA_LENGTH                          |   V
    + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ---
    + |                                                               /
    + /                       OPTIONS + PADDING                       /
    + /                     (absent for version 0)                    |
    + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    + |                                                               /
    + /                        ID + PADDING                           /
    + /                                                               |
    + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    + |                                                               /
    + /                        TYPE + PADDING                         /
    + /                                                               |
    + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    + |                                                               /
    + /                        DATA + PADDING                         /
    + /                                                               |
    + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +
    + * This implementation of input stream does not support marking operations. + * + * Incoming data is DIME encoded when its MIME type is "application/dime". + * Then use this class to pull out 2 streams: + * (1) The first stream is the SOAP request, + * (2) The second stream is a chunked attachment (e.g., a file to store) + * + * The DIME format is defined at this reference: + * http://msdn.microsoft.com/en-us/library/aa480488.aspx + * + * @author Rick Rineholt + */ +public class DimeDelimitedInputStream extends FilterInputStream +{ + protected final static Logger logger = Logger.getLogger(DimeDelimitedInputStream.class); + + InputStream is = null; //The source input stream. + boolean closed = true; //The stream has been closed. + boolean theEnd = false; //There are no more streams left. + boolean moreChunks = false; //More chunks are a coming! + boolean MB = false; //Message begin flag + boolean ME = false; //Message end flag + String type = null; // + String id = null; // + String tnf = null; //DIME type format + long recordLength = 0L; //length of the current record. + long bytesRead = 0L; //How many bytes of the current record have been read. + int dataPadLength = 0; //How many pad bytes there are. + + protected int streamNo = 0; + protected IOException streamInError = null; + + private static byte[] trash = new byte[4]; + protected static int streamCount = 0; //number of streams produced. + + protected static synchronized int newStreamNo() + { + logger.debug( "streamNo " + (streamCount + 1)); + return ++streamCount; + } + + + /** + * There can be multiple streams in a DIME encoding. For example, the first + * stream can be a SOAP message, and the second stream a binary attachment (e.g., + * a file). During reading after an EOF is returned, this function should be + * called to see if there is another stream following the last. + * + * @return the dime delimited stream, null if there are no more streams + * @throws IOException if there was an error loading the data for the next stream + */ + public synchronized DimeDelimitedInputStream getNextStream() throws IOException + { + if (null != streamInError) throw streamInError; + if (theEnd) return null; + + //Each Stream must be read in succession + if (bytesRead < recordLength || moreChunks) + throw new RuntimeException("attach.dimeReadFullyError"); + + dataPadLength -= readPad(dataPadLength); + + //Create an new dime stream that comes after this one. + return new DimeDelimitedInputStream( this.is ); + } + + + /** + * Create a new dime stream. + * + * @param is the InputStream to wrap + * @throws IOException if anything goes wrong + */ + public DimeDelimitedInputStream( InputStream is ) throws IOException + { + super(null); + streamNo = newStreamNo(); + closed = false; + this.is = is; + readHeader( false ); + } + + + /** + * Make sure to skip the pad which appear in several parts of a DIME message. + * @param size + * @return + * @throws IOException + */ + private final int readPad( int size ) throws IOException + { + if (0 == size) return 0; + int read = readFromStream(trash, 0, size); + + if (size != read) + { + streamInError = new IOException("attach.dimeNotPaddedCorrectly"); + throw streamInError; + } + return read; + } + + + private final int readFromStream( byte[] b ) throws IOException + { + return readFromStream( b, 0, b.length ); + } + + private final int readFromStream( byte[] b, int start, int length ) throws IOException + { + int br = 0; + int brTotal = 0; + + if (length == 0) return 0; + + do + { try + { + br = is.read( b, brTotal + start, length - brTotal ); + } + catch (IOException e) + { + streamInError = e; + throw e; + } + if (br > 0) brTotal += br; + } + while( br > -1 && brTotal < length ); + + return br > -1 ? brTotal : br; + } + + + /** + * Get the id for this stream part. + * @return the id; + */ + public String getContentId() + { + return id; + } + + public String getDimeTypeNameFormat() + { + return tnf; + } + + /** + * Get the type, as read from the header. + * @return the type of this dime + */ + public String getType() + { + return type; + } + + + /** + * Read from the DIME stream. + * + * @param b is the array to read into. + * @param off is the offset + * @return the number of bytes read. -1 if endof stream + * @throws IOException if data could not be read from the stream + */ + public synchronized int read( byte[] b, int off, int len ) throws IOException + { + if (closed) + { + dataPadLength -= readPad(dataPadLength); + throw new IOException( "streamClosed" ); + } + return _read( b, off, len ); + } + + + protected int _read( byte[] b, int off, int len ) throws IOException + { + int totalbytesread = 0; + int bytes2read = 0; + + if (len < 0) + throw new IllegalArgumentException( "attach.readLengthError" + len ); + + if (off < 0) + throw new IllegalArgumentException( "attach.readOffsetError" + off ); + + if (b == null) + throw new IllegalArgumentException( "attach.readArrayNullError" ); + + if (b.length < off + len) + throw new IllegalArgumentException("attach.readArraySizeError " + b.length + " " + len + " " + off ); + + if (null != streamInError) throw streamInError; + if (0 == len) return 0; //quick. + + // odd case no data to read -- give back 0 next time -1; + if (recordLength == 0 && bytesRead == 0 && !moreChunks) + { + ++bytesRead; + if (ME) finalClose(); + return 0; + } + if (bytesRead >= recordLength && !moreChunks) + { + dataPadLength -= readPad( dataPadLength ); + if (ME) finalClose(); + return -1; + } + + + do + { if (bytesRead >= recordLength && moreChunks) readHeader( true ); + bytes2read = (int) Math.min( recordLength - bytesRead, (long)len - totalbytesread ); + + try + { bytes2read = is.read( b, off + totalbytesread, bytes2read ); + } + catch (IOException e) + { + streamInError = e; + throw e; + } + + if (0 < bytes2read) + { + totalbytesread += bytes2read; + bytesRead += bytes2read; + } + } + while( bytes2read > -1 && totalbytesread < len && (bytesRead < recordLength || moreChunks)); + + if ( 0 > bytes2read ) + { + if (moreChunks) + { + streamInError = new IOException("attach.DimeStreamError0"); + throw streamInError; + } + if (bytesRead < recordLength) + { + streamInError = new IOException("attach.DimeStreamError1 " + (recordLength - bytesRead)); + throw streamInError; + } + if (!ME) + { + streamInError = new IOException("attach.DimeStreamError0"); + throw streamInError; + } + //in theory the last chunk of data should also have been padded, but lets be tolerant of that. + dataPadLength = 0; + } + else if (bytesRead >= recordLength) + { + //get rid of pading. + try + { dataPadLength -= readPad( dataPadLength ); + } + catch (IOException e) + { + //in theory the last chunk of data should also have been padded, but lets be tolerant of that. + if (!ME) throw e; + else + { + dataPadLength = 0; + streamInError = null; + } + } + } + + if (bytesRead >= recordLength && ME) finalClose(); + + return totalbytesread >= 0 ? totalbytesread : -1; + } + + + /** + * The DIME header is read into local class data fields and are not + * passed as part of the stream data. + * + * @param isChunk + * @throws IOException + */ + protected void readHeader( boolean isChunk ) throws IOException + { + bytesRead = 0; //How many bytes of the record have been read. + + if (isChunk) + { + if (!moreChunks) throw new RuntimeException("attach.DimeStreamError2"); + dataPadLength -= readPad(dataPadLength); //Just in case it was left over. + } + + byte[] header = new byte[12]; + + if (header.length != readFromStream( header) ) + { + streamInError = new IOException("attach.DimeStreamError3 " + header.length ); + throw streamInError; + } + + //VERSION + byte version = (byte) ((header[0] >>> 3) & 0x1f); + if (version > 1) + { + streamInError = new IOException("attach.DimeStreamError4 " + version ); + throw streamInError; + } + + //B, E, C + MB = 0 != (0x4 & header[0]); + ME = 0 != (0x2 & header[0]); + moreChunks = 0 != (0x1 & header[0]); + + //TYPE_T + if (!isChunk) + { + switch( ((header[1] >>> 4) & (byte)0x0f) ) { + case 0x00: tnf = "UNCHANGED"; break; + case 0x01: tnf = "MIME"; break; + case 0x02: tnf = "URI"; break; + default: tnf = "UNKNOWN"; break; + } + } + + //OPTIONS_LENGTH + int optionsLength = ((((int) header[2]) << 8) & 0xff00) | ((int) header[3]); + + //ID_LENGTH + int idLength = ((((int) header[4]) << 8) & 0xff00) | ((int) header[5]); + + //TYPE_LENGTH + int typeLength = ((((int) header[6]) << 8) & 0xff00) | ((int) header[7]); + + //DATA_LENGTH + recordLength = ((((long) header[8] ) << 24) & 0xff000000L) | + ((((long) header[9] ) << 16) & 0xff0000L ) | + ((((long) header[10]) << 8 ) & 0xff00L ) | + ((long) header[11] & 0xffL ); + + //OPTIONS + PADDING + if (0 != optionsLength) + { + byte[] optBytes = new byte[optionsLength]; + + if (optionsLength != readFromStream( optBytes )) + { + streamInError = new IOException("attach.DimeStreamError5 " + optionsLength ); + throw streamInError; + } + optBytes = null; // throw it away, don't know anything about options. + + int pad = (int) ((4L - (optionsLength & 0x3L)) & 0x03L); + + if (pad != readFromStream( header, 0, pad )) + { + streamInError = new IOException("attach.DimeStreamError7"); + throw streamInError; + } + } + + // ID + PADDING + if (0 < idLength) + { + byte[] idBytes = new byte[ idLength]; + + if (idLength != readFromStream( idBytes )) + { + streamInError = new IOException("attach.DimeStreamError8"); + throw streamInError; + } + if (idLength != 0 && !isChunk) id = new String(idBytes); + + int pad = (int) ((4L - (idLength & 0x3L)) & 0x03L); + + if (pad != readFromStream( header, 0, pad )) + { + streamInError = new IOException("attach.DimeStreamError9"); + throw streamInError; + } + } + + //TYPE + PADDING + if (0 < typeLength) + { + byte[] typeBytes = new byte[typeLength]; + + if (typeLength != readFromStream( typeBytes )) + { + streamInError = new IOException("attach.DimeStreamError10"); + throw streamInError; + } + if (typeLength != 0 && !isChunk) type = new String(typeBytes); + + int pad = (int) ((4L - (typeLength & 0x3L)) & 0x03L); + + if (pad != readFromStream( header, 0, pad )) + { + streamInError = new IOException("attach.DimeStreamError11"); + throw streamInError; + } + } + logger.debug("MB:" + MB + ", ME:" + ME + ", CF:" + moreChunks + + "Option length:" + optionsLength + + ", ID length:" + idLength + + ", typeLength:" + typeLength + ", TYPE_T:" + tnf); + logger.debug("id:\"" + id + "\""); + logger.debug("type:\"" + type + "\""); + logger.debug("recordlength:\"" + recordLength + "\""); + + dataPadLength = (int) ((4L - (recordLength & 0x3L)) & 0x03L); + } + + + /** + * Read from the delimited stream. + * + * @param b is the array to read into. Read as much as possible + * into the size of this array. + * @return the number of bytes read. -1 if endof stream + * @throws IOException if data could not be read from the stream + */ + public int read( byte[] b ) throws IOException + { + return read( b, 0, b.length ); + } + + + // fixme: this seems a bit inefficient + /** + * Read from the boundary delimited stream. + * + * @return the byte read, or -1 if endof stream + * @throws IOException if there was an error reading the data + */ + public int read() throws IOException + { + byte[] b = new byte[1]; + int read = read( b, 0, 1 ); + + if (read < 0) return -1; // fixme: should we also check for read != 1? + return (b[0] & 0xff); // convert byte value to a positive int + } + + + /** + * Closes the stream. + * This will take care of flushing any remaining data to the stream. + * Multiple calls to this method will result in the stream being closed once + * and then all subsequent calls being ignored. + * + * @throws IOException if the stream could not be closed + */ + public void close() throws IOException + { + synchronized( this ) + { + if (closed) return; + closed = true; //mark it closed. + } + logger.debug("bStreamClosed " + streamNo); + + if (bytesRead < recordLength || moreChunks) + { + //We need get this off the stream. Easy way to flush through the stream; + byte[] readrest = new byte[1024 * 16]; + int bread = 0; + + do + { bread = _read( readrest, 0, readrest.length ); //should also close the original stream. + } + while( bread > -1 ); + } + dataPadLength -= readPad( dataPadLength ); + } + + + /** + * Skip n bytes of data in the DIME stream, while reading and processing + * any headers in the current stream. + * + * @param n - number of data bytes to skip + * @return number of bytes actually skipped + * @throws IOException + */ + public long skip( long n ) throws IOException + { + long bytesSkipped = 0; + long bytes2Read = 0; + byte[] dumpbytes = new byte[1024]; + + while( n > 0 ) + { + bytes2Read = (n > 1024 ? 1024 : n); + bytes2Read = _read( dumpbytes, 0, (int)bytes2Read ); + + n -= bytes2Read; + bytesSkipped += bytes2Read; + } + + return bytesSkipped; + } + + + /** + * Mark the stream. This is not supported. + */ + public void mark( int readlimit ) + { //do nothing + } + + public void reset() throws IOException + { + streamInError = new IOException("attach.bounday.mns"); + throw streamInError; + } + + public boolean markSupported() + { + return false; + } + + + public synchronized int available() throws IOException + { + if (null != streamInError) throw streamInError; + + int chunkAvail = (int) Math.min((long)Integer.MAX_VALUE, recordLength - bytesRead); + int streamAvail = 0; + + try + { streamAvail = is.available(); + } + catch( IOException e ) + { + streamInError = e; + throw e; + } + + if (chunkAvail == 0 && moreChunks && (12 + dataPadLength) <= streamAvail) + { + dataPadLength -= readPad(dataPadLength); + readHeader( true ); + return available(); + } + return Math.min( streamAvail, chunkAvail ); + } + + + protected void finalClose() throws IOException + { + try + { theEnd = true; + if(null != is) is.close(); + } + finally + { + is= null; + } + } +} + diff --git a/awsapi/src/com/cloud/bridge/io/FileRangeDataSource.java b/awsapi/src/com/cloud/bridge/io/FileRangeDataSource.java index d87d5d39926..8e62a43a35d 100644 --- a/awsapi/src/com/cloud/bridge/io/FileRangeDataSource.java +++ b/awsapi/src/com/cloud/bridge/io/FileRangeDataSource.java @@ -1,61 +1,77 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.io; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import javax.activation.DataSource; - -import org.apache.log4j.Logger; - -/** - * @author Kelven Yang - */ -public class FileRangeDataSource implements DataSource { - protected final static Logger logger = Logger.getLogger(FileRangeDataSource.class); - - private FileRangeInputStream is; - - public FileRangeDataSource(File file, long startPos, long endPos) throws IOException { - is = new FileRangeInputStream(file, startPos, endPos); - } - - @Override - public String getContentType() { - assert(false); - return null; - } - - @Override - public InputStream getInputStream() throws IOException { - return is; - } - - @Override - public String getName() { - assert(false); - return null; - } - - @Override - public OutputStream getOutputStream() throws IOException { - assert(false); - return null; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.io; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import javax.activation.DataSource; + +import org.apache.log4j.Logger; + +/** + * @author Kelven Yang + */ +public class FileRangeDataSource implements DataSource { + protected final static Logger logger = Logger.getLogger(FileRangeDataSource.class); + + private FileRangeInputStream is; + + public FileRangeDataSource(File file, long startPos, long endPos) throws IOException { + is = new FileRangeInputStream(file, startPos, endPos); + } + + @Override + public String getContentType() { + assert(false); + return null; + } + + @Override + public InputStream getInputStream() throws IOException { + return is; + } + + @Override + public String getName() { + assert(false); + return null; + } + + @Override + public OutputStream getOutputStream() throws IOException { + assert(false); + return null; + } +} diff --git a/awsapi/src/com/cloud/bridge/io/FileRangeInputStream.java b/awsapi/src/com/cloud/bridge/io/FileRangeInputStream.java index 4fb87e2ee42..383fbd558a9 100644 --- a/awsapi/src/com/cloud/bridge/io/FileRangeInputStream.java +++ b/awsapi/src/com/cloud/bridge/io/FileRangeInputStream.java @@ -1,96 +1,112 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.io; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.RandomAccessFile; - -/** - * @author Kelven Yang - */ -public class FileRangeInputStream extends InputStream { - private RandomAccessFile randomAccessFile; - private long curPos; - private long endPos; - private long fileLength; - - public FileRangeInputStream(File file, long startPos, long endPos) throws IOException { - fileLength = file.length(); - - if(startPos > fileLength) - startPos = fileLength; - - if(endPos > fileLength) - endPos = fileLength; - - if(startPos > endPos) - throw new IllegalArgumentException("Invalid file range " + startPos + "-" + endPos); - - this.curPos = startPos; - this.endPos = endPos; - randomAccessFile = new RandomAccessFile(file, "r"); - randomAccessFile.seek(startPos); - } - - @Override - public int available() throws IOException { - return (int)(endPos - curPos); - } - - @Override - public int read() throws IOException { - if(available() > 0) { - int value = randomAccessFile.read(); - curPos++; - return value; - } - return -1; - } - - @Override - public int read(byte[] b) throws IOException { - return read(b, 0, b.length); - } - - @Override - public int read(byte[] b, int off, int len) throws IOException { - int bytesToRead = Math.min(len, available()); - if(bytesToRead == 0) - return -1; - - int bytesRead = randomAccessFile.read(b, off, bytesToRead); - if(bytesRead < 0) - return -1; - - curPos += bytesRead; - return bytesRead; - } - - @Override - public long skip(long n) throws IOException { - long skipped = Math.min(n, available()); - randomAccessFile.skipBytes((int)skipped); - curPos += skipped; - return skipped; - } - - @Override - public void close() throws IOException { - randomAccessFile.close(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.io; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; + +/** + * @author Kelven Yang + */ +public class FileRangeInputStream extends InputStream { + private RandomAccessFile randomAccessFile; + private long curPos; + private long endPos; + private long fileLength; + + public FileRangeInputStream(File file, long startPos, long endPos) throws IOException { + fileLength = file.length(); + + if(startPos > fileLength) + startPos = fileLength; + + if(endPos > fileLength) + endPos = fileLength; + + if(startPos > endPos) + throw new IllegalArgumentException("Invalid file range " + startPos + "-" + endPos); + + this.curPos = startPos; + this.endPos = endPos; + randomAccessFile = new RandomAccessFile(file, "r"); + randomAccessFile.seek(startPos); + } + + @Override + public int available() throws IOException { + return (int)(endPos - curPos); + } + + @Override + public int read() throws IOException { + if(available() > 0) { + int value = randomAccessFile.read(); + curPos++; + return value; + } + return -1; + } + + @Override + public int read(byte[] b) throws IOException { + return read(b, 0, b.length); + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + int bytesToRead = Math.min(len, available()); + if(bytesToRead == 0) + return -1; + + int bytesRead = randomAccessFile.read(b, off, bytesToRead); + if(bytesRead < 0) + return -1; + + curPos += bytesRead; + return bytesRead; + } + + @Override + public long skip(long n) throws IOException { + long skipped = Math.min(n, available()); + randomAccessFile.skipBytes((int)skipped); + curPos += skipped; + return skipped; + } + + @Override + public void close() throws IOException { + randomAccessFile.close(); + } +} diff --git a/awsapi/src/com/cloud/bridge/io/MTOMAwareResultStreamWriter.java b/awsapi/src/com/cloud/bridge/io/MTOMAwareResultStreamWriter.java index 6c6fc24bc34..80c58a89965 100644 --- a/awsapi/src/com/cloud/bridge/io/MTOMAwareResultStreamWriter.java +++ b/awsapi/src/com/cloud/bridge/io/MTOMAwareResultStreamWriter.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * */ diff --git a/awsapi/src/com/cloud/bridge/io/MultiPartDimeInputStream.java b/awsapi/src/com/cloud/bridge/io/MultiPartDimeInputStream.java index 219f6989db1..6373c036204 100644 --- a/awsapi/src/com/cloud/bridge/io/MultiPartDimeInputStream.java +++ b/awsapi/src/com/cloud/bridge/io/MultiPartDimeInputStream.java @@ -1,171 +1,187 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.io; - -import org.apache.log4j.Logger; - - -import java.io.InputStream; -import java.io.IOException; - -/** - * A DIME stream is actually composed of multiple encoded streams. - * This class is a wrapper around the DimeDelimitedInputStream inorder - * to provide a simple iterator like interface for all the streams in a - * DIME encoded message. - */ -public class MultiPartDimeInputStream -{ - protected final static Logger logger = Logger.getLogger(MultiPartDimeInputStream.class); - - protected InputStream is = null; - protected DimeDelimitedInputStream currentStream = null; - - protected int count = 0; - protected boolean eos = false; - protected String contentId = null; - protected String type = null; - protected String typeFormat = null; - - /** - * The SOAP stream must be first, call nextInputStream to get - * access to the first stream and all streams after that. - * - * @param is the true input stream holding the incoming request. - */ - public MultiPartDimeInputStream( InputStream is ) throws IOException - { - this.is = is; - } - - - /** - * These three methods are DIME specific but provide potentially - * useful information about the current stream's data. - * - * @return URL or MIME type - */ - public String getStreamType() - { - return type; - } - - public String getStreamTypeFormat() - { - // Is the type a URI or MIME type or just unknown? - return typeFormat; - } - - public String getStreamId() - { - // The soap body might have string identifiers to point to other streams in the message - return contentId; - } - - public InputStream getInputStream() - { - return currentStream; - } - - public int available() throws IOException - { - if (eos) return -1; - - if (null == currentStream) - { - throw new IOException( "streamClosed -- call nextInputStream()" ); - } - return currentStream.available(); - } - - - /** - * Move on to the next stream encoded in the DIME stream. - * If the current stream has not been all read, then we skip the remaining bytes of - * that stream. - * - * @return false if no next input stream, true if next input stream ready - * @throws IOException - */ - public boolean nextInputStream() throws IOException - { - if ( null == currentStream ) - { - // on the first call to this function get the first stream - if (0 == count) currentStream = new DimeDelimitedInputStream( is ); - } - else - { // make sure the bytes of the previous stream are all skipped before we start the next - currentStream.close(); - contentId = null; - type = null; - typeFormat = null; - currentStream = currentStream.getNextStream(); - } - - if ( null != currentStream ) - { - contentId = currentStream.getContentId(); - type = currentStream.getType(); - typeFormat = currentStream.getDimeTypeNameFormat(); - eos = false; - count++; - return true; - } - else return false; - } - - - public long skip( long n ) throws IOException - { - if (eos || null == currentStream) - { - throw new IOException( "streamClosed -- call nextInputStream()" ); - } - return currentStream.skip( n ); - } - - - public int read( byte[] b, int off, int len ) throws IOException - { - if (eos || null == currentStream) return -1; - - int read = currentStream.read( b, off, len ); - - if (read < 0) eos = true; - - return read; - } - - - public int read( byte[] b ) throws IOException - { - return read( b, 0, b.length ); - } - - - public int read() throws IOException - { - if (eos || null == currentStream) return -1; - - int ret = currentStream.read(); - - if (ret < 0) eos = true; - - return ret; - } -} - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.io; + +import org.apache.log4j.Logger; + + +import java.io.InputStream; +import java.io.IOException; + +/** + * A DIME stream is actually composed of multiple encoded streams. + * This class is a wrapper around the DimeDelimitedInputStream inorder + * to provide a simple iterator like interface for all the streams in a + * DIME encoded message. + */ +public class MultiPartDimeInputStream +{ + protected final static Logger logger = Logger.getLogger(MultiPartDimeInputStream.class); + + protected InputStream is = null; + protected DimeDelimitedInputStream currentStream = null; + + protected int count = 0; + protected boolean eos = false; + protected String contentId = null; + protected String type = null; + protected String typeFormat = null; + + /** + * The SOAP stream must be first, call nextInputStream to get + * access to the first stream and all streams after that. + * + * @param is the true input stream holding the incoming request. + */ + public MultiPartDimeInputStream( InputStream is ) throws IOException + { + this.is = is; + } + + + /** + * These three methods are DIME specific but provide potentially + * useful information about the current stream's data. + * + * @return URL or MIME type + */ + public String getStreamType() + { + return type; + } + + public String getStreamTypeFormat() + { + // Is the type a URI or MIME type or just unknown? + return typeFormat; + } + + public String getStreamId() + { + // The soap body might have string identifiers to point to other streams in the message + return contentId; + } + + public InputStream getInputStream() + { + return currentStream; + } + + public int available() throws IOException + { + if (eos) return -1; + + if (null == currentStream) + { + throw new IOException( "streamClosed -- call nextInputStream()" ); + } + return currentStream.available(); + } + + + /** + * Move on to the next stream encoded in the DIME stream. + * If the current stream has not been all read, then we skip the remaining bytes of + * that stream. + * + * @return false if no next input stream, true if next input stream ready + * @throws IOException + */ + public boolean nextInputStream() throws IOException + { + if ( null == currentStream ) + { + // on the first call to this function get the first stream + if (0 == count) currentStream = new DimeDelimitedInputStream( is ); + } + else + { // make sure the bytes of the previous stream are all skipped before we start the next + currentStream.close(); + contentId = null; + type = null; + typeFormat = null; + currentStream = currentStream.getNextStream(); + } + + if ( null != currentStream ) + { + contentId = currentStream.getContentId(); + type = currentStream.getType(); + typeFormat = currentStream.getDimeTypeNameFormat(); + eos = false; + count++; + return true; + } + else return false; + } + + + public long skip( long n ) throws IOException + { + if (eos || null == currentStream) + { + throw new IOException( "streamClosed -- call nextInputStream()" ); + } + return currentStream.skip( n ); + } + + + public int read( byte[] b, int off, int len ) throws IOException + { + if (eos || null == currentStream) return -1; + + int read = currentStream.read( b, off, len ); + + if (read < 0) eos = true; + + return read; + } + + + public int read( byte[] b ) throws IOException + { + return read( b, 0, b.length ); + } + + + public int read() throws IOException + { + if (eos || null == currentStream) return -1; + + int ret = currentStream.read(); + + if (ret < 0) eos = true; + + return ret; + } +} + diff --git a/awsapi/src/com/cloud/bridge/io/S3FileSystemBucketAdapter.java b/awsapi/src/com/cloud/bridge/io/S3FileSystemBucketAdapter.java index 7cc45042efc..fe08d1460fc 100644 --- a/awsapi/src/com/cloud/bridge/io/S3FileSystemBucketAdapter.java +++ b/awsapi/src/com/cloud/bridge/io/S3FileSystemBucketAdapter.java @@ -1,248 +1,264 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.io; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.MalformedURLException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; - -import javax.activation.DataHandler; -import javax.activation.DataSource; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.service.core.s3.S3BucketAdapter; -import com.cloud.bridge.service.core.s3.S3MultipartPart; -import com.cloud.bridge.service.exception.FileNotExistException; -import com.cloud.bridge.service.exception.InternalErrorException; -import com.cloud.bridge.service.exception.OutOfStorageException; -import com.cloud.bridge.util.StringHelper; -import com.cloud.bridge.util.OrderedPair; - -/** - * @author Kelven Yang, John Zucker - */ -public class S3FileSystemBucketAdapter implements S3BucketAdapter { - protected final static Logger logger = Logger.getLogger(S3FileSystemBucketAdapter.class); - - public S3FileSystemBucketAdapter() { - } - - @Override - public void createContainer(String mountedRoot, String bucket) { - - String dir = getBucketFolderDir(mountedRoot, bucket); - File container = new File(dir); - - if (!container.exists()) { - if (!container.mkdirs()) - throw new OutOfStorageException("Unable to create " + dir + " for bucket " + bucket); - } - } - - @Override - public void deleteContainer(String mountedRoot, String bucket) { - String dir = getBucketFolderDir(mountedRoot, bucket); - File path = new File(dir); - if(!deleteDirectory(path)) - throw new OutOfStorageException("Unable to delete " + dir + " for bucket " + bucket); - } - - @Override - public String getBucketFolderDir(String mountedRoot, String bucket) { - String bucketFolder = getBucketFolderName(bucket); - String dir; - String separator = ""+File.separatorChar; - if(!mountedRoot.endsWith(separator)) - dir = mountedRoot + separator + bucketFolder; - else - dir = mountedRoot + bucketFolder; - - return dir; - } - - @Override - public String saveObject(InputStream is, String mountedRoot, String bucket, String fileName) - { - FileOutputStream fos = null; - MessageDigest md5 = null; - - try { - md5 = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - throw new InternalErrorException("Unable to get MD5 MessageDigest", e); - } - - File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName); - try { - // -> when versioning is off we need to rewrite the file contents - file.delete(); - file.createNewFile(); - - fos = new FileOutputStream(file); - byte[] buffer = new byte[4096]; - int len = 0; - while( (len = is.read(buffer)) > 0) { - fos.write(buffer, 0, len); - md5.update(buffer, 0, len); - - } - //Convert MD4 digest to (lowercase) hex String - return StringHelper.toHexString(md5.digest()); - - } - catch(IOException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - throw new OutOfStorageException(e); - } - finally { - try { - if (null != fos) fos.close(); - } - catch( Exception e ) { - logger.error("Can't close FileOutputStream " + e.getMessage(), e); - } - } - } - - /** - * From a list of files (each being one part of the multipart upload), concatentate all files into a single - * object that can be accessed by normal S3 calls. This function could take a long time since a multipart is - * allowed to have upto 10,000 parts (each 5 gib long). Amazon defines that while this operation is in progress - * whitespace is sent back to the client inorder to keep the HTTP connection alive. - * - * @param mountedRoot - where both the source and dest buckets are located - * @param destBucket - resulting location of the concatenated objects - * @param fileName - resulting file name of the concatenated objects - * @param sourceBucket - special bucket used to save uploaded file parts - * @param parts - an array of file names in the sourceBucket - * @param client - if not null, then keep the servlet connection alive while this potentially long concatentation takes place - * @return OrderedPair with the first value the MD5 of the final object, and the second value the length of the final object - */ - @Override - public OrderedPair concatentateObjects(String mountedRoot, String destBucket, String fileName, String sourceBucket, S3MultipartPart[] parts, OutputStream client) - { - MessageDigest md5; - long totalLength = 0; - - try { - md5 = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - throw new InternalErrorException("Unable to get MD5 MessageDigest", e); - } - - File file = new File(getBucketFolderDir(mountedRoot, destBucket) + File.separatorChar + fileName); - try { - // -> when versioning is off we need to rewrite the file contents - file.delete(); - file.createNewFile(); - - final FileOutputStream fos = new FileOutputStream(file); - byte[] buffer = new byte[4096]; - - // -> get the input stream for the next file part - for( int i=0; i < parts.length; i++ ) - { - DataHandler nextPart = loadObject( mountedRoot, sourceBucket, parts[i].getPath()); - InputStream is = nextPart.getInputStream(); - - int len = 0; - while( (len = is.read(buffer)) > 0) { - fos.write(buffer, 0, len); - md5.update(buffer, 0, len); - totalLength += len; - } - is.close(); - - // -> after each file write tell the client we are still here to keep connection alive - if (null != client) { - client.write( new String(" ").getBytes()); - client.flush(); - } - } - fos.close(); - return new OrderedPair(StringHelper.toHexString(md5.digest()), new Long(totalLength)); - //Create an ordered pair whose first element is the MD4 digest as a (lowercase) hex String - } - catch(IOException e) { - logger.error("concatentateObjects unexpected exception " + e.getMessage(), e); - throw new OutOfStorageException(e); - } - } - - @Override - public DataHandler loadObject(String mountedRoot, String bucket, String fileName) { - File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName); - try { - return new DataHandler(file.toURL()); - } catch (MalformedURLException e) { - throw new FileNotExistException("Unable to open underlying object file"); - } - } - - @Override - public void deleteObject(String mountedRoot, String bucket, String fileName) { - String filePath = new String( getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName ); - File file = new File( filePath ); - if (!file.delete()) { - logger.error("file: " + filePath + ", f=" + file.isFile() + ", h=" + file.isHidden() + ", e=" + file.exists() + ", w=" + file.canWrite()); - throw new OutOfStorageException( "Unable to delete " + filePath + " for object deletion" ); - } - } - - @Override - public DataHandler loadObjectRange(String mountedRoot, String bucket, String fileName, long startPos, long endPos) { - File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName); - try { - DataSource ds = new FileRangeDataSource(file, startPos, endPos); - return new DataHandler(ds); - } catch (MalformedURLException e) { - throw new FileNotExistException("Unable to open underlying object file"); - } catch(IOException e) { - throw new FileNotExistException("Unable to open underlying object file"); - } - } - - public static boolean deleteDirectory(File path) { - if( path.exists() ) { - File[] files = path.listFiles(); - for(int i = 0; i < files.length; i++) { - if(files[i].isDirectory()) { - deleteDirectory(files[i]); - } else { - files[i].delete(); - } - } - } - return path.delete(); - } - - private String getBucketFolderName(String bucket) { - // temporary - String name = bucket.replace(' ', '_'); - name = bucket.replace('\\', '-'); - name = bucket.replace('/', '-'); - - return name; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.io; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.MalformedURLException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +import javax.activation.DataHandler; +import javax.activation.DataSource; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.service.core.s3.S3BucketAdapter; +import com.cloud.bridge.service.core.s3.S3MultipartPart; +import com.cloud.bridge.service.exception.FileNotExistException; +import com.cloud.bridge.service.exception.InternalErrorException; +import com.cloud.bridge.service.exception.OutOfStorageException; +import com.cloud.bridge.util.StringHelper; +import com.cloud.bridge.util.OrderedPair; + +/** + * @author Kelven Yang, John Zucker + */ +public class S3FileSystemBucketAdapter implements S3BucketAdapter { + protected final static Logger logger = Logger.getLogger(S3FileSystemBucketAdapter.class); + + public S3FileSystemBucketAdapter() { + } + + @Override + public void createContainer(String mountedRoot, String bucket) { + + String dir = getBucketFolderDir(mountedRoot, bucket); + File container = new File(dir); + + if (!container.exists()) { + if (!container.mkdirs()) + throw new OutOfStorageException("Unable to create " + dir + " for bucket " + bucket); + } + } + + @Override + public void deleteContainer(String mountedRoot, String bucket) { + String dir = getBucketFolderDir(mountedRoot, bucket); + File path = new File(dir); + if(!deleteDirectory(path)) + throw new OutOfStorageException("Unable to delete " + dir + " for bucket " + bucket); + } + + @Override + public String getBucketFolderDir(String mountedRoot, String bucket) { + String bucketFolder = getBucketFolderName(bucket); + String dir; + String separator = ""+File.separatorChar; + if(!mountedRoot.endsWith(separator)) + dir = mountedRoot + separator + bucketFolder; + else + dir = mountedRoot + bucketFolder; + + return dir; + } + + @Override + public String saveObject(InputStream is, String mountedRoot, String bucket, String fileName) + { + FileOutputStream fos = null; + MessageDigest md5 = null; + + try { + md5 = MessageDigest.getInstance("MD5"); + } catch (NoSuchAlgorithmException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + throw new InternalErrorException("Unable to get MD5 MessageDigest", e); + } + + File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName); + try { + // -> when versioning is off we need to rewrite the file contents + file.delete(); + file.createNewFile(); + + fos = new FileOutputStream(file); + byte[] buffer = new byte[4096]; + int len = 0; + while( (len = is.read(buffer)) > 0) { + fos.write(buffer, 0, len); + md5.update(buffer, 0, len); + + } + //Convert MD4 digest to (lowercase) hex String + return StringHelper.toHexString(md5.digest()); + + } + catch(IOException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + throw new OutOfStorageException(e); + } + finally { + try { + if (null != fos) fos.close(); + } + catch( Exception e ) { + logger.error("Can't close FileOutputStream " + e.getMessage(), e); + } + } + } + + /** + * From a list of files (each being one part of the multipart upload), concatentate all files into a single + * object that can be accessed by normal S3 calls. This function could take a long time since a multipart is + * allowed to have upto 10,000 parts (each 5 gib long). Amazon defines that while this operation is in progress + * whitespace is sent back to the client inorder to keep the HTTP connection alive. + * + * @param mountedRoot - where both the source and dest buckets are located + * @param destBucket - resulting location of the concatenated objects + * @param fileName - resulting file name of the concatenated objects + * @param sourceBucket - special bucket used to save uploaded file parts + * @param parts - an array of file names in the sourceBucket + * @param client - if not null, then keep the servlet connection alive while this potentially long concatentation takes place + * @return OrderedPair with the first value the MD5 of the final object, and the second value the length of the final object + */ + @Override + public OrderedPair concatentateObjects(String mountedRoot, String destBucket, String fileName, String sourceBucket, S3MultipartPart[] parts, OutputStream client) + { + MessageDigest md5; + long totalLength = 0; + + try { + md5 = MessageDigest.getInstance("MD5"); + } catch (NoSuchAlgorithmException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + throw new InternalErrorException("Unable to get MD5 MessageDigest", e); + } + + File file = new File(getBucketFolderDir(mountedRoot, destBucket) + File.separatorChar + fileName); + try { + // -> when versioning is off we need to rewrite the file contents + file.delete(); + file.createNewFile(); + + final FileOutputStream fos = new FileOutputStream(file); + byte[] buffer = new byte[4096]; + + // -> get the input stream for the next file part + for( int i=0; i < parts.length; i++ ) + { + DataHandler nextPart = loadObject( mountedRoot, sourceBucket, parts[i].getPath()); + InputStream is = nextPart.getInputStream(); + + int len = 0; + while( (len = is.read(buffer)) > 0) { + fos.write(buffer, 0, len); + md5.update(buffer, 0, len); + totalLength += len; + } + is.close(); + + // -> after each file write tell the client we are still here to keep connection alive + if (null != client) { + client.write( new String(" ").getBytes()); + client.flush(); + } + } + fos.close(); + return new OrderedPair(StringHelper.toHexString(md5.digest()), new Long(totalLength)); + //Create an ordered pair whose first element is the MD4 digest as a (lowercase) hex String + } + catch(IOException e) { + logger.error("concatentateObjects unexpected exception " + e.getMessage(), e); + throw new OutOfStorageException(e); + } + } + + @Override + public DataHandler loadObject(String mountedRoot, String bucket, String fileName) { + File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName); + try { + return new DataHandler(file.toURL()); + } catch (MalformedURLException e) { + throw new FileNotExistException("Unable to open underlying object file"); + } + } + + @Override + public void deleteObject(String mountedRoot, String bucket, String fileName) { + String filePath = new String( getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName ); + File file = new File( filePath ); + if (!file.delete()) { + logger.error("file: " + filePath + ", f=" + file.isFile() + ", h=" + file.isHidden() + ", e=" + file.exists() + ", w=" + file.canWrite()); + throw new OutOfStorageException( "Unable to delete " + filePath + " for object deletion" ); + } + } + + @Override + public DataHandler loadObjectRange(String mountedRoot, String bucket, String fileName, long startPos, long endPos) { + File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName); + try { + DataSource ds = new FileRangeDataSource(file, startPos, endPos); + return new DataHandler(ds); + } catch (MalformedURLException e) { + throw new FileNotExistException("Unable to open underlying object file"); + } catch(IOException e) { + throw new FileNotExistException("Unable to open underlying object file"); + } + } + + public static boolean deleteDirectory(File path) { + if( path.exists() ) { + File[] files = path.listFiles(); + for(int i = 0; i < files.length; i++) { + if(files[i].isDirectory()) { + deleteDirectory(files[i]); + } else { + files[i].delete(); + } + } + } + return path.delete(); + } + + private String getBucketFolderName(String bucket) { + // temporary + String name = bucket.replace(' ', '_'); + name = bucket.replace('\\', '-'); + name = bucket.replace('/', '-'); + + return name; + } +} diff --git a/awsapi/src/com/cloud/bridge/lifecycle/ServiceEngineLifecycle.java b/awsapi/src/com/cloud/bridge/lifecycle/ServiceEngineLifecycle.java index 099715c6663..9aef8d7926b 100644 --- a/awsapi/src/com/cloud/bridge/lifecycle/ServiceEngineLifecycle.java +++ b/awsapi/src/com/cloud/bridge/lifecycle/ServiceEngineLifecycle.java @@ -1,54 +1,70 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.lifecycle; - -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.description.AxisService; -import org.apache.axis2.engine.ServiceLifeCycle; -import org.apache.log4j.Logger; - -import com.cloud.bridge.persist.dao.UserCredentialsDao; -import com.cloud.bridge.service.controller.s3.ServiceProvider; - - -/** - * @author Kelven Yang - * ServiceEngineLifecycle is used to participate Axis service life cycle management - * so that we can inject proper initialization and cleanup procedure into the - * process - */ -public class ServiceEngineLifecycle implements ServiceLifeCycle { - private static final long serialVersionUID = -249114759030608486L; - public static final Logger logger = Logger.getLogger(ServiceEngineLifecycle.class); - private static boolean initialized = false; - - public void startUp(ConfigurationContext config, AxisService service) { - // initialize service provider during Axis engine startup - try{ - UserCredentialsDao.preCheckTableExistence(); - ServiceProvider.getInstance(); - ServiceEngineLifecycle.initialized = true; - }catch(Exception e){ - logger.error("Error initializing awsapi: "+ e.getMessage()); - } - } - - public void shutDown(ConfigurationContext config, AxisService service) { - if(ServiceEngineLifecycle.initialized){ - ServiceProvider.getInstance().shutdown(); - } - } -}; +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.lifecycle; + +import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.description.AxisService; +import org.apache.axis2.engine.ServiceLifeCycle; +import org.apache.log4j.Logger; + +import com.cloud.bridge.persist.dao.UserCredentialsDao; +import com.cloud.bridge.service.controller.s3.ServiceProvider; + + +/** + * @author Kelven Yang + * ServiceEngineLifecycle is used to participate Axis service life cycle management + * so that we can inject proper initialization and cleanup procedure into the + * process + */ +public class ServiceEngineLifecycle implements ServiceLifeCycle { + private static final long serialVersionUID = -249114759030608486L; + public static final Logger logger = Logger.getLogger(ServiceEngineLifecycle.class); + private static boolean initialized = false; + + public void startUp(ConfigurationContext config, AxisService service) { + // initialize service provider during Axis engine startup + try{ + UserCredentialsDao.preCheckTableExistence(); + ServiceProvider.getInstance(); + ServiceEngineLifecycle.initialized = true; + }catch(Exception e){ + logger.error("Error initializing awsapi: "+ e.getMessage()); + } + } + + public void shutDown(ConfigurationContext config, AxisService service) { + if(ServiceEngineLifecycle.initialized){ + ServiceProvider.getInstance().shutdown(); + } + } +}; diff --git a/awsapi/src/com/cloud/bridge/model/MHost.hbm.xml b/awsapi/src/com/cloud/bridge/model/MHost.hbm.xml index adffa090eeb..f3d857a55ae 100644 --- a/awsapi/src/com/cloud/bridge/model/MHost.hbm.xml +++ b/awsapi/src/com/cloud/bridge/model/MHost.hbm.xml @@ -1,37 +1,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/model/MHost.java b/awsapi/src/com/cloud/bridge/model/MHost.java index 3a267fdf37a..6c59bf04c29 100644 --- a/awsapi/src/com/cloud/bridge/model/MHost.java +++ b/awsapi/src/com/cloud/bridge/model/MHost.java @@ -1,113 +1,129 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.model; - -import java.io.Serializable; -import java.util.Date; -import java.util.HashSet; -import java.util.Set; - -/** - * @author Kelven Yang - */ -public class MHost implements Serializable { - private static final long serialVersionUID = 4848254624679753930L; - - private Long id; - - private String hostKey; - private String host; - private String version; - private Date lastHeartbeatTime; - - private Set localSHosts = new HashSet(); - private Set mounts = new HashSet(); - - public MHost() { - } - - public Long getId() { - return id; - } - - private void setId(Long id) { - this.id = id; - } - - public String getHostKey() { - return hostKey; - } - - public void setHostKey(String hostKey) { - this.hostKey = hostKey; - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public Date getLastHeartbeatTime() { - return lastHeartbeatTime; - } - - public void setLastHeartbeatTime(Date lastHeartbeatTime) { - this.lastHeartbeatTime = lastHeartbeatTime; - } - - public Set getLocalSHosts() { - return localSHosts; - } - - public void setLocalSHosts(Set localSHosts) { - this.localSHosts = localSHosts; - } - - public Set getMounts() { - return mounts; - } - - public void setMounts(Set mounts) { - this.mounts = mounts; - } - - @Override - public boolean equals(Object other) { - if(this == other) - return true; - - if(!(other instanceof MHost)) - return false; - - return hostKey == ((MHost)other).getHostKey(); - } - - @Override - public int hashCode() { - return hostKey.hashCode(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.model; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +/** + * @author Kelven Yang + */ +public class MHost implements Serializable { + private static final long serialVersionUID = 4848254624679753930L; + + private Long id; + + private String hostKey; + private String host; + private String version; + private Date lastHeartbeatTime; + + private Set localSHosts = new HashSet(); + private Set mounts = new HashSet(); + + public MHost() { + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getHostKey() { + return hostKey; + } + + public void setHostKey(String hostKey) { + this.hostKey = hostKey; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public Date getLastHeartbeatTime() { + return lastHeartbeatTime; + } + + public void setLastHeartbeatTime(Date lastHeartbeatTime) { + this.lastHeartbeatTime = lastHeartbeatTime; + } + + public Set getLocalSHosts() { + return localSHosts; + } + + public void setLocalSHosts(Set localSHosts) { + this.localSHosts = localSHosts; + } + + public Set getMounts() { + return mounts; + } + + public void setMounts(Set mounts) { + this.mounts = mounts; + } + + @Override + public boolean equals(Object other) { + if(this == other) + return true; + + if(!(other instanceof MHost)) + return false; + + return hostKey == ((MHost)other).getHostKey(); + } + + @Override + public int hashCode() { + return hostKey.hashCode(); + } +} diff --git a/awsapi/src/com/cloud/bridge/model/MHostMount.hbm.xml b/awsapi/src/com/cloud/bridge/model/MHostMount.hbm.xml index 40e3a2b1552..f2a6a769021 100644 --- a/awsapi/src/com/cloud/bridge/model/MHostMount.hbm.xml +++ b/awsapi/src/com/cloud/bridge/model/MHostMount.hbm.xml @@ -1,28 +1,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/model/MHostMount.java b/awsapi/src/com/cloud/bridge/model/MHostMount.java index 7665770e70a..f70b1dc6f02 100644 --- a/awsapi/src/com/cloud/bridge/model/MHostMount.java +++ b/awsapi/src/com/cloud/bridge/model/MHostMount.java @@ -1,94 +1,110 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.model; - -import java.io.Serializable; -import java.util.Date; - -/** - * @author Kelven Yang - */ -public class MHostMount implements Serializable { - private static final long serialVersionUID = -1119494563131099642L; - - private Long id; - - private MHost mhost; - private SHost shost; - - private String mountPath; - private Date lastMountTime; - - public MHostMount() { - } - - public Long getId() { - return id; - } - - private void setId(Long id) { - this.id = id; - } - - public MHost getMhost() { - return mhost; - } - - public void setMhost(MHost mhost) { - this.mhost = mhost; - } - - public SHost getShost() { - return shost; - } - - public void setShost(SHost shost) { - this.shost = shost; - } - - public String getMountPath() { - return mountPath; - } - - public void setMountPath(String mountPath) { - this.mountPath = mountPath; - } - - public Date getLastMountTime() { - return lastMountTime; - } - - public void setLastMountTime(Date lastMountTime) { - this.lastMountTime = lastMountTime; - } - - @Override - public boolean equals(Object other) { - if(this == other) - return true; - - if(!(other instanceof MHostMount)) - return false; - - return getMhost().equals(((MHostMount)other).getMhost()) && - getShost().equals(((MHostMount)other).getShost()); - } - - @Override - public int hashCode() { - return getMhost().hashCode() ^ getShost().hashCode(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.model; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author Kelven Yang + */ +public class MHostMount implements Serializable { + private static final long serialVersionUID = -1119494563131099642L; + + private Long id; + + private MHost mhost; + private SHost shost; + + private String mountPath; + private Date lastMountTime; + + public MHostMount() { + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public MHost getMhost() { + return mhost; + } + + public void setMhost(MHost mhost) { + this.mhost = mhost; + } + + public SHost getShost() { + return shost; + } + + public void setShost(SHost shost) { + this.shost = shost; + } + + public String getMountPath() { + return mountPath; + } + + public void setMountPath(String mountPath) { + this.mountPath = mountPath; + } + + public Date getLastMountTime() { + return lastMountTime; + } + + public void setLastMountTime(Date lastMountTime) { + this.lastMountTime = lastMountTime; + } + + @Override + public boolean equals(Object other) { + if(this == other) + return true; + + if(!(other instanceof MHostMount)) + return false; + + return getMhost().equals(((MHostMount)other).getMhost()) && + getShost().equals(((MHostMount)other).getShost()); + } + + @Override + public int hashCode() { + return getMhost().hashCode() ^ getShost().hashCode(); + } +} diff --git a/awsapi/src/com/cloud/bridge/model/SAcl.hbm.xml b/awsapi/src/com/cloud/bridge/model/SAcl.hbm.xml index 714b97ddb5f..de9e97657cc 100644 --- a/awsapi/src/com/cloud/bridge/model/SAcl.hbm.xml +++ b/awsapi/src/com/cloud/bridge/model/SAcl.hbm.xml @@ -1,36 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/model/SAcl.java b/awsapi/src/com/cloud/bridge/model/SAcl.java index 51b4e2f414f..5008e730231 100644 --- a/awsapi/src/com/cloud/bridge/model/SAcl.java +++ b/awsapi/src/com/cloud/bridge/model/SAcl.java @@ -1,239 +1,255 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.model; - -import java.io.Serializable; -import java.util.Date; - -import com.cloud.bridge.service.exception.UnsupportedException; -import com.cloud.bridge.util.OrderedPair; -import com.cloud.bridge.util.Triple; - -/** - * @author John Zucker, Kelven Yang - * A model of stored ACLs to remember the ACL permissions per canonicalUserID per grantee - * Hold the AWS S3 grantee and permission constants. - * - * This class implements two forms of getCannedAccessControls mappings, as static methods, - * - * (a) an OrderedPair which provides a maplet across - * < permission, grantee > - * when given an aclRequestString and a target (i.e. bucket or object), - * - * (b) a Triplet - * < permission1, permission2, symbol > - * when given an aclRequestString, a target (i.e. bucket or object) and the ID of the owner. - */ -public class SAcl implements Serializable { - private static final long serialVersionUID = 7900837117165018850L; - - public static final int GRANTEE_USER = 0; - public static final int GRANTEE_ALLUSERS = 1; - public static final int GRANTEE_AUTHENTICATED = 2; - - public static final int PERMISSION_PASS = -1; // No ACL test required - public static final int PERMISSION_NONE = 0; - public static final int PERMISSION_READ = 1; - public static final int PERMISSION_WRITE = 2; - public static final int PERMISSION_READ_ACL = 4; - public static final int PERMISSION_WRITE_ACL = 8; - public static final int PERMISSION_FULL = (PERMISSION_READ | PERMISSION_WRITE | PERMISSION_READ_ACL | PERMISSION_WRITE_ACL); - - private Long id; - - private String target; - private long targetId; - - private int granteeType; - private String granteeCanonicalId; - - private int permission; - private int grantOrder; - - private Date createTime; - private Date lastModifiedTime; - - public SAcl() { - } - - public Long getId() { - return id; - } - - private void setId(Long id) { - this.id = id; - } - - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - public long getTargetId() { - return targetId; - } - - public void setTargetId(long targetId) { - this.targetId = targetId; - } - - public int getGranteeType() { - return granteeType; - } - - public void setGranteeType(int granteeType) { - this.granteeType = granteeType; - } - - public String getGranteeCanonicalId() { - return granteeCanonicalId; - } - - public void setGranteeCanonicalId(String granteeCanonicalId) { - this.granteeCanonicalId = granteeCanonicalId; - } - - public int getPermission() { - return permission; - } - - public void setPermission(int permission) { - this.permission = permission; - } - - public int getGrantOrder() { - return grantOrder; - } - - public void setGrantOrder(int grantOrder) { - this.grantOrder = grantOrder; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getLastModifiedTime() { - return lastModifiedTime; - } - - public void setLastModifiedTime(Date lastModifiedTime) { - this.lastModifiedTime = lastModifiedTime; - } - - /** Return an OrderedPair - * < permission, grantee > - * comprising - * a permission - which is one of SAcl.PERMISSION_PASS, SAcl.PERMISSION_NONE, SAcl.PERMISSION_READ, - * SAcl.PERMISSION_WRITE, SAcl.PERMISSION_READ_ACL, SAcl.PERMISSION_WRITE_ACL, SAcl.PERMISSION_FULL - * a grantee - which is one of GRANTEE_ALLUSERS, GRANTEE_AUTHENTICATED, GRANTEE_USER - * - * Access controls that are specified via the "x-amz-acl:" headers in REST requests for buckets. - * The ACL request string is treated as a request for a known cannedAccessPolicy - * @param aclRequestString - The requested ACL from the set of AWS S3 canned ACLs - * @param target - Either "SBucket" or otherwise assumed to be for a single object item - */ - public static OrderedPair getCannedAccessControls ( String aclRequestString, String target ) - throws UnsupportedException - { - if ( aclRequestString.equalsIgnoreCase( "public-read" )) - // All users granted READ access. - return new OrderedPair (PERMISSION_READ,GRANTEE_ALLUSERS); - else if (aclRequestString.equalsIgnoreCase( "public-read-write" )) - // All users granted READ and WRITE access - return new OrderedPair ((PERMISSION_READ | PERMISSION_WRITE),GRANTEE_ALLUSERS); - else if (aclRequestString.equalsIgnoreCase( "authenticated-read" )) - // Authenticated users have READ access - return new OrderedPair (PERMISSION_READ,GRANTEE_AUTHENTICATED); - else if (aclRequestString.equalsIgnoreCase( "private" )) - // Only Owner gets FULL_CONTROL - return new OrderedPair (PERMISSION_FULL,GRANTEE_USER); - else if (aclRequestString.equalsIgnoreCase( "bucket-owner-read" )) - { - // Object Owner gets FULL_CONTROL, Bucket Owner gets READ - if ( target.equalsIgnoreCase( "SBucket" )) - return new OrderedPair (PERMISSION_READ, GRANTEE_USER); - else - return new OrderedPair (PERMISSION_FULL, GRANTEE_USER); - } - else if (aclRequestString.equalsIgnoreCase( "bucket-owner-full-control" )) - { - // Object Owner gets FULL_CONTROL, Bucket Owner gets FULL_CONTROL - // This is equivalent to private when used with PUT Bucket - return new OrderedPair (PERMISSION_FULL,GRANTEE_USER); - } - else throw new UnsupportedException( "Unknown Canned Access Policy: " + aclRequestString + " is not supported" ); - } - - /** Return a Triple - * < permission1, permission2, symbol > - * comprising - * two permissions - which is one of SAcl.PERMISSION_PASS, SAcl.PERMISSION_NONE, SAcl.PERMISSION_READ, - * SAcl.PERMISSION_WRITE, SAcl.PERMISSION_READ_ACL, SAcl.PERMISSION_WRITE_ACL, SAcl.PERMISSION_FULL - * permission1 applies to objects, permission2 applies to buckets. - * a symbol to indicate whether the principal is anonymous (i.e. string "A") or authenticated user (i.e. - * string "*") - otherwise null indicates a single ACL for all users. - * - * Access controls that are specified via the "x-amz-acl:" headers in REST requests for buckets. - * The ACL request string is treated as a request for a known cannedAccessPolicy - * @param aclRequestString - The requested ACL from the set of AWS S3 canned ACLs - * @param target - Either "SBucket" or otherwise assumed to be for a single object item - * @param ownerID - An ID for the owner, if used in place of symbols "A" or "*" - */ - public static Triple getCannedAccessControls ( String aclRequestString, String target, String ownerID ) - throws UnsupportedException - { - if ( aclRequestString.equalsIgnoreCase( "public-read" )) - // Owner gets FULL_CONTROL and the anonymous principal (the 'A' symbol here) is granted READ access. - return new Triple (PERMISSION_FULL, PERMISSION_READ,"A"); - else if (aclRequestString.equalsIgnoreCase( "public-read-write" )) - // Owner gets FULL_CONTROL and the anonymous principal (the 'A' symbol here) is granted READ and WRITE access - return new Triple (PERMISSION_FULL, (PERMISSION_READ | PERMISSION_WRITE),"A"); - else if (aclRequestString.equalsIgnoreCase( "authenticated-read" )) - // Owner gets FULL_CONTROL and ANY principal authenticated as a registered S3 user (the '*' symbol here) is granted READ access - return new Triple (PERMISSION_FULL, PERMISSION_READ,"*"); - else if (aclRequestString.equalsIgnoreCase( "private" )) - // This is termed the "private" or default ACL, "Owner gets FULL_CONTROL" - return new Triple (PERMISSION_FULL, PERMISSION_FULL,null); - else if (aclRequestString.equalsIgnoreCase( "bucket-owner-read" )) - { - // Object Owner gets FULL_CONTROL, Bucket Owner gets READ - // This is equivalent to private when used with PUT Bucket - if ( target.equalsIgnoreCase( "SBucket" )) - return new Triple (PERMISSION_FULL,PERMISSION_FULL ,null); - else - return new Triple (PERMISSION_FULL,PERMISSION_READ,ownerID); - } - else if (aclRequestString.equalsIgnoreCase( "bucket-owner-full-control" )) - { - // Object Owner gets FULL_CONTROL, Bucket Owner gets FULL_CONTROL - // This is equivalent to private when used with PUT Bucket - if ( target.equalsIgnoreCase( "SBucket" )) - return new Triple (PERMISSION_FULL, PERMISSION_FULL, null); - else - return new Triple (PERMISSION_FULL,PERMISSION_FULL, ownerID); - } - else throw new UnsupportedException( "Unknown Canned Access Policy: " + aclRequestString + " is not supported" ); - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.model; + +import java.io.Serializable; +import java.util.Date; + +import com.cloud.bridge.service.exception.UnsupportedException; +import com.cloud.bridge.util.OrderedPair; +import com.cloud.bridge.util.Triple; + +/** + * @author John Zucker, Kelven Yang + * A model of stored ACLs to remember the ACL permissions per canonicalUserID per grantee + * Hold the AWS S3 grantee and permission constants. + * + * This class implements two forms of getCannedAccessControls mappings, as static methods, + * + * (a) an OrderedPair which provides a maplet across + * < permission, grantee > + * when given an aclRequestString and a target (i.e. bucket or object), + * + * (b) a Triplet + * < permission1, permission2, symbol > + * when given an aclRequestString, a target (i.e. bucket or object) and the ID of the owner. + */ +public class SAcl implements Serializable { + private static final long serialVersionUID = 7900837117165018850L; + + public static final int GRANTEE_USER = 0; + public static final int GRANTEE_ALLUSERS = 1; + public static final int GRANTEE_AUTHENTICATED = 2; + + public static final int PERMISSION_PASS = -1; // No ACL test required + public static final int PERMISSION_NONE = 0; + public static final int PERMISSION_READ = 1; + public static final int PERMISSION_WRITE = 2; + public static final int PERMISSION_READ_ACL = 4; + public static final int PERMISSION_WRITE_ACL = 8; + public static final int PERMISSION_FULL = (PERMISSION_READ | PERMISSION_WRITE | PERMISSION_READ_ACL | PERMISSION_WRITE_ACL); + + private Long id; + + private String target; + private long targetId; + + private int granteeType; + private String granteeCanonicalId; + + private int permission; + private int grantOrder; + + private Date createTime; + private Date lastModifiedTime; + + public SAcl() { + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + public long getTargetId() { + return targetId; + } + + public void setTargetId(long targetId) { + this.targetId = targetId; + } + + public int getGranteeType() { + return granteeType; + } + + public void setGranteeType(int granteeType) { + this.granteeType = granteeType; + } + + public String getGranteeCanonicalId() { + return granteeCanonicalId; + } + + public void setGranteeCanonicalId(String granteeCanonicalId) { + this.granteeCanonicalId = granteeCanonicalId; + } + + public int getPermission() { + return permission; + } + + public void setPermission(int permission) { + this.permission = permission; + } + + public int getGrantOrder() { + return grantOrder; + } + + public void setGrantOrder(int grantOrder) { + this.grantOrder = grantOrder; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getLastModifiedTime() { + return lastModifiedTime; + } + + public void setLastModifiedTime(Date lastModifiedTime) { + this.lastModifiedTime = lastModifiedTime; + } + + /** Return an OrderedPair + * < permission, grantee > + * comprising + * a permission - which is one of SAcl.PERMISSION_PASS, SAcl.PERMISSION_NONE, SAcl.PERMISSION_READ, + * SAcl.PERMISSION_WRITE, SAcl.PERMISSION_READ_ACL, SAcl.PERMISSION_WRITE_ACL, SAcl.PERMISSION_FULL + * a grantee - which is one of GRANTEE_ALLUSERS, GRANTEE_AUTHENTICATED, GRANTEE_USER + * + * Access controls that are specified via the "x-amz-acl:" headers in REST requests for buckets. + * The ACL request string is treated as a request for a known cannedAccessPolicy + * @param aclRequestString - The requested ACL from the set of AWS S3 canned ACLs + * @param target - Either "SBucket" or otherwise assumed to be for a single object item + */ + public static OrderedPair getCannedAccessControls ( String aclRequestString, String target ) + throws UnsupportedException + { + if ( aclRequestString.equalsIgnoreCase( "public-read" )) + // All users granted READ access. + return new OrderedPair (PERMISSION_READ,GRANTEE_ALLUSERS); + else if (aclRequestString.equalsIgnoreCase( "public-read-write" )) + // All users granted READ and WRITE access + return new OrderedPair ((PERMISSION_READ | PERMISSION_WRITE),GRANTEE_ALLUSERS); + else if (aclRequestString.equalsIgnoreCase( "authenticated-read" )) + // Authenticated users have READ access + return new OrderedPair (PERMISSION_READ,GRANTEE_AUTHENTICATED); + else if (aclRequestString.equalsIgnoreCase( "private" )) + // Only Owner gets FULL_CONTROL + return new OrderedPair (PERMISSION_FULL,GRANTEE_USER); + else if (aclRequestString.equalsIgnoreCase( "bucket-owner-read" )) + { + // Object Owner gets FULL_CONTROL, Bucket Owner gets READ + if ( target.equalsIgnoreCase( "SBucket" )) + return new OrderedPair (PERMISSION_READ, GRANTEE_USER); + else + return new OrderedPair (PERMISSION_FULL, GRANTEE_USER); + } + else if (aclRequestString.equalsIgnoreCase( "bucket-owner-full-control" )) + { + // Object Owner gets FULL_CONTROL, Bucket Owner gets FULL_CONTROL + // This is equivalent to private when used with PUT Bucket + return new OrderedPair (PERMISSION_FULL,GRANTEE_USER); + } + else throw new UnsupportedException( "Unknown Canned Access Policy: " + aclRequestString + " is not supported" ); + } + + /** Return a Triple + * < permission1, permission2, symbol > + * comprising + * two permissions - which is one of SAcl.PERMISSION_PASS, SAcl.PERMISSION_NONE, SAcl.PERMISSION_READ, + * SAcl.PERMISSION_WRITE, SAcl.PERMISSION_READ_ACL, SAcl.PERMISSION_WRITE_ACL, SAcl.PERMISSION_FULL + * permission1 applies to objects, permission2 applies to buckets. + * a symbol to indicate whether the principal is anonymous (i.e. string "A") or authenticated user (i.e. + * string "*") - otherwise null indicates a single ACL for all users. + * + * Access controls that are specified via the "x-amz-acl:" headers in REST requests for buckets. + * The ACL request string is treated as a request for a known cannedAccessPolicy + * @param aclRequestString - The requested ACL from the set of AWS S3 canned ACLs + * @param target - Either "SBucket" or otherwise assumed to be for a single object item + * @param ownerID - An ID for the owner, if used in place of symbols "A" or "*" + */ + public static Triple getCannedAccessControls ( String aclRequestString, String target, String ownerID ) + throws UnsupportedException + { + if ( aclRequestString.equalsIgnoreCase( "public-read" )) + // Owner gets FULL_CONTROL and the anonymous principal (the 'A' symbol here) is granted READ access. + return new Triple (PERMISSION_FULL, PERMISSION_READ,"A"); + else if (aclRequestString.equalsIgnoreCase( "public-read-write" )) + // Owner gets FULL_CONTROL and the anonymous principal (the 'A' symbol here) is granted READ and WRITE access + return new Triple (PERMISSION_FULL, (PERMISSION_READ | PERMISSION_WRITE),"A"); + else if (aclRequestString.equalsIgnoreCase( "authenticated-read" )) + // Owner gets FULL_CONTROL and ANY principal authenticated as a registered S3 user (the '*' symbol here) is granted READ access + return new Triple (PERMISSION_FULL, PERMISSION_READ,"*"); + else if (aclRequestString.equalsIgnoreCase( "private" )) + // This is termed the "private" or default ACL, "Owner gets FULL_CONTROL" + return new Triple (PERMISSION_FULL, PERMISSION_FULL,null); + else if (aclRequestString.equalsIgnoreCase( "bucket-owner-read" )) + { + // Object Owner gets FULL_CONTROL, Bucket Owner gets READ + // This is equivalent to private when used with PUT Bucket + if ( target.equalsIgnoreCase( "SBucket" )) + return new Triple (PERMISSION_FULL,PERMISSION_FULL ,null); + else + return new Triple (PERMISSION_FULL,PERMISSION_READ,ownerID); + } + else if (aclRequestString.equalsIgnoreCase( "bucket-owner-full-control" )) + { + // Object Owner gets FULL_CONTROL, Bucket Owner gets FULL_CONTROL + // This is equivalent to private when used with PUT Bucket + if ( target.equalsIgnoreCase( "SBucket" )) + return new Triple (PERMISSION_FULL, PERMISSION_FULL, null); + else + return new Triple (PERMISSION_FULL,PERMISSION_FULL, ownerID); + } + else throw new UnsupportedException( "Unknown Canned Access Policy: " + aclRequestString + " is not supported" ); + } + +} diff --git a/awsapi/src/com/cloud/bridge/model/SBucket.hbm.xml b/awsapi/src/com/cloud/bridge/model/SBucket.hbm.xml index f1db07845e0..128717935bb 100644 --- a/awsapi/src/com/cloud/bridge/model/SBucket.hbm.xml +++ b/awsapi/src/com/cloud/bridge/model/SBucket.hbm.xml @@ -1,38 +1,38 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/model/SBucket.java b/awsapi/src/com/cloud/bridge/model/SBucket.java index 4e045f79d0a..894f750a985 100644 --- a/awsapi/src/com/cloud/bridge/model/SBucket.java +++ b/awsapi/src/com/cloud/bridge/model/SBucket.java @@ -1,128 +1,144 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.model; - -import java.io.Serializable; -import java.util.Date; -import java.util.HashSet; -import java.util.Set; - -/** - * @author Kelven Yang, John Zucker - * Holds the relation - * Id, - * Name, - * OwnerCanonicalId, - * SHost, - * CreateTime, - * VersioningStatus - * For ORM see "com/cloud/bridge/model/SHost.hbm.xml" - */ -public class SBucket implements Serializable { - private static final long serialVersionUID = 7430267766019671273L; - - public static final int VERSIONING_NULL = 0; - public static final int VERSIONING_ENABLED = 1; - public static final int VERSIONING_SUSPENDED = 2; - - private Long id; - - private String name; - private String ownerCanonicalId; - - private SHost shost; - private Date createTime; - - private int versioningStatus; - - private Set objectsInBucket = new HashSet(); - - public SBucket() { - versioningStatus = VERSIONING_NULL; - } - - public Long getId() { - return id; - } - - private void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getOwnerCanonicalId() { - return ownerCanonicalId; - } - - public void setOwnerCanonicalId(String ownerCanonicalId) { - this.ownerCanonicalId = ownerCanonicalId; - } - - public SHost getShost() { - return shost; - } - - public void setShost(SHost shost) { - this.shost = shost; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public int getVersioningStatus() { - return versioningStatus; - } - - public void setVersioningStatus( int versioningStatus ) { - this.versioningStatus = versioningStatus; - } - - public Set getObjectsInBucket() { - return objectsInBucket; - } - - public void setObjectsInBucket(Set objectsInBucket) { - this.objectsInBucket = objectsInBucket; - } - - @Override - public boolean equals(Object other) { - if(this == other) - return true; - - if(!(other instanceof SBucket)) - return false; - - return getName().equals(((SBucket)other).getName()); - } - - @Override - public int hashCode() { - return getName().hashCode(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.model; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +/** + * @author Kelven Yang, John Zucker + * Holds the relation + * Id, + * Name, + * OwnerCanonicalId, + * SHost, + * CreateTime, + * VersioningStatus + * For ORM see "com/cloud/bridge/model/SHost.hbm.xml" + */ +public class SBucket implements Serializable { + private static final long serialVersionUID = 7430267766019671273L; + + public static final int VERSIONING_NULL = 0; + public static final int VERSIONING_ENABLED = 1; + public static final int VERSIONING_SUSPENDED = 2; + + private Long id; + + private String name; + private String ownerCanonicalId; + + private SHost shost; + private Date createTime; + + private int versioningStatus; + + private Set objectsInBucket = new HashSet(); + + public SBucket() { + versioningStatus = VERSIONING_NULL; + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getOwnerCanonicalId() { + return ownerCanonicalId; + } + + public void setOwnerCanonicalId(String ownerCanonicalId) { + this.ownerCanonicalId = ownerCanonicalId; + } + + public SHost getShost() { + return shost; + } + + public void setShost(SHost shost) { + this.shost = shost; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public int getVersioningStatus() { + return versioningStatus; + } + + public void setVersioningStatus( int versioningStatus ) { + this.versioningStatus = versioningStatus; + } + + public Set getObjectsInBucket() { + return objectsInBucket; + } + + public void setObjectsInBucket(Set objectsInBucket) { + this.objectsInBucket = objectsInBucket; + } + + @Override + public boolean equals(Object other) { + if(this == other) + return true; + + if(!(other instanceof SBucket)) + return false; + + return getName().equals(((SBucket)other).getName()); + } + + @Override + public int hashCode() { + return getName().hashCode(); + } +} diff --git a/awsapi/src/com/cloud/bridge/model/SHost.hbm.xml b/awsapi/src/com/cloud/bridge/model/SHost.hbm.xml index ba90be5c381..dff852c19af 100644 --- a/awsapi/src/com/cloud/bridge/model/SHost.hbm.xml +++ b/awsapi/src/com/cloud/bridge/model/SHost.hbm.xml @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/model/SHost.java b/awsapi/src/com/cloud/bridge/model/SHost.java index 2d269684f9f..5c8734a2aaf 100644 --- a/awsapi/src/com/cloud/bridge/model/SHost.java +++ b/awsapi/src/com/cloud/bridge/model/SHost.java @@ -1,117 +1,133 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.model; - -import java.io.Serializable; -import java.util.HashSet; -import java.util.Set; - -/** - * @author Kelven Yang, John Zucker - */ -public class SHost implements Serializable { - private static final long serialVersionUID = 213346565810468018L; - - public static final int STORAGE_HOST_TYPE_LOCAL = 0; - public static final int STORAGE_HOST_TYPE_NFS = 1; - - private Long id; - - private String host; - private int hostType; - private MHost mhost; - private String exportRoot; - private String userOnHost; - private String userPassword; - - private Set buckets = new HashSet(); - private Set mounts = new HashSet(); - - public SHost() { - } - - public Long getId() { - return id; - } - - private void setId(Long id) { - this.id = id; - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public int getHostType() { - return hostType; - } - - public void setHostType(int hostType) { - this.hostType = hostType; - } - - public String getExportRoot() { - return exportRoot; - } - - public void setExportRoot(String exportRoot) { - this.exportRoot = exportRoot; - } - - public String getUserOnHost() { - return userOnHost; - } - - public void setUserOnHost(String userOnHost) { - this.userOnHost = userOnHost; - } - - public String getUserPassword() { - return userPassword; - } - - public void setUserPassword(String userPassword) { - this.userPassword = userPassword; - } - - public MHost getMhost() { - return mhost; - } - - public void setMhost(MHost mhost) { - this.mhost = mhost; - } - - public Set getBuckets() { - return buckets; - } - - public void setBuckets(Set buckets) { - this.buckets = buckets; - } - - public Set getMounts() { - return mounts; - } - - public void setMounts(Set mounts) { - this.mounts = mounts; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.model; + +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; + +/** + * @author Kelven Yang, John Zucker + */ +public class SHost implements Serializable { + private static final long serialVersionUID = 213346565810468018L; + + public static final int STORAGE_HOST_TYPE_LOCAL = 0; + public static final int STORAGE_HOST_TYPE_NFS = 1; + + private Long id; + + private String host; + private int hostType; + private MHost mhost; + private String exportRoot; + private String userOnHost; + private String userPassword; + + private Set buckets = new HashSet(); + private Set mounts = new HashSet(); + + public SHost() { + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public int getHostType() { + return hostType; + } + + public void setHostType(int hostType) { + this.hostType = hostType; + } + + public String getExportRoot() { + return exportRoot; + } + + public void setExportRoot(String exportRoot) { + this.exportRoot = exportRoot; + } + + public String getUserOnHost() { + return userOnHost; + } + + public void setUserOnHost(String userOnHost) { + this.userOnHost = userOnHost; + } + + public String getUserPassword() { + return userPassword; + } + + public void setUserPassword(String userPassword) { + this.userPassword = userPassword; + } + + public MHost getMhost() { + return mhost; + } + + public void setMhost(MHost mhost) { + this.mhost = mhost; + } + + public Set getBuckets() { + return buckets; + } + + public void setBuckets(Set buckets) { + this.buckets = buckets; + } + + public Set getMounts() { + return mounts; + } + + public void setMounts(Set mounts) { + this.mounts = mounts; + } +} diff --git a/awsapi/src/com/cloud/bridge/model/SMeta.hbm.xml b/awsapi/src/com/cloud/bridge/model/SMeta.hbm.xml index 5f04fa5321a..e120884c30c 100644 --- a/awsapi/src/com/cloud/bridge/model/SMeta.hbm.xml +++ b/awsapi/src/com/cloud/bridge/model/SMeta.hbm.xml @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/model/SMeta.java b/awsapi/src/com/cloud/bridge/model/SMeta.java index ab11224e0c1..248e1f9adc6 100644 --- a/awsapi/src/com/cloud/bridge/model/SMeta.java +++ b/awsapi/src/com/cloud/bridge/model/SMeta.java @@ -1,96 +1,112 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.model; - -import java.io.Serializable; - -/** - * @author Kelven Yang - */ -public class SMeta implements Serializable { - private static final long serialVersionUID = 7459503272337054283L; - - private Long id; - private String target; - private long targetId; - - private String name; - private String value; - - public SMeta() { - } - - public Long getId() { - return id; - } - - private void setId(Long id) { - this.id = id; - } - - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - public long getTargetId() { - return targetId; - } - - public void setTargetId(long targetId) { - this.targetId = targetId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public boolean equals(Object other) { - if(this == other) - return true; - - if(!(other instanceof SMeta)) - return false; - - return getTarget().equals(((SMeta)other).getTarget()) && getTargetId() == ((SMeta)other).getTargetId() - && getName().equals(((SMeta)other).getName()); - } - - @Override - public int hashCode() { - int hashCode = 0; - hashCode = hashCode*17 + getTarget().hashCode(); - hashCode = hashCode*17 + (int)getTargetId(); - hashCode = hashCode*17 + getName().hashCode(); - return hashCode; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.model; + +import java.io.Serializable; + +/** + * @author Kelven Yang + */ +public class SMeta implements Serializable { + private static final long serialVersionUID = 7459503272337054283L; + + private Long id; + private String target; + private long targetId; + + private String name; + private String value; + + public SMeta() { + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + public long getTargetId() { + return targetId; + } + + public void setTargetId(long targetId) { + this.targetId = targetId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(Object other) { + if(this == other) + return true; + + if(!(other instanceof SMeta)) + return false; + + return getTarget().equals(((SMeta)other).getTarget()) && getTargetId() == ((SMeta)other).getTargetId() + && getName().equals(((SMeta)other).getName()); + } + + @Override + public int hashCode() { + int hashCode = 0; + hashCode = hashCode*17 + getTarget().hashCode(); + hashCode = hashCode*17 + (int)getTargetId(); + hashCode = hashCode*17 + getName().hashCode(); + return hashCode; + } +} diff --git a/awsapi/src/com/cloud/bridge/model/SObject.hbm.xml b/awsapi/src/com/cloud/bridge/model/SObject.hbm.xml index 8dcc3eb697c..194af330789 100644 --- a/awsapi/src/com/cloud/bridge/model/SObject.hbm.xml +++ b/awsapi/src/com/cloud/bridge/model/SObject.hbm.xml @@ -1,41 +1,41 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/model/SObject.java b/awsapi/src/com/cloud/bridge/model/SObject.java index e86bae48477..94743c660ce 100644 --- a/awsapi/src/com/cloud/bridge/model/SObject.java +++ b/awsapi/src/com/cloud/bridge/model/SObject.java @@ -1,208 +1,224 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.model; - -import java.io.Serializable; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -/** - * @author Kelven Yang, John Zucker - */ -public class SObject implements Serializable { - private static final long serialVersionUID = 8566744941395660486L; - - private Long id; - - private String nameKey; - private String ownerCanonicalId; - - private int nextSequence; - private String deletionMark; // This must also a unique ID to give to the REST client - - private Date createTime; - - private SBucket bucket; - - private Set items = new HashSet(); - - public SObject() { - deletionMark = null; - } - - public Long getId() { - return id; - } - - private void setId(Long id) { - this.id = id; - } - - public String getNameKey() { - return nameKey; - } - - public void setNameKey(String nameKey) { - this.nameKey = nameKey; - } - - public String getOwnerCanonicalId() { - return ownerCanonicalId; - } - - public void setOwnerCanonicalId(String ownerCanonicalId) { - this.ownerCanonicalId = ownerCanonicalId; - } - - public int getNextSequence() { - return nextSequence; - } - - public void setNextSequence(int nextSequence) { - this.nextSequence = nextSequence; - } - - public String getDeletionMark() { - return deletionMark; - } - - public void setDeletionMark(String deletionMark) { - this.deletionMark = deletionMark; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public SBucket getBucket() { - return bucket; - } - - public void setBucket(SBucket bucket) { - this.bucket = bucket; - } - - public Set getItems() { - return items; - } - - public void setItems(Set items) { - this.items = items; - } - - public void deleteItem( long id ) { - Iterator it = getItems().iterator(); - - while( it.hasNext()) - { - SObjectItem oneItem = it.next(); - if (id == oneItem.getId()) { - boolean bRemoved = items.remove( oneItem ); - System.out.println( "deleteItem from sobject: " + bRemoved ); - return; - } - } - } - - public SObjectItem getLatestVersion( boolean versioningOff ) { - Iterator it = getItems().iterator(); - int maxVersion = 0; - int curVersion = 0; - SObjectItem latestItem = null; - - while( it.hasNext()) - { - SObjectItem item = it.next(); - - // If versioning is off then return the item with the null version string (if exists) - // For example, the bucket could have allowed versioning and then it was suspended - // If an application wants a specific version it will need to explicitly ask for it - try { - String version = item.getVersion(); - if (versioningOff && null == version) { - return item; - } - curVersion = Integer.parseInt( version ); - - } catch (NumberFormatException e) { - curVersion = 0; - } - - if(curVersion >= maxVersion) { - maxVersion = curVersion; - latestItem = item; - } - } - return latestItem; - } - - /** - * S3 versioning allows the client to request the return of a specific version, - * not just the last version. - * - * @param wantVersion - * @return - */ - public SObjectItem getVersion( String wantVersion ) - { - Iterator it = getItems().iterator(); - while( it.hasNext()) - { - SObjectItem item = it.next(); - String curVersion = item.getVersion(); - if (null != curVersion && wantVersion.equalsIgnoreCase( curVersion )) return item; - } - return null; - } - - @Override - public boolean equals(Object other) { - if(this == other) - return true; - - if(!(other instanceof SObject)) - return false; - - if(!getNameKey().equals(((SObject)other).getNameKey())) - return false; - - if(getBucket() != null) { - if(!getBucket().equals(((SObject)other).getBucket())) - return false; - } else { - if(((SObject)other).getBucket() != null) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 0; - hashCode = hashCode*17 + getNameKey().hashCode(); - - if(getBucket() != null) - hashCode = hashCode*17 + getBucket().hashCode(); - return hashCode; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.model; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +/** + * @author Kelven Yang, John Zucker + */ +public class SObject implements Serializable { + private static final long serialVersionUID = 8566744941395660486L; + + private Long id; + + private String nameKey; + private String ownerCanonicalId; + + private int nextSequence; + private String deletionMark; // This must also a unique ID to give to the REST client + + private Date createTime; + + private SBucket bucket; + + private Set items = new HashSet(); + + public SObject() { + deletionMark = null; + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getNameKey() { + return nameKey; + } + + public void setNameKey(String nameKey) { + this.nameKey = nameKey; + } + + public String getOwnerCanonicalId() { + return ownerCanonicalId; + } + + public void setOwnerCanonicalId(String ownerCanonicalId) { + this.ownerCanonicalId = ownerCanonicalId; + } + + public int getNextSequence() { + return nextSequence; + } + + public void setNextSequence(int nextSequence) { + this.nextSequence = nextSequence; + } + + public String getDeletionMark() { + return deletionMark; + } + + public void setDeletionMark(String deletionMark) { + this.deletionMark = deletionMark; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public SBucket getBucket() { + return bucket; + } + + public void setBucket(SBucket bucket) { + this.bucket = bucket; + } + + public Set getItems() { + return items; + } + + public void setItems(Set items) { + this.items = items; + } + + public void deleteItem( long id ) { + Iterator it = getItems().iterator(); + + while( it.hasNext()) + { + SObjectItem oneItem = it.next(); + if (id == oneItem.getId()) { + boolean bRemoved = items.remove( oneItem ); + System.out.println( "deleteItem from sobject: " + bRemoved ); + return; + } + } + } + + public SObjectItem getLatestVersion( boolean versioningOff ) { + Iterator it = getItems().iterator(); + int maxVersion = 0; + int curVersion = 0; + SObjectItem latestItem = null; + + while( it.hasNext()) + { + SObjectItem item = it.next(); + + // If versioning is off then return the item with the null version string (if exists) + // For example, the bucket could have allowed versioning and then it was suspended + // If an application wants a specific version it will need to explicitly ask for it + try { + String version = item.getVersion(); + if (versioningOff && null == version) { + return item; + } + curVersion = Integer.parseInt( version ); + + } catch (NumberFormatException e) { + curVersion = 0; + } + + if(curVersion >= maxVersion) { + maxVersion = curVersion; + latestItem = item; + } + } + return latestItem; + } + + /** + * S3 versioning allows the client to request the return of a specific version, + * not just the last version. + * + * @param wantVersion + * @return + */ + public SObjectItem getVersion( String wantVersion ) + { + Iterator it = getItems().iterator(); + while( it.hasNext()) + { + SObjectItem item = it.next(); + String curVersion = item.getVersion(); + if (null != curVersion && wantVersion.equalsIgnoreCase( curVersion )) return item; + } + return null; + } + + @Override + public boolean equals(Object other) { + if(this == other) + return true; + + if(!(other instanceof SObject)) + return false; + + if(!getNameKey().equals(((SObject)other).getNameKey())) + return false; + + if(getBucket() != null) { + if(!getBucket().equals(((SObject)other).getBucket())) + return false; + } else { + if(((SObject)other).getBucket() != null) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 0; + hashCode = hashCode*17 + getNameKey().hashCode(); + + if(getBucket() != null) + hashCode = hashCode*17 + getBucket().hashCode(); + return hashCode; + } +} diff --git a/awsapi/src/com/cloud/bridge/model/SObjectItem.hbm.xml b/awsapi/src/com/cloud/bridge/model/SObjectItem.hbm.xml index 99aa9bec48f..12ee4807926 100644 --- a/awsapi/src/com/cloud/bridge/model/SObjectItem.hbm.xml +++ b/awsapi/src/com/cloud/bridge/model/SObjectItem.hbm.xml @@ -1,44 +1,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/model/SObjectItem.java b/awsapi/src/com/cloud/bridge/model/SObjectItem.java index b2380443111..1f5b523d76f 100644 --- a/awsapi/src/com/cloud/bridge/model/SObjectItem.java +++ b/awsapi/src/com/cloud/bridge/model/SObjectItem.java @@ -1,151 +1,167 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.model; - -import java.io.Serializable; -import java.util.Date; - -/** - * @author Kelven Yang, John Zucker - */ -public class SObjectItem implements Serializable { - private static final long serialVersionUID = -7351173256185687851L; - - private Long id; - - private SObject theObject; - private String version; - private String md5; - private String storedPath; - private long storedSize; - - private Date createTime; - private Date lastModifiedTime; - private Date lastAccessTime; - - public SObjectItem() { - } - - public Long getId() { - return id; - } - - private void setId(Long id) { - this.id = id; - } - - public SObject getTheObject() { - return theObject; - } - - public void setTheObject(SObject theObject) { - this.theObject = theObject; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getMd5() { - return md5; - } - - public void setMd5(String md5) { - this.md5 = md5; - } - - public String getStoredPath() { - return storedPath; - } - - public void setStoredPath(String storedPath) { - this.storedPath = storedPath; // TODO - storedpath holds integer, called from S3Engine.allocObjectItem - } - - public long getStoredSize() { - return storedSize; - } - - public void setStoredSize(long storedSize) { - this.storedSize = storedSize; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getLastModifiedTime() { - return lastModifiedTime; - } - - public void setLastModifiedTime(Date lastModifiedTime) { - this.lastModifiedTime = lastModifiedTime; - } - - public Date getLastAccessTime() { - return lastAccessTime; - } - - public void setLastAccessTime(Date lastAccessTime) { - this.lastAccessTime = lastAccessTime; - } - - @Override - public boolean equals(Object other) { - if(this == other) - return true; - - if(!(other instanceof SObjectItem)) - return false; - - if(version != null) { - if(!version.equals(((SObjectItem)other).getVersion())) - return false; - } else { - if(((SObjectItem)other).getVersion() != null) - return false; - } - - if(theObject.getId() != null) { - if(!theObject.getId().equals(((SObjectItem)other).getTheObject())) - return false; - } else { - if(((SObjectItem)other).getTheObject() != null) - return false; - } - return true; - } - - @Override - public int hashCode() { - int hashCode = 0; - if(version != null) - hashCode = hashCode*17 + version.hashCode(); - - if(theObject != null) - hashCode = hashCode*17 + theObject.hashCode(); - - return hashCode; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.model; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author Kelven Yang, John Zucker + */ +public class SObjectItem implements Serializable { + private static final long serialVersionUID = -7351173256185687851L; + + private Long id; + + private SObject theObject; + private String version; + private String md5; + private String storedPath; + private long storedSize; + + private Date createTime; + private Date lastModifiedTime; + private Date lastAccessTime; + + public SObjectItem() { + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public SObject getTheObject() { + return theObject; + } + + public void setTheObject(SObject theObject) { + this.theObject = theObject; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getMd5() { + return md5; + } + + public void setMd5(String md5) { + this.md5 = md5; + } + + public String getStoredPath() { + return storedPath; + } + + public void setStoredPath(String storedPath) { + this.storedPath = storedPath; // TODO - storedpath holds integer, called from S3Engine.allocObjectItem + } + + public long getStoredSize() { + return storedSize; + } + + public void setStoredSize(long storedSize) { + this.storedSize = storedSize; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getLastModifiedTime() { + return lastModifiedTime; + } + + public void setLastModifiedTime(Date lastModifiedTime) { + this.lastModifiedTime = lastModifiedTime; + } + + public Date getLastAccessTime() { + return lastAccessTime; + } + + public void setLastAccessTime(Date lastAccessTime) { + this.lastAccessTime = lastAccessTime; + } + + @Override + public boolean equals(Object other) { + if(this == other) + return true; + + if(!(other instanceof SObjectItem)) + return false; + + if(version != null) { + if(!version.equals(((SObjectItem)other).getVersion())) + return false; + } else { + if(((SObjectItem)other).getVersion() != null) + return false; + } + + if(theObject.getId() != null) { + if(!theObject.getId().equals(((SObjectItem)other).getTheObject())) + return false; + } else { + if(((SObjectItem)other).getTheObject() != null) + return false; + } + return true; + } + + @Override + public int hashCode() { + int hashCode = 0; + if(version != null) + hashCode = hashCode*17 + version.hashCode(); + + if(theObject != null) + hashCode = hashCode*17 + theObject.hashCode(); + + return hashCode; + } +} diff --git a/awsapi/src/com/cloud/bridge/model/UserCredentials.hbm.xml b/awsapi/src/com/cloud/bridge/model/UserCredentials.hbm.xml index 2b84d80a0e7..c7f61273012 100644 --- a/awsapi/src/com/cloud/bridge/model/UserCredentials.hbm.xml +++ b/awsapi/src/com/cloud/bridge/model/UserCredentials.hbm.xml @@ -1,20 +1,20 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/bridge/model/UserCredentials.java b/awsapi/src/com/cloud/bridge/model/UserCredentials.java index 9589567f8f5..5d0c6871ee5 100644 --- a/awsapi/src/com/cloud/bridge/model/UserCredentials.java +++ b/awsapi/src/com/cloud/bridge/model/UserCredentials.java @@ -1,94 +1,110 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.model; - -import java.io.Serializable; - -public class UserCredentials implements Serializable { - private static final long serialVersionUID = 7459503272337054299L; - - private Long id; - private String accessKey; - private String secretKey; - private String certUniqueId; - - public UserCredentials() { - } - - public Long getId() { - return id; - } - - private void setId(Long id) { - this.id = id; - } - - public String getAccessKey() { - return accessKey; - } - - public void setAccessKey(String accessKey) { - this.accessKey = accessKey; - } - - public String getSecretKey() { - return secretKey; - } - - public void setSecretKey(String secretKey) { - this.secretKey = secretKey; - } - - public String getCertUniqueId() { - return certUniqueId; - } - - public void setCertUniqueId(String certUniqueId) { - this.certUniqueId = certUniqueId; - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - - if (!(other instanceof UserCredentials)) return false; - - // The cert id can be null. The cert is unused in the REST API. - if ( getAccessKey().equals(((UserCredentials)other).getAccessKey()) && - getSecretKey().equals(((UserCredentials)other).getSecretKey())) - { - String thisCertId = getCertUniqueId(); - String otherCertId = ((UserCredentials)other).getCertUniqueId(); - - if (null == thisCertId && null == otherCertId) return true; - - if (null != thisCertId && null != otherCertId) return thisCertId.equals( otherCertId ); - } - return false; - } - - @Override - public int hashCode() { - int hashCode = 0; - String thisCertId = getCertUniqueId(); - - // The cert id can be null. The cert is unused in the REST API. - hashCode = hashCode*17 + getAccessKey().hashCode(); - hashCode = hashCode*17 + getSecretKey().hashCode(); - if (null != thisCertId) hashCode = hashCode*17 + thisCertId.hashCode(); - return hashCode; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.model; + +import java.io.Serializable; + +public class UserCredentials implements Serializable { + private static final long serialVersionUID = 7459503272337054299L; + + private Long id; + private String accessKey; + private String secretKey; + private String certUniqueId; + + public UserCredentials() { + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getAccessKey() { + return accessKey; + } + + public void setAccessKey(String accessKey) { + this.accessKey = accessKey; + } + + public String getSecretKey() { + return secretKey; + } + + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + + public String getCertUniqueId() { + return certUniqueId; + } + + public void setCertUniqueId(String certUniqueId) { + this.certUniqueId = certUniqueId; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + + if (!(other instanceof UserCredentials)) return false; + + // The cert id can be null. The cert is unused in the REST API. + if ( getAccessKey().equals(((UserCredentials)other).getAccessKey()) && + getSecretKey().equals(((UserCredentials)other).getSecretKey())) + { + String thisCertId = getCertUniqueId(); + String otherCertId = ((UserCredentials)other).getCertUniqueId(); + + if (null == thisCertId && null == otherCertId) return true; + + if (null != thisCertId && null != otherCertId) return thisCertId.equals( otherCertId ); + } + return false; + } + + @Override + public int hashCode() { + int hashCode = 0; + String thisCertId = getCertUniqueId(); + + // The cert id can be null. The cert is unused in the REST API. + hashCode = hashCode*17 + getAccessKey().hashCode(); + hashCode = hashCode*17 + getSecretKey().hashCode(); + if (null != thisCertId) hashCode = hashCode*17 + thisCertId.hashCode(); + return hashCode; + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/EntityDao.java b/awsapi/src/com/cloud/bridge/persist/EntityDao.java index bfd6ed8f0f9..c040138a50d 100644 --- a/awsapi/src/com/cloud/bridge/persist/EntityDao.java +++ b/awsapi/src/com/cloud/bridge/persist/EntityDao.java @@ -1,118 +1,134 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist; - -import java.io.Serializable; -import java.util.List; - -import org.hibernate.Query; -import org.hibernate.Session; - -import com.cloud.bridge.util.QueryHelper; - -/** - * @author Kelven Yang, John Zucker - * Provide methods for getting, saving, deleting or updating state per session or, in a given session, returnin a List in - * response to queryEntities for a particular instantation of the EntityDao generic class, as defined here. - * Any instantation of EntityDao passes in the class for which it is instantiating. For example a new instance of SBucketDao - * passes in com.cloud.bridge.model.SBucket as its clazz. - * Instantiators, providing an Entity definition, are the classes - * MHostDao, - * MHostMountDao, - * SAclDao, - * SBucketDao, - * SHostDao, - * SMetaDao, - * SObjectDao, - * SObjectItemDao, - * CloudStackSvcOfferingDao - */ - -public class EntityDao { - private Class clazz; - - private boolean isCloudStackSession = false; - - // Constructor to implement CloudStackSvcOffering: see class CloudStackSvcOfferingDao - public EntityDao(Class clazz){ - this(clazz, false); - } - - public EntityDao(Class clazz, boolean isCloudStackSession) { - this.clazz = clazz; - this.isCloudStackSession = isCloudStackSession; - // Note : beginTransaction can be called multiple times - // "If a new underlying transaction is required, begin the transaction. Otherwise continue the new work in the - // context of the existing underlying transaction." from the Hibernate spec - PersistContext.beginTransaction(isCloudStackSession); - } - - @SuppressWarnings("unchecked") - public T get(Serializable id) { - Session session = PersistContext.getSession(isCloudStackSession); - return (T)session.get(clazz, id); - } - - public T save(T entity) { - Session session = PersistContext.getSession(isCloudStackSession); - session.saveOrUpdate(entity); - return entity; - } - - public T update(T entity) { - Session session = PersistContext.getSession(isCloudStackSession); - session.saveOrUpdate(entity); - return entity; - } - - public void delete(T entity) { - Session session = PersistContext.getSession(isCloudStackSession); - session.delete(entity); - } - - public T queryEntity(String hql, Object[] params) { - Session session = PersistContext.getSession(isCloudStackSession); - Query query = session.createQuery(hql); - query.setMaxResults(1); - QueryHelper.bindParameters(query, params); - return (T)query.uniqueResult(); - } - - public List queryEntities(String hql, Object[] params) { - Session session = PersistContext.getSession(isCloudStackSession); - Query query = session.createQuery(hql); - QueryHelper.bindParameters(query, params); - - return (List)query.list(); - } - - public List queryEntities(String hql, int offset, int limit, Object[] params) { - Session session = PersistContext.getSession(isCloudStackSession); - Query query = session.createQuery(hql); - QueryHelper.bindParameters(query, params); - query.setFirstResult(offset); - query.setMaxResults(limit); - return (List)query.list(); - } - - public int executeUpdate(String hql, Object[] params) { - Session session = PersistContext.getSession(isCloudStackSession); - Query query = session.createQuery(hql); - QueryHelper.bindParameters(query, params); - - return query.executeUpdate(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist; + +import java.io.Serializable; +import java.util.List; + +import org.hibernate.Query; +import org.hibernate.Session; + +import com.cloud.bridge.util.QueryHelper; + +/** + * @author Kelven Yang, John Zucker + * Provide methods for getting, saving, deleting or updating state per session or, in a given session, returnin a List in + * response to queryEntities for a particular instantation of the EntityDao generic class, as defined here. + * Any instantation of EntityDao passes in the class for which it is instantiating. For example a new instance of SBucketDao + * passes in com.cloud.bridge.model.SBucket as its clazz. + * Instantiators, providing an Entity definition, are the classes + * MHostDao, + * MHostMountDao, + * SAclDao, + * SBucketDao, + * SHostDao, + * SMetaDao, + * SObjectDao, + * SObjectItemDao, + * CloudStackSvcOfferingDao + */ + +public class EntityDao { + private Class clazz; + + private boolean isCloudStackSession = false; + + // Constructor to implement CloudStackSvcOffering: see class CloudStackSvcOfferingDao + public EntityDao(Class clazz){ + this(clazz, false); + } + + public EntityDao(Class clazz, boolean isCloudStackSession) { + this.clazz = clazz; + this.isCloudStackSession = isCloudStackSession; + // Note : beginTransaction can be called multiple times + // "If a new underlying transaction is required, begin the transaction. Otherwise continue the new work in the + // context of the existing underlying transaction." from the Hibernate spec + PersistContext.beginTransaction(isCloudStackSession); + } + + @SuppressWarnings("unchecked") + public T get(Serializable id) { + Session session = PersistContext.getSession(isCloudStackSession); + return (T)session.get(clazz, id); + } + + public T save(T entity) { + Session session = PersistContext.getSession(isCloudStackSession); + session.saveOrUpdate(entity); + return entity; + } + + public T update(T entity) { + Session session = PersistContext.getSession(isCloudStackSession); + session.saveOrUpdate(entity); + return entity; + } + + public void delete(T entity) { + Session session = PersistContext.getSession(isCloudStackSession); + session.delete(entity); + } + + public T queryEntity(String hql, Object[] params) { + Session session = PersistContext.getSession(isCloudStackSession); + Query query = session.createQuery(hql); + query.setMaxResults(1); + QueryHelper.bindParameters(query, params); + return (T)query.uniqueResult(); + } + + public List queryEntities(String hql, Object[] params) { + Session session = PersistContext.getSession(isCloudStackSession); + Query query = session.createQuery(hql); + QueryHelper.bindParameters(query, params); + + return (List)query.list(); + } + + public List queryEntities(String hql, int offset, int limit, Object[] params) { + Session session = PersistContext.getSession(isCloudStackSession); + Query query = session.createQuery(hql); + QueryHelper.bindParameters(query, params); + query.setFirstResult(offset); + query.setMaxResults(limit); + return (List)query.list(); + } + + public int executeUpdate(String hql, Object[] params) { + Session session = PersistContext.getSession(isCloudStackSession); + Query query = session.createQuery(hql); + QueryHelper.bindParameters(query, params); + + return query.executeUpdate(); + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/GMTDateTimeUserType.java b/awsapi/src/com/cloud/bridge/persist/GMTDateTimeUserType.java index 6bf312030a3..d8e0946bf53 100644 --- a/awsapi/src/com/cloud/bridge/persist/GMTDateTimeUserType.java +++ b/awsapi/src/com/cloud/bridge/persist/GMTDateTimeUserType.java @@ -1,102 +1,118 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist; - -import java.io.Serializable; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Types; -import java.util.Date; - -import org.hibernate.HibernateException; -import org.hibernate.usertype.UserType; - -import com.cloud.bridge.util.DateHelper; - -/** - * @author Kelven Yang - * GMTDateTimeUserType implements a Hibernate user type, it deals with GMT date/time conversion - * between Java Date/Calendar and MySQL DATE types - */ -public class GMTDateTimeUserType implements UserType { - - private static final int[] SQL_TYPES = { Types.VARBINARY }; - - public Class returnedClass() { return Date.class; } - - public boolean equals(Object x, Object y) { - if (x == y) - return true; - - if (x == null || y == null) - return false; - - return x.equals(y); - } - - public int hashCode(Object x) { - if(x != null) - return x.hashCode(); - - return 0; - } - - public Object deepCopy(Object value) { - if(value != null) - return ((Date)value).clone(); - return null; - } - - public boolean isMutable() { - return true; - } - - public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner) - throws HibernateException, SQLException { - - String dateString = resultSet.getString(names[0]); - if(dateString != null) - return DateHelper.parseDateString(DateHelper.GMT_TIMEZONE, dateString); - return null; - } - - public void nullSafeSet(PreparedStatement statement, Object value, int index) - throws HibernateException, SQLException { - if (value == null) { - statement.setNull(index, Types.TIMESTAMP); - } else { - Date dt = (Date)value; - statement.setString(index, DateHelper.getDateDisplayString(DateHelper.GMT_TIMEZONE, dt)); - } - } - - public Object assemble(Serializable cached, Object owner) throws HibernateException { - return DateHelper.parseDateString(DateHelper.GMT_TIMEZONE, (String)cached); - } - - public Serializable disassemble(Object value) throws HibernateException { - return DateHelper.getDateDisplayString(DateHelper.GMT_TIMEZONE, (Date)value); - } - - public Object replace(Object original, Object target, Object owner) throws HibernateException { - return ((Date)original).clone(); - } - - public int[] sqlTypes() { - return SQL_TYPES; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist; + +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; +import java.util.Date; + +import org.hibernate.HibernateException; +import org.hibernate.usertype.UserType; + +import com.cloud.bridge.util.DateHelper; + +/** + * @author Kelven Yang + * GMTDateTimeUserType implements a Hibernate user type, it deals with GMT date/time conversion + * between Java Date/Calendar and MySQL DATE types + */ +public class GMTDateTimeUserType implements UserType { + + private static final int[] SQL_TYPES = { Types.VARBINARY }; + + public Class returnedClass() { return Date.class; } + + public boolean equals(Object x, Object y) { + if (x == y) + return true; + + if (x == null || y == null) + return false; + + return x.equals(y); + } + + public int hashCode(Object x) { + if(x != null) + return x.hashCode(); + + return 0; + } + + public Object deepCopy(Object value) { + if(value != null) + return ((Date)value).clone(); + return null; + } + + public boolean isMutable() { + return true; + } + + public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner) + throws HibernateException, SQLException { + + String dateString = resultSet.getString(names[0]); + if(dateString != null) + return DateHelper.parseDateString(DateHelper.GMT_TIMEZONE, dateString); + return null; + } + + public void nullSafeSet(PreparedStatement statement, Object value, int index) + throws HibernateException, SQLException { + if (value == null) { + statement.setNull(index, Types.TIMESTAMP); + } else { + Date dt = (Date)value; + statement.setString(index, DateHelper.getDateDisplayString(DateHelper.GMT_TIMEZONE, dt)); + } + } + + public Object assemble(Serializable cached, Object owner) throws HibernateException { + return DateHelper.parseDateString(DateHelper.GMT_TIMEZONE, (String)cached); + } + + public Serializable disassemble(Object value) throws HibernateException { + return DateHelper.getDateDisplayString(DateHelper.GMT_TIMEZONE, (Date)value); + } + + public Object replace(Object original, Object target, Object owner) throws HibernateException { + return ((Date)original).clone(); + } + + public int[] sqlTypes() { + return SQL_TYPES; + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/PersistContext.java b/awsapi/src/com/cloud/bridge/persist/PersistContext.java index a7e43005301..8efccac127d 100644 --- a/awsapi/src/com/cloud/bridge/persist/PersistContext.java +++ b/awsapi/src/com/cloud/bridge/persist/PersistContext.java @@ -1,359 +1,375 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -import org.apache.log4j.Logger; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.hibernate.Transaction; - -import com.cloud.bridge.util.CloudSessionFactory; -import com.cloud.bridge.util.CloudStackSessionFactory; -import com.cloud.bridge.util.OrderedPair; - -/** - * @author Kelven Yang - * - * We use Per-thread based hibernate session and transaction pattern. Transaction will be - * started implicitly by EntityDao instances and be committed implicitly in the end of - * request-process cycle. All requests are guarded by a dynamic proxy. - * - * We will try to keep transaction management as implicit as we can, so that - * most of service layer implementation contains business-logic only, all business logic are - * built on top of domain object model, and all persistent layer handling lie within persist layer - * in Dao classes. - * - * PersistContext class also provides per-thread based registry service and global named-lock service - */ -public class PersistContext { - protected final static Logger logger = Logger.getLogger(PersistContext.class); - - private static final CloudSessionFactory sessionFactory; - - private static final ThreadLocal threadSession = new ThreadLocal(); - private static final ThreadLocal threadTransaction = new ThreadLocal(); - private static final ThreadLocal> threadStore = new ThreadLocal>(); - - private static final CloudStackSessionFactory cloudStackSessionFactory; - private static final ThreadLocal threadCloudStackSession = new ThreadLocal(); - private static final ThreadLocal threadCloudStackTransaction = new ThreadLocal(); - - static { - try { - sessionFactory = CloudSessionFactory.getInstance(); - cloudStackSessionFactory = CloudStackSessionFactory.getInstance(); - } catch(HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - throw new PersistException(e); - } - } - - public static Session getSession(boolean cloudStackSession) { - Session s = null; - try { - if(cloudStackSession){ - s = threadCloudStackSession.get(); - if(s == null) { - s = cloudStackSessionFactory.openSession(); - threadCloudStackSession.set(s); - } - }else{ - s = threadSession.get(); - if(s == null) { - s = sessionFactory.openSession(); - threadSession.set(s); - } - } - } catch(HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - throw new PersistException(e); - } - return s; - } - - public static Session getSession() { - return getSession(false); - } - - public static void closeSession() { - closeSession(false); - } - - public static void closeSession(boolean cloudStackSession) { - try { - if(cloudStackSession){ - Session s = (Session) threadCloudStackSession.get(); - threadCloudStackSession.set(null); - if (s != null && s.isOpen()) - s.close(); - }else{ - Session s = (Session) threadSession.get(); - threadSession.set(null); - - if (s != null && s.isOpen()) - s.close(); - } - }catch(HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - throw new PersistException(e); - } - } - - public static void beginTransaction(boolean cloudStackTxn) { - Transaction tx = null; - try { - if(cloudStackTxn){ - tx = threadCloudStackTransaction.get(); - }else{ - tx = threadTransaction.get(); - } - - if (tx == null) { - tx = getSession(cloudStackTxn).beginTransaction(); - if(cloudStackTxn){ - threadCloudStackTransaction.set(tx); - }else{ - threadTransaction.set(tx); - } - } - } catch(HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - throw new PersistException(e); - } - } - - public static void beginTransaction() { - beginTransaction(false); - } - - public static void commitTransaction(boolean cloudStackTxn) { - Transaction tx = null; - - if(cloudStackTxn){ - tx = threadCloudStackTransaction.get(); - }else{ - tx = threadTransaction.get(); - } - - try { - if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ){ - tx.commit(); - } - if(cloudStackTxn){ - threadCloudStackTransaction.set(null); - }else{ - threadTransaction.set(null); - } - } catch (HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - - rollbackTransaction(cloudStackTxn); - throw new PersistException(e); - } - } - - public static void commitTransaction() { - commitTransaction(false); - } - - public static void rollbackTransaction(boolean cloudStackTxn) { - Transaction tx = null; - - if(cloudStackTxn){ - tx = (Transaction)threadCloudStackTransaction.get(); - threadCloudStackTransaction.set(null); - }else{ - tx = (Transaction)threadTransaction.get(); - threadTransaction.set(null); - } - try { - if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ) { - tx.rollback(); - } - } catch (HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - throw new PersistException(e); - } finally { - closeSession(cloudStackTxn); - } - } - - public static void rollbackTransaction() { - rollbackTransaction(false); - } - - public static void flush() { - commitTransaction(); - beginTransaction(); - } - - /** - * acquireNamedLock/releaseNamedLock must be called in pairs and within the same thread - * they can not be called recursively neither - * - * @param name - * @param timeoutSeconds - * @return - */ - public static boolean acquireNamedLock(String name, int timeoutSeconds) { - Connection jdbcConnection = getJDBCConnection(name, true); - if(jdbcConnection == null) { - logger.warn("Unable to acquire named lock connection for named lock: " + name); - return false; - } - - PreparedStatement pstmt = null; - try { - pstmt = jdbcConnection.prepareStatement("SELECT COALESCE(GET_LOCK(?, ?),0)"); - - pstmt.setString(1, name); - pstmt.setInt(2, timeoutSeconds); - - ResultSet rs = pstmt.executeQuery(); - if (rs != null && rs.first()) { - if(rs.getInt(1) > 0) { - return true; - } else { - logger.error("GET_LOCK() timed out on lock : " + name); - } - } - } catch (SQLException e) { - logger.error("GET_LOCK() throws exception ", e); - } catch (Throwable e) { - logger.error("GET_LOCK() throws exception ", e); - } finally { - if (pstmt != null) { - try { - pstmt.close(); - } catch (SQLException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - } - } - } - - releaseJDBCConnection(name); - return false; - } - - public static boolean releaseNamedLock(String name) { - Connection jdbcConnection = getJDBCConnection(name, false); - if(jdbcConnection == null) { - logger.error("Unable to acquire DB connection for global lock system"); - return false; - } - - PreparedStatement pstmt = null; - try { - pstmt = jdbcConnection.prepareStatement("SELECT COALESCE(RELEASE_LOCK(?), 0)"); - pstmt.setString(1, name); - ResultSet rs = pstmt.executeQuery(); - if(rs != null && rs.first()) - return rs.getInt(1) > 0; - logger.error("RELEASE_LOCK() returns unexpected result : " + rs.getInt(1)); - } catch (SQLException e) { - logger.error("RELEASE_LOCK() throws exception ", e); - } catch (Throwable e) { - logger.error("RELEASE_LOCK() throws exception ", e); - } finally { - releaseJDBCConnection(name); - } - return false; - } - - @SuppressWarnings("deprecation") - private static Connection getJDBCConnection(String name, boolean allocNew) { - String registryKey = "JDBC-Connection." + name; - OrderedPair info = (OrderedPair)getThreadStoreObject(registryKey); - if(info == null && allocNew) { - Session session = sessionFactory.openSession(); - Connection connection = session.connection(); - if(connection == null) { - session.close(); - return null; - } - - try { - connection.setAutoCommit(true); - } catch(SQLException e) { - logger.warn("Unexpected exception " + e.getMessage(), e); - try { - connection.close(); - session.close(); - } catch(Throwable ex) { - logger.warn("Unexpected exception " + e.getMessage(), e); - } - return null; - } - - registerThreadStoreObject(registryKey, new OrderedPair(session, connection)); - return connection; - } - - if(info != null) - return info.getSecond(); - - return null; - } - - private static void releaseJDBCConnection(String name) { - String registryKey = "JDBC-Connection." + name; - OrderedPair info = (OrderedPair)unregisterThreadStoreObject(registryKey); - if(info != null) { - try { - info.getSecond().close(); - info.getFirst().close(); - } catch(Throwable e) { - logger.warn("Unexpected exception " + e.getMessage(), e); - } - } - } - - public static void registerThreadStoreObject(String name, Object object) { - Map store = getThreadStore(); - store.put(name, object); - } - - public static Object getThreadStoreObject(String name) { - Map store = getThreadStore(); - return store.get(name); - } - - public static Object unregisterThreadStoreObject(String name) { - Map store = getThreadStore(); - if(store.containsKey(name)) { - Object value = store.get(name); - store.remove(name); - return value; - } - return null; - } - - private static Map getThreadStore() { - Map store = threadStore.get(); - if(store == null) { - store = new HashMap(); - threadStore.set(store); - } - return store; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + +import com.cloud.bridge.util.CloudSessionFactory; +import com.cloud.bridge.util.CloudStackSessionFactory; +import com.cloud.bridge.util.OrderedPair; + +/** + * @author Kelven Yang + * + * We use Per-thread based hibernate session and transaction pattern. Transaction will be + * started implicitly by EntityDao instances and be committed implicitly in the end of + * request-process cycle. All requests are guarded by a dynamic proxy. + * + * We will try to keep transaction management as implicit as we can, so that + * most of service layer implementation contains business-logic only, all business logic are + * built on top of domain object model, and all persistent layer handling lie within persist layer + * in Dao classes. + * + * PersistContext class also provides per-thread based registry service and global named-lock service + */ +public class PersistContext { + protected final static Logger logger = Logger.getLogger(PersistContext.class); + + private static final CloudSessionFactory sessionFactory; + + private static final ThreadLocal threadSession = new ThreadLocal(); + private static final ThreadLocal threadTransaction = new ThreadLocal(); + private static final ThreadLocal> threadStore = new ThreadLocal>(); + + private static final CloudStackSessionFactory cloudStackSessionFactory; + private static final ThreadLocal threadCloudStackSession = new ThreadLocal(); + private static final ThreadLocal threadCloudStackTransaction = new ThreadLocal(); + + static { + try { + sessionFactory = CloudSessionFactory.getInstance(); + cloudStackSessionFactory = CloudStackSessionFactory.getInstance(); + } catch(HibernateException e) { + logger.error("Exception " + e.getMessage(), e); + throw new PersistException(e); + } + } + + public static Session getSession(boolean cloudStackSession) { + Session s = null; + try { + if(cloudStackSession){ + s = threadCloudStackSession.get(); + if(s == null) { + s = cloudStackSessionFactory.openSession(); + threadCloudStackSession.set(s); + } + }else{ + s = threadSession.get(); + if(s == null) { + s = sessionFactory.openSession(); + threadSession.set(s); + } + } + } catch(HibernateException e) { + logger.error("Exception " + e.getMessage(), e); + throw new PersistException(e); + } + return s; + } + + public static Session getSession() { + return getSession(false); + } + + public static void closeSession() { + closeSession(false); + } + + public static void closeSession(boolean cloudStackSession) { + try { + if(cloudStackSession){ + Session s = (Session) threadCloudStackSession.get(); + threadCloudStackSession.set(null); + if (s != null && s.isOpen()) + s.close(); + }else{ + Session s = (Session) threadSession.get(); + threadSession.set(null); + + if (s != null && s.isOpen()) + s.close(); + } + }catch(HibernateException e) { + logger.error("Exception " + e.getMessage(), e); + throw new PersistException(e); + } + } + + public static void beginTransaction(boolean cloudStackTxn) { + Transaction tx = null; + try { + if(cloudStackTxn){ + tx = threadCloudStackTransaction.get(); + }else{ + tx = threadTransaction.get(); + } + + if (tx == null) { + tx = getSession(cloudStackTxn).beginTransaction(); + if(cloudStackTxn){ + threadCloudStackTransaction.set(tx); + }else{ + threadTransaction.set(tx); + } + } + } catch(HibernateException e) { + logger.error("Exception " + e.getMessage(), e); + throw new PersistException(e); + } + } + + public static void beginTransaction() { + beginTransaction(false); + } + + public static void commitTransaction(boolean cloudStackTxn) { + Transaction tx = null; + + if(cloudStackTxn){ + tx = threadCloudStackTransaction.get(); + }else{ + tx = threadTransaction.get(); + } + + try { + if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ){ + tx.commit(); + } + if(cloudStackTxn){ + threadCloudStackTransaction.set(null); + }else{ + threadTransaction.set(null); + } + } catch (HibernateException e) { + logger.error("Exception " + e.getMessage(), e); + + rollbackTransaction(cloudStackTxn); + throw new PersistException(e); + } + } + + public static void commitTransaction() { + commitTransaction(false); + } + + public static void rollbackTransaction(boolean cloudStackTxn) { + Transaction tx = null; + + if(cloudStackTxn){ + tx = (Transaction)threadCloudStackTransaction.get(); + threadCloudStackTransaction.set(null); + }else{ + tx = (Transaction)threadTransaction.get(); + threadTransaction.set(null); + } + try { + if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ) { + tx.rollback(); + } + } catch (HibernateException e) { + logger.error("Exception " + e.getMessage(), e); + throw new PersistException(e); + } finally { + closeSession(cloudStackTxn); + } + } + + public static void rollbackTransaction() { + rollbackTransaction(false); + } + + public static void flush() { + commitTransaction(); + beginTransaction(); + } + + /** + * acquireNamedLock/releaseNamedLock must be called in pairs and within the same thread + * they can not be called recursively neither + * + * @param name + * @param timeoutSeconds + * @return + */ + public static boolean acquireNamedLock(String name, int timeoutSeconds) { + Connection jdbcConnection = getJDBCConnection(name, true); + if(jdbcConnection == null) { + logger.warn("Unable to acquire named lock connection for named lock: " + name); + return false; + } + + PreparedStatement pstmt = null; + try { + pstmt = jdbcConnection.prepareStatement("SELECT COALESCE(GET_LOCK(?, ?),0)"); + + pstmt.setString(1, name); + pstmt.setInt(2, timeoutSeconds); + + ResultSet rs = pstmt.executeQuery(); + if (rs != null && rs.first()) { + if(rs.getInt(1) > 0) { + return true; + } else { + logger.error("GET_LOCK() timed out on lock : " + name); + } + } + } catch (SQLException e) { + logger.error("GET_LOCK() throws exception ", e); + } catch (Throwable e) { + logger.error("GET_LOCK() throws exception ", e); + } finally { + if (pstmt != null) { + try { + pstmt.close(); + } catch (SQLException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + } + } + } + + releaseJDBCConnection(name); + return false; + } + + public static boolean releaseNamedLock(String name) { + Connection jdbcConnection = getJDBCConnection(name, false); + if(jdbcConnection == null) { + logger.error("Unable to acquire DB connection for global lock system"); + return false; + } + + PreparedStatement pstmt = null; + try { + pstmt = jdbcConnection.prepareStatement("SELECT COALESCE(RELEASE_LOCK(?), 0)"); + pstmt.setString(1, name); + ResultSet rs = pstmt.executeQuery(); + if(rs != null && rs.first()) + return rs.getInt(1) > 0; + logger.error("RELEASE_LOCK() returns unexpected result : " + rs.getInt(1)); + } catch (SQLException e) { + logger.error("RELEASE_LOCK() throws exception ", e); + } catch (Throwable e) { + logger.error("RELEASE_LOCK() throws exception ", e); + } finally { + releaseJDBCConnection(name); + } + return false; + } + + @SuppressWarnings("deprecation") + private static Connection getJDBCConnection(String name, boolean allocNew) { + String registryKey = "JDBC-Connection." + name; + OrderedPair info = (OrderedPair)getThreadStoreObject(registryKey); + if(info == null && allocNew) { + Session session = sessionFactory.openSession(); + Connection connection = session.connection(); + if(connection == null) { + session.close(); + return null; + } + + try { + connection.setAutoCommit(true); + } catch(SQLException e) { + logger.warn("Unexpected exception " + e.getMessage(), e); + try { + connection.close(); + session.close(); + } catch(Throwable ex) { + logger.warn("Unexpected exception " + e.getMessage(), e); + } + return null; + } + + registerThreadStoreObject(registryKey, new OrderedPair(session, connection)); + return connection; + } + + if(info != null) + return info.getSecond(); + + return null; + } + + private static void releaseJDBCConnection(String name) { + String registryKey = "JDBC-Connection." + name; + OrderedPair info = (OrderedPair)unregisterThreadStoreObject(registryKey); + if(info != null) { + try { + info.getSecond().close(); + info.getFirst().close(); + } catch(Throwable e) { + logger.warn("Unexpected exception " + e.getMessage(), e); + } + } + } + + public static void registerThreadStoreObject(String name, Object object) { + Map store = getThreadStore(); + store.put(name, object); + } + + public static Object getThreadStoreObject(String name) { + Map store = getThreadStore(); + return store.get(name); + } + + public static Object unregisterThreadStoreObject(String name) { + Map store = getThreadStore(); + if(store.containsKey(name)) { + Object value = store.get(name); + store.remove(name); + return value; + } + return null; + } + + private static Map getThreadStore() { + Map store = threadStore.get(); + if(store == null) { + store = new HashMap(); + threadStore.set(store); + } + return store; + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/PersistException.java b/awsapi/src/com/cloud/bridge/persist/PersistException.java index 41954f17623..b7c5bfb758f 100644 --- a/awsapi/src/com/cloud/bridge/persist/PersistException.java +++ b/awsapi/src/com/cloud/bridge/persist/PersistException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist; - -/** - * @author Kelven Yang - */ -public class PersistException extends RuntimeException { - private static final long serialVersionUID = -7137918292537610367L; - - public PersistException() { - } - - public PersistException(String message) { - super(message); - } - - public PersistException(Throwable e) { - super(e); - } - - public PersistException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist; + +/** + * @author Kelven Yang + */ +public class PersistException extends RuntimeException { + private static final long serialVersionUID = -7137918292537610367L; + + public PersistException() { + } + + public PersistException(String message) { + super(message); + } + + public PersistException(Throwable e) { + super(e); + } + + public PersistException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/BaseDao.java b/awsapi/src/com/cloud/bridge/persist/dao/BaseDao.java index 7b0ed442092..c3988e54255 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/BaseDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/BaseDao.java @@ -1,75 +1,91 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Properties; - -import org.apache.log4j.Logger; -import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; -import org.jasypt.properties.EncryptableProperties; - -import com.cloud.bridge.util.ConfigurationHelper; -import com.cloud.bridge.util.EncryptionSecretKeyCheckerUtil; - - - -public class BaseDao { - public static final Logger logger = Logger.getLogger(BaseDao.class); - - protected static String cloud_dbName = null; - protected static String dbHost = null; - protected static String dbUser = null; - protected static String dbPassword = null; - protected static String dbPort = null; - protected static String awsapi_dbName = null; - - static{ - logger.info("Initializing DB props"); - File propertiesFile = ConfigurationHelper.findConfigurationFile("db.properties"); - Properties EC2Prop = null; - - if (null != propertiesFile) { - if(EncryptionSecretKeyCheckerUtil.useEncryption()){ - StandardPBEStringEncryptor encryptor = EncryptionSecretKeyCheckerUtil.getEncryptor(); - EC2Prop = new EncryptableProperties(encryptor); - } else { - EC2Prop = new Properties(); - } - - try { - EC2Prop.load( new FileInputStream( propertiesFile )); - } catch (FileNotFoundException e) { - logger.warn("Unable to open properties file: " + propertiesFile.getAbsolutePath(), e); - } catch (IOException e) { - logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e); - } - dbHost = EC2Prop.getProperty( "db.cloud.host" ); - awsapi_dbName = EC2Prop.getProperty( "db.awsapi.name" ); - cloud_dbName = EC2Prop.getProperty( "db.cloud.name" ); - dbUser = EC2Prop.getProperty( "db.cloud.username" ); - dbPassword = EC2Prop.getProperty( "db.cloud.password" ); - dbPort = EC2Prop.getProperty( "db.cloud.port" ); - } - } - - public BaseDao() { - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Properties; + +import org.apache.log4j.Logger; +import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; +import org.jasypt.properties.EncryptableProperties; + +import com.cloud.bridge.util.ConfigurationHelper; +import com.cloud.bridge.util.EncryptionSecretKeyCheckerUtil; + + + +public class BaseDao { + public static final Logger logger = Logger.getLogger(BaseDao.class); + + protected static String cloud_dbName = null; + protected static String dbHost = null; + protected static String dbUser = null; + protected static String dbPassword = null; + protected static String dbPort = null; + protected static String awsapi_dbName = null; + + static{ + logger.info("Initializing DB props"); + File propertiesFile = ConfigurationHelper.findConfigurationFile("db.properties"); + Properties EC2Prop = null; + + if (null != propertiesFile) { + if(EncryptionSecretKeyCheckerUtil.useEncryption()){ + StandardPBEStringEncryptor encryptor = EncryptionSecretKeyCheckerUtil.getEncryptor(); + EC2Prop = new EncryptableProperties(encryptor); + } else { + EC2Prop = new Properties(); + } + + try { + EC2Prop.load( new FileInputStream( propertiesFile )); + } catch (FileNotFoundException e) { + logger.warn("Unable to open properties file: " + propertiesFile.getAbsolutePath(), e); + } catch (IOException e) { + logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e); + } + dbHost = EC2Prop.getProperty( "db.cloud.host" ); + awsapi_dbName = EC2Prop.getProperty( "db.awsapi.name" ); + cloud_dbName = EC2Prop.getProperty( "db.cloud.name" ); + dbUser = EC2Prop.getProperty( "db.cloud.username" ); + dbPassword = EC2Prop.getProperty( "db.cloud.password" ); + dbPort = EC2Prop.getProperty( "db.cloud.port" ); + } + } + + public BaseDao() { + } + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDao.java b/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDao.java index acd441e3b73..7705044bde6 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDao.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java index 5e804c6e9eb..40d6f436802 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java @@ -1,34 +1,50 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.persist.EntityDao; -import com.cloud.stack.models.CloudStackAccount; - -public class CloudStackAccountDao extends EntityDao { - public static final Logger logger = Logger.getLogger(CloudStackAccountDao.class); - - public CloudStackAccountDao() { - super(CloudStackAccount.class, true); - } - - public CloudStackAccount getdefaultZoneId( String id ) { - return queryEntity("from CloudStackAccount where id=?", new Object[] {id}); - } -} - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.persist.EntityDao; +import com.cloud.stack.models.CloudStackAccount; + +public class CloudStackAccountDao extends EntityDao { + public static final Logger logger = Logger.getLogger(CloudStackAccountDao.class); + + public CloudStackAccountDao() { + super(CloudStackAccount.class, true); + } + + public CloudStackAccount getdefaultZoneId( String id ) { + return queryEntity("from CloudStackAccount where id=?", new Object[] {id}); + } +} + diff --git a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDao.java b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDao.java index 65af77aea61..0e3c4673fcd 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDao.java @@ -1,41 +1,57 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.persist.EntityDao; -import com.cloud.stack.models.CloudStackConfiguration; - - -public class CloudStackConfigurationDao extends EntityDao { - public static final Logger logger = Logger.getLogger(CloudStackConfigurationDao.class); - - public CloudStackConfigurationDao() { - super(CloudStackConfiguration.class, true); - } - - - public String getConfigValue( String configName ){ - CloudStackConfiguration config = queryEntity("from CloudStackConfiguration where name=?", new Object[] {configName}); - if(config != null){ - return config.getValue(); - } - return null; - } - - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.persist.EntityDao; +import com.cloud.stack.models.CloudStackConfiguration; + + +public class CloudStackConfigurationDao extends EntityDao { + public static final Logger logger = Logger.getLogger(CloudStackConfigurationDao.class); + + public CloudStackConfigurationDao() { + super(CloudStackConfiguration.class, true); + } + + + public String getConfigValue( String configName ){ + CloudStackConfiguration config = queryEntity("from CloudStackConfiguration where name=?", new Object[] {configName}); + if(config != null){ + return config.getValue(); + } + return null; + } + + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDao.java b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDao.java index 96c6ec721e7..fed8a6d8005 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDao.java @@ -1,41 +1,57 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.persist.EntityDao; -import com.cloud.stack.models.CloudStackConfiguration; -import com.cloud.stack.models.CloudStackServiceOffering; - - -public class CloudStackSvcOfferingDao extends EntityDao { - public static final Logger logger = Logger.getLogger(CloudStackSvcOfferingDao.class); - - public CloudStackSvcOfferingDao() { - super(CloudStackServiceOffering.class, true); - } - - - public CloudStackServiceOffering getSvcOfferingByName( String name ){ - return queryEntity("from CloudStackServiceOffering where name=?", new Object[] {name}); - } - - public CloudStackServiceOffering getSvcOfferingById( String id ){ - return queryEntity("from CloudStackServiceOffering where id=?", new Object[] {id}); - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.persist.EntityDao; +import com.cloud.stack.models.CloudStackConfiguration; +import com.cloud.stack.models.CloudStackServiceOffering; + + +public class CloudStackSvcOfferingDao extends EntityDao { + public static final Logger logger = Logger.getLogger(CloudStackSvcOfferingDao.class); + + public CloudStackSvcOfferingDao() { + super(CloudStackServiceOffering.class, true); + } + + + public CloudStackServiceOffering getSvcOfferingByName( String name ){ + return queryEntity("from CloudStackServiceOffering where name=?", new Object[] {name}); + } + + public CloudStackServiceOffering getSvcOfferingById( String id ){ + return queryEntity("from CloudStackServiceOffering where id=?", new Object[] {id}); + } + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MHostDao.java b/awsapi/src/com/cloud/bridge/persist/dao/MHostDao.java index 8694ab582f7..42559f647f3 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/MHostDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/MHostDao.java @@ -1,32 +1,48 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import com.cloud.bridge.model.MHost; -import com.cloud.bridge.persist.EntityDao; - -/** - * @author Kelven Yang - */ -public class MHostDao extends EntityDao { - public MHostDao() { - super(MHost.class); - } - - public MHost getByHostKey(String hostKey) { - return queryEntity("from MHost where hostKey=?", new Object[] {hostKey}); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import com.cloud.bridge.model.MHost; +import com.cloud.bridge.persist.EntityDao; + +/** + * @author Kelven Yang + */ +public class MHostDao extends EntityDao { + public MHostDao() { + super(MHost.class); + } + + public MHost getByHostKey(String hostKey) { + return queryEntity("from MHost where hostKey=?", new Object[] {hostKey}); + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDao.java b/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDao.java index ba620729cc2..d1cc84303ab 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDao.java @@ -1,32 +1,48 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import com.cloud.bridge.model.MHostMount; -import com.cloud.bridge.persist.EntityDao; - -/** - * @author Kelven Yang - */ -public class MHostMountDao extends EntityDao { - public MHostMountDao() { - super(MHostMount.class); - } - - public MHostMount getHostMount(long mHostId, long sHostId) { - return queryEntity("from MHostMount where mhost=? and shost=?", new Object[] { mHostId, sHostId } ); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import com.cloud.bridge.model.MHostMount; +import com.cloud.bridge.persist.EntityDao; + +/** + * @author Kelven Yang + */ +public class MHostMountDao extends EntityDao { + public MHostMountDao() { + super(MHostMount.class); + } + + public MHostMount getHostMount(long mHostId, long sHostId) { + return queryEntity("from MHostMount where mhost=? and shost=?", new Object[] { mHostId, sHostId } ); + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MultipartLoadDao.java b/awsapi/src/com/cloud/bridge/persist/dao/MultipartLoadDao.java index 191cdd4fb96..ba212bca02e 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/MultipartLoadDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/MultipartLoadDao.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java b/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java index c8433cfd376..eff3ffc40f2 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java index 3df0d543af4..934384729f6 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java @@ -1,78 +1,94 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import java.util.Date; -import java.util.List; - -import com.cloud.bridge.model.SAcl; -import com.cloud.bridge.persist.EntityDao; -import com.cloud.bridge.persist.PersistContext; -import com.cloud.bridge.service.core.s3.S3AccessControlList; -import com.cloud.bridge.service.core.s3.S3Grant; - -/** - * @author Kelven Yang - */ -public class SAclDao extends EntityDao { - - public SAclDao() { - super(SAcl.class); - } - - public List listGrants(String target, long targetId) { - return queryEntities("from SAcl where target=? and targetId=? order by grantOrder asc", - new Object[] { target, new Long(targetId)}); - } - - public List listGrants(String target, long targetId, String userCanonicalId) { - return queryEntities("from SAcl where target=? and targetId=? and granteeCanonicalId=? order by grantOrder asc", - new Object[] { target, new Long(targetId), userCanonicalId }); - } - - public void save(String target, long targetId, S3AccessControlList acl) { - // -> the target's ACLs are being redefined - executeUpdate("delete from SAcl where target=? and targetId=?", new Object[] { target, new Long(targetId)}); - - if(acl != null) { - S3Grant[] grants = acl.getGrants(); - if(grants != null && grants.length > 0) { - int grantOrder = 1; - for(S3Grant grant : grants) { - save(target, targetId, grant, grantOrder++); - } - } - } - } - - public SAcl save(String target, long targetId, S3Grant grant, int grantOrder) { - SAcl aclEntry = new SAcl(); - aclEntry.setTarget(target); - aclEntry.setTargetId(targetId); - aclEntry.setGrantOrder(grantOrder); - - int grantee = grant.getGrantee(); - aclEntry.setGranteeType(grantee); - aclEntry.setPermission(grant.getPermission()); - aclEntry.setGranteeCanonicalId(grant.getCanonicalUserID()); - - Date ts = new Date(); - aclEntry.setCreateTime(ts); - aclEntry.setLastModifiedTime(ts); - PersistContext.getSession().save(aclEntry); - return aclEntry; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import java.util.Date; +import java.util.List; + +import com.cloud.bridge.model.SAcl; +import com.cloud.bridge.persist.EntityDao; +import com.cloud.bridge.persist.PersistContext; +import com.cloud.bridge.service.core.s3.S3AccessControlList; +import com.cloud.bridge.service.core.s3.S3Grant; + +/** + * @author Kelven Yang + */ +public class SAclDao extends EntityDao { + + public SAclDao() { + super(SAcl.class); + } + + public List listGrants(String target, long targetId) { + return queryEntities("from SAcl where target=? and targetId=? order by grantOrder asc", + new Object[] { target, new Long(targetId)}); + } + + public List listGrants(String target, long targetId, String userCanonicalId) { + return queryEntities("from SAcl where target=? and targetId=? and granteeCanonicalId=? order by grantOrder asc", + new Object[] { target, new Long(targetId), userCanonicalId }); + } + + public void save(String target, long targetId, S3AccessControlList acl) { + // -> the target's ACLs are being redefined + executeUpdate("delete from SAcl where target=? and targetId=?", new Object[] { target, new Long(targetId)}); + + if(acl != null) { + S3Grant[] grants = acl.getGrants(); + if(grants != null && grants.length > 0) { + int grantOrder = 1; + for(S3Grant grant : grants) { + save(target, targetId, grant, grantOrder++); + } + } + } + } + + public SAcl save(String target, long targetId, S3Grant grant, int grantOrder) { + SAcl aclEntry = new SAcl(); + aclEntry.setTarget(target); + aclEntry.setTargetId(targetId); + aclEntry.setGrantOrder(grantOrder); + + int grantee = grant.getGrantee(); + aclEntry.setGranteeType(grantee); + aclEntry.setPermission(grant.getPermission()); + aclEntry.setGranteeCanonicalId(grant.getCanonicalUserID()); + + Date ts = new Date(); + aclEntry.setCreateTime(ts); + aclEntry.setLastModifiedTime(ts); + PersistContext.getSession().save(aclEntry); + return aclEntry; + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SBucketDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SBucketDao.java index 71c2b793d6d..94b2b719780 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SBucketDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SBucketDao.java @@ -1,39 +1,55 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import java.util.List; - -import com.cloud.bridge.model.SBucket; -import com.cloud.bridge.persist.EntityDao; - -/** - * @author Kelven Yang - */ -public class SBucketDao extends EntityDao { - public SBucketDao() { - super(SBucket.class); - } - - public SBucket getByName(String bucketName) { - return queryEntity("from SBucket where name=?", new Object[] {bucketName}); - } - - public List listBuckets(String canonicalId) { - return queryEntities("from SBucket where ownerCanonicalId=? order by createTime asc", - new Object[] {canonicalId}); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import java.util.List; + +import com.cloud.bridge.model.SBucket; +import com.cloud.bridge.persist.EntityDao; + +/** + * @author Kelven Yang + */ +public class SBucketDao extends EntityDao { + public SBucketDao() { + super(SBucket.class); + } + + public SBucket getByName(String bucketName) { + return queryEntity("from SBucket where name=?", new Object[] {bucketName}); + } + + public List listBuckets(String canonicalId) { + return queryEntities("from SBucket where ownerCanonicalId=? order by createTime asc", + new Object[] {canonicalId}); + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SHostDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SHostDao.java index a883740acee..45fe5952529 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SHostDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SHostDao.java @@ -1,37 +1,53 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import com.cloud.bridge.model.SHost; -import com.cloud.bridge.persist.EntityDao; - -/** - * @author Kelven Yang - */ -public class SHostDao extends EntityDao { - public SHostDao() { - super(SHost.class); - } - - public SHost getByHost(String host) { - return queryEntity("from SHost where host=?", new Object[] { host }); - } - - public SHost getLocalStorageHost(long mhostId, String storageRoot) { - return queryEntity("from SHost where mhost=? and exportRoot=?", - new Object[] { new Long(mhostId), storageRoot}); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import com.cloud.bridge.model.SHost; +import com.cloud.bridge.persist.EntityDao; + +/** + * @author Kelven Yang + */ +public class SHostDao extends EntityDao { + public SHostDao() { + super(SHost.class); + } + + public SHost getByHost(String host) { + return queryEntity("from SHost where host=?", new Object[] { host }); + } + + public SHost getLocalStorageHost(long mhostId, String storageRoot) { + return queryEntity("from SHost where mhost=? and exportRoot=?", + new Object[] { new Long(mhostId), storageRoot}); + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SMetaDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SMetaDao.java index 4a62a57902c..889ab8dd70b 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SMetaDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SMetaDao.java @@ -1,57 +1,73 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import java.util.List; - -import com.cloud.bridge.model.SMeta; -import com.cloud.bridge.persist.EntityDao; -import com.cloud.bridge.persist.PersistContext; -import com.cloud.bridge.service.core.s3.S3MetaDataEntry; - -/** - * @author Kelven Yang, John Zucker - */ -public class SMetaDao extends EntityDao { - public SMetaDao() { - super(SMeta.class); - } - - public List getByTarget(String target, long targetId) { - return queryEntities("from SMeta where target=? and targetId=?", new Object[] {target, targetId}); - } - - public SMeta save(String target, long targetId, S3MetaDataEntry entry) { - SMeta meta = new SMeta(); - meta.setTarget(target); - meta.setTargetId(targetId); - meta.setName(entry.getName()); - meta.setValue(entry.getValue()); - - PersistContext.getSession().save(meta); - return meta; - } - - public void save(String target, long targetId, S3MetaDataEntry[] entries) { - // To redefine the target's metadaa - executeUpdate("delete from SMeta where target=? and targetId=?", new Object[] { target, new Long(targetId)}); - - if(entries != null) { - for(S3MetaDataEntry entry : entries) - save(target, targetId, entry); - } - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import java.util.List; + +import com.cloud.bridge.model.SMeta; +import com.cloud.bridge.persist.EntityDao; +import com.cloud.bridge.persist.PersistContext; +import com.cloud.bridge.service.core.s3.S3MetaDataEntry; + +/** + * @author Kelven Yang, John Zucker + */ +public class SMetaDao extends EntityDao { + public SMetaDao() { + super(SMeta.class); + } + + public List getByTarget(String target, long targetId) { + return queryEntities("from SMeta where target=? and targetId=?", new Object[] {target, targetId}); + } + + public SMeta save(String target, long targetId, S3MetaDataEntry entry) { + SMeta meta = new SMeta(); + meta.setTarget(target); + meta.setTargetId(targetId); + meta.setName(entry.getName()); + meta.setValue(entry.getValue()); + + PersistContext.getSession().save(meta); + return meta; + } + + public void save(String target, long targetId, S3MetaDataEntry[] entries) { + // To redefine the target's metadaa + executeUpdate("delete from SMeta where target=? and targetId=?", new Object[] { target, new Long(targetId)}); + + if(entries != null) { + for(S3MetaDataEntry entry : entries) + save(target, targetId, entry); + } + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SObjectDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SObjectDao.java index 68473e1d3bc..cc972251d61 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SObjectDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SObjectDao.java @@ -1,78 +1,94 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import java.util.ArrayList; -import java.util.List; - -import com.cloud.bridge.model.SBucket; -import com.cloud.bridge.model.SObject; -import com.cloud.bridge.persist.EntityDao; -import com.cloud.bridge.util.EntityParam; - -/** - * @author Kelven Yang - */ -public class SObjectDao extends EntityDao { - public SObjectDao() { - super(SObject.class); - } - - public SObject getByNameKey(SBucket bucket, String nameKey) { - return queryEntity("from SObject where bucket=? and nameKey=?", - new Object[] { new EntityParam(bucket), nameKey }); - } - - public List listBucketObjects(SBucket bucket, String prefix, String marker, int maxKeys) { - StringBuffer sb = new StringBuffer(); - List params = new ArrayList(); - - sb.append("from SObject o left join fetch o.items where deletionMark is null and o.bucket=?"); - params.add(new EntityParam(bucket)); - - if(prefix != null && !prefix.isEmpty()) { - sb.append(" and o.nameKey like ?"); - params.add(new String(prefix + "%")); - } - - if(marker != null && !marker.isEmpty()) { - sb.append(" and o.nameKey > ?"); - params.add(marker); - } - - return queryEntities(sb.toString(), 0, maxKeys, params.toArray()); - } - - public List listAllBucketObjects(SBucket bucket, String prefix, String marker, int maxKeys) { - StringBuffer sb = new StringBuffer(); - List params = new ArrayList(); - - sb.append("from SObject o left join fetch o.items where o.bucket=?"); - params.add(new EntityParam(bucket)); - - if(prefix != null && !prefix.isEmpty()) { - sb.append(" and o.nameKey like ?"); - params.add(new String(prefix + "%")); - } - - if(marker != null && !marker.isEmpty()) { - sb.append(" and o.nameKey > ?"); - params.add(marker); - } - - return queryEntities(sb.toString(), 0, maxKeys, params.toArray()); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import java.util.ArrayList; +import java.util.List; + +import com.cloud.bridge.model.SBucket; +import com.cloud.bridge.model.SObject; +import com.cloud.bridge.persist.EntityDao; +import com.cloud.bridge.util.EntityParam; + +/** + * @author Kelven Yang + */ +public class SObjectDao extends EntityDao { + public SObjectDao() { + super(SObject.class); + } + + public SObject getByNameKey(SBucket bucket, String nameKey) { + return queryEntity("from SObject where bucket=? and nameKey=?", + new Object[] { new EntityParam(bucket), nameKey }); + } + + public List listBucketObjects(SBucket bucket, String prefix, String marker, int maxKeys) { + StringBuffer sb = new StringBuffer(); + List params = new ArrayList(); + + sb.append("from SObject o left join fetch o.items where deletionMark is null and o.bucket=?"); + params.add(new EntityParam(bucket)); + + if(prefix != null && !prefix.isEmpty()) { + sb.append(" and o.nameKey like ?"); + params.add(new String(prefix + "%")); + } + + if(marker != null && !marker.isEmpty()) { + sb.append(" and o.nameKey > ?"); + params.add(marker); + } + + return queryEntities(sb.toString(), 0, maxKeys, params.toArray()); + } + + public List listAllBucketObjects(SBucket bucket, String prefix, String marker, int maxKeys) { + StringBuffer sb = new StringBuffer(); + List params = new ArrayList(); + + sb.append("from SObject o left join fetch o.items where o.bucket=?"); + params.add(new EntityParam(bucket)); + + if(prefix != null && !prefix.isEmpty()) { + sb.append(" and o.nameKey like ?"); + params.add(new String(prefix + "%")); + } + + if(marker != null && !marker.isEmpty()) { + sb.append(" and o.nameKey > ?"); + params.add(marker); + } + + return queryEntities(sb.toString(), 0, maxKeys, params.toArray()); + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDao.java index 950cc600e1d..7ccb684ecbe 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDao.java @@ -1,32 +1,48 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import com.cloud.bridge.model.SObjectItem; -import com.cloud.bridge.persist.EntityDao; - -/** - * @author Kelven Yang - */ -public class SObjectItemDao extends EntityDao { - public SObjectItemDao() { - super(SObjectItem.class); - } - - public SObjectItem getByObjectIdNullVersion(long id) { - return queryEntity("from SObjectItem where theObject=? and version is null", new Object[] { id }); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import com.cloud.bridge.model.SObjectItem; +import com.cloud.bridge.persist.EntityDao; + +/** + * @author Kelven Yang + */ +public class SObjectItemDao extends EntityDao { + public SObjectItemDao() { + super(SObjectItem.class); + } + + public SObjectItem getByObjectIdNullVersion(long id) { + return queryEntity("from SObjectItem where theObject=? and version is null", new Object[] { id }); + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDao.java b/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDao.java index 13b6d741a05..1ec322e7615 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDao.java @@ -1,168 +1,184 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.persist.dao; - -import java.sql.*; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.model.UserCredentials; -import com.cloud.bridge.service.exception.NoSuchObjectException; - - -public class UserCredentialsDao extends BaseDao{ - public static final Logger logger = Logger.getLogger(UserCredentialsDao.class); - - private Connection conn = null; - - public UserCredentialsDao() { - } - - public void setUserKeys( String cloudAccessKey, String cloudSecretKey ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - UserCredentials user = getByAccessKey( cloudAccessKey ); - PreparedStatement statement = null; - - openConnection(); - try { - if ( null == user ) { - // -> do an insert since the user does not exist yet - statement = conn.prepareStatement ( "INSERT INTO usercredentials (AccessKey, SecretKey) VALUES(?,?)" ); - statement.setString( 1, cloudAccessKey ); - statement.setString( 2, cloudSecretKey ); - } - else { - // -> do an update since the user exists - statement = conn.prepareStatement ( "UPDATE usercredentials SET SecretKey=? WHERE AccessKey=?" ); - statement.setString( 1, cloudSecretKey ); - statement.setString( 2, cloudAccessKey ); - } - int count = statement.executeUpdate(); - statement.close(); - - } finally { - closeConnection(); - } - } - - public void setCertificateId( String cloudAccessKey, String certId ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - UserCredentials user = getByAccessKey( cloudAccessKey ); - PreparedStatement statement = null; - - if (null == user) throw new NoSuchObjectException( "Cloud API Access Key [" + cloudAccessKey + "] is unknown" ); - - openConnection(); - try { - statement = conn.prepareStatement ( "UPDATE usercredentials SET CertUniqueId=? WHERE AccessKey=?" ); - statement.setString( 1, certId ); - statement.setString( 2, cloudAccessKey ); - int count = statement.executeUpdate(); - statement.close(); - - } finally { - closeConnection(); - } - } - - public UserCredentials getByAccessKey( String cloudAccessKey ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - openConnection(); - - UserCredentials user = null; - - try { - PreparedStatement statement = conn.prepareStatement ( "SELECT SecretKey, CertUniqueId FROM usercredentials WHERE AccessKey=?" ); - statement.setString( 1, cloudAccessKey ); - statement.executeQuery(); - ResultSet rs = statement.getResultSet (); - if (rs.next()) { - user = new UserCredentials(); - user.setAccessKey( cloudAccessKey ); - user.setSecretKey( rs.getString( "SecretKey" )); - user.setCertUniqueId( rs.getString( "CertUniqueId" )); - } - - } finally { - closeConnection(); - } - return user; - } - - public UserCredentials getByCertUniqueId( String certId ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - openConnection(); - - UserCredentials user = null; - - try { - PreparedStatement statement = conn.prepareStatement ( "SELECT AccessKey, SecretKey FROM usercredentials WHERE CertUniqueId=?" ); - statement.setString( 1, certId ); - statement.executeQuery(); - ResultSet rs = statement.getResultSet (); - if (rs.next()) { - user = new UserCredentials(); - user.setAccessKey( rs.getString( "AccessKey" )); - user.setSecretKey( rs.getString( "SecretKey" )); - user.setCertUniqueId( certId ); - } - - } finally { - closeConnection(); - } - return user; - } - - private void openConnection() - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - if (null == conn) { - Class.forName( "com.mysql.jdbc.Driver" ).newInstance(); - conn = DriverManager.getConnection( "jdbc:mysql://" + dbHost + "/" + awsapi_dbName, dbUser, dbPassword ); - } - } - - private void closeConnection() throws SQLException { - if (null != conn) conn.close(); - conn = null; - } - - public static void preCheckTableExistence() throws Exception{ - UserCredentialsDao dao = new UserCredentialsDao(); - dao.checkTableExistence(); - } - - private void checkTableExistence() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - openConnection(); - - try { - PreparedStatement statement = conn.prepareStatement ( "SELECT * FROM usercredentials " ); - statement.executeQuery(); - ResultSet rs = statement.getResultSet (); - if (rs.next()) { - return; - } - return; - - } catch(Exception e) { - Statement statement = conn.createStatement(); - statement.execute( "create table usercredentials(id integer auto_increment primary key, AccessKey varchar(1000), SecretKey varchar(1000), CertUniqueId varchar(1000))" ); - statement.close(); - } - finally{ - closeConnection(); - } - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.persist.dao; + +import java.sql.*; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.model.UserCredentials; +import com.cloud.bridge.service.exception.NoSuchObjectException; + + +public class UserCredentialsDao extends BaseDao{ + public static final Logger logger = Logger.getLogger(UserCredentialsDao.class); + + private Connection conn = null; + + public UserCredentialsDao() { + } + + public void setUserKeys( String cloudAccessKey, String cloudSecretKey ) + throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { + UserCredentials user = getByAccessKey( cloudAccessKey ); + PreparedStatement statement = null; + + openConnection(); + try { + if ( null == user ) { + // -> do an insert since the user does not exist yet + statement = conn.prepareStatement ( "INSERT INTO usercredentials (AccessKey, SecretKey) VALUES(?,?)" ); + statement.setString( 1, cloudAccessKey ); + statement.setString( 2, cloudSecretKey ); + } + else { + // -> do an update since the user exists + statement = conn.prepareStatement ( "UPDATE usercredentials SET SecretKey=? WHERE AccessKey=?" ); + statement.setString( 1, cloudSecretKey ); + statement.setString( 2, cloudAccessKey ); + } + int count = statement.executeUpdate(); + statement.close(); + + } finally { + closeConnection(); + } + } + + public void setCertificateId( String cloudAccessKey, String certId ) + throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { + UserCredentials user = getByAccessKey( cloudAccessKey ); + PreparedStatement statement = null; + + if (null == user) throw new NoSuchObjectException( "Cloud API Access Key [" + cloudAccessKey + "] is unknown" ); + + openConnection(); + try { + statement = conn.prepareStatement ( "UPDATE usercredentials SET CertUniqueId=? WHERE AccessKey=?" ); + statement.setString( 1, certId ); + statement.setString( 2, cloudAccessKey ); + int count = statement.executeUpdate(); + statement.close(); + + } finally { + closeConnection(); + } + } + + public UserCredentials getByAccessKey( String cloudAccessKey ) + throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { + openConnection(); + + UserCredentials user = null; + + try { + PreparedStatement statement = conn.prepareStatement ( "SELECT SecretKey, CertUniqueId FROM usercredentials WHERE AccessKey=?" ); + statement.setString( 1, cloudAccessKey ); + statement.executeQuery(); + ResultSet rs = statement.getResultSet (); + if (rs.next()) { + user = new UserCredentials(); + user.setAccessKey( cloudAccessKey ); + user.setSecretKey( rs.getString( "SecretKey" )); + user.setCertUniqueId( rs.getString( "CertUniqueId" )); + } + + } finally { + closeConnection(); + } + return user; + } + + public UserCredentials getByCertUniqueId( String certId ) + throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { + openConnection(); + + UserCredentials user = null; + + try { + PreparedStatement statement = conn.prepareStatement ( "SELECT AccessKey, SecretKey FROM usercredentials WHERE CertUniqueId=?" ); + statement.setString( 1, certId ); + statement.executeQuery(); + ResultSet rs = statement.getResultSet (); + if (rs.next()) { + user = new UserCredentials(); + user.setAccessKey( rs.getString( "AccessKey" )); + user.setSecretKey( rs.getString( "SecretKey" )); + user.setCertUniqueId( certId ); + } + + } finally { + closeConnection(); + } + return user; + } + + private void openConnection() + throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { + if (null == conn) { + Class.forName( "com.mysql.jdbc.Driver" ).newInstance(); + conn = DriverManager.getConnection( "jdbc:mysql://" + dbHost + "/" + awsapi_dbName, dbUser, dbPassword ); + } + } + + private void closeConnection() throws SQLException { + if (null != conn) conn.close(); + conn = null; + } + + public static void preCheckTableExistence() throws Exception{ + UserCredentialsDao dao = new UserCredentialsDao(); + dao.checkTableExistence(); + } + + private void checkTableExistence() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { + openConnection(); + + try { + PreparedStatement statement = conn.prepareStatement ( "SELECT * FROM usercredentials " ); + statement.executeQuery(); + ResultSet rs = statement.getResultSet (); + if (rs.next()) { + return; + } + return; + + } catch(Exception e) { + Statement statement = conn.createStatement(); + statement.execute( "create table usercredentials(id integer auto_increment primary key, AccessKey varchar(1000), SecretKey varchar(1000), CertUniqueId varchar(1000))" ); + statement.close(); + } + finally{ + closeConnection(); + } + } +} diff --git a/awsapi/src/com/cloud/bridge/service/EC2MainServlet.java b/awsapi/src/com/cloud/bridge/service/EC2MainServlet.java index a25ea037100..0c904a134ac 100644 --- a/awsapi/src/com/cloud/bridge/service/EC2MainServlet.java +++ b/awsapi/src/com/cloud/bridge/service/EC2MainServlet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service; import java.io.IOException; diff --git a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java index 74eb6393390..e372e5cd0bc 100644 --- a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java +++ b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/EC2SoapService.java b/awsapi/src/com/cloud/bridge/service/EC2SoapService.java index 0547c90bd5a..0a5ed9e443d 100644 --- a/awsapi/src/com/cloud/bridge/service/EC2SoapService.java +++ b/awsapi/src/com/cloud/bridge/service/EC2SoapService.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java b/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java index 222ef49084f..01c78a89373 100644 --- a/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java +++ b/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/S3Constants.java b/awsapi/src/com/cloud/bridge/service/S3Constants.java index ee2a1497f41..c42c652cbea 100644 --- a/awsapi/src/com/cloud/bridge/service/S3Constants.java +++ b/awsapi/src/com/cloud/bridge/service/S3Constants.java @@ -1,27 +1,43 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service; - -/** - * @author Kelven Yang - * Constants used in S3 implementation, one place to hold commonly used constants - */ -public interface S3Constants { - public final String BUCKET_ATTR_KEY = "s3-bucket"; - public final String OBJECT_ATTR_KEY = "s3-object-key"; - public final String PLAIN_POST_ACCESS_KEY = "s3-access-key"; - public final String PLAIN_POST_SIGNATURE = "s3-signature"; -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service; + +/** + * @author Kelven Yang + * Constants used in S3 implementation, one place to hold commonly used constants + */ +public interface S3Constants { + public final String BUCKET_ATTR_KEY = "s3-bucket"; + public final String OBJECT_ATTR_KEY = "s3-object-key"; + public final String PLAIN_POST_ACCESS_KEY = "s3-access-key"; + public final String PLAIN_POST_SIGNATURE = "s3-signature"; +} diff --git a/awsapi/src/com/cloud/bridge/service/S3RestServlet.java b/awsapi/src/com/cloud/bridge/service/S3RestServlet.java index 706f254f652..370b2bea31e 100644 --- a/awsapi/src/com/cloud/bridge/service/S3RestServlet.java +++ b/awsapi/src/com/cloud/bridge/service/S3RestServlet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/UserContext.java b/awsapi/src/com/cloud/bridge/service/UserContext.java index 9fdc06ca134..7d587e9e76f 100644 --- a/awsapi/src/com/cloud/bridge/service/UserContext.java +++ b/awsapi/src/com/cloud/bridge/service/UserContext.java @@ -1,111 +1,127 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.service.exception.InternalErrorException; -import com.cloud.bridge.util.StringHelper; - -/** - * @author Kelven Yang - */ -public class UserContext { - protected final static Logger logger = Logger.getLogger(UserContext.class); - - private static ThreadLocal threadUserContext = new ThreadLocal(); - - private boolean annonymous = false; - private String accessKey; - private String secretKey; - private String canonicalUserId; // In our design, we re-use the accessKey to provide the canonicalUserId -- TODO loPri - reconsider? - private String description; - private HttpServletRequest request = null; - - public UserContext() { - } - - public static UserContext current() { - UserContext context = threadUserContext.get(); - if (context == null) { - logger.debug("initializing a new [anonymous] UserContext!"); - context = new UserContext(); - threadUserContext.set(context); - } - return context; - } - - public void initContext() { - annonymous = true; - } - - public void initContext(String accessKey, String secretKey, String canonicalUserId, String description, HttpServletRequest request) { - this.accessKey = accessKey; - this.secretKey = secretKey; - this.canonicalUserId = canonicalUserId; - this.description = description; - this.annonymous = false; - this.request = request; - } - - public HttpServletRequest getHttp() { - return request; - } - - public String getAccessKey() { - if (annonymous) - return StringHelper.EMPTY_STRING; - - if (accessKey == null) { - logger.error("Fatal - UserContext has not been correctly setup"); - throw new InternalErrorException("Uninitalized user context"); - } - return accessKey; - } - - public String getSecretKey() { - if (annonymous) - return StringHelper.EMPTY_STRING; - - if (secretKey == null) { - logger.error("Fatal - UserContext has not been correctly setup"); - throw new InternalErrorException("Uninitalized user context"); - } - - return secretKey; - } - - public String getCanonicalUserId() { - if (annonymous) - return StringHelper.EMPTY_STRING; - - if (canonicalUserId == null) { - logger.error("Fatal - UserContext has not been correctly setup"); - throw new InternalErrorException("Uninitalized user context"); - } - - return canonicalUserId; - } - - public String getDescription() { - if (description != null) - return description; - - return StringHelper.EMPTY_STRING; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.service.exception.InternalErrorException; +import com.cloud.bridge.util.StringHelper; + +/** + * @author Kelven Yang + */ +public class UserContext { + protected final static Logger logger = Logger.getLogger(UserContext.class); + + private static ThreadLocal threadUserContext = new ThreadLocal(); + + private boolean annonymous = false; + private String accessKey; + private String secretKey; + private String canonicalUserId; // In our design, we re-use the accessKey to provide the canonicalUserId -- TODO loPri - reconsider? + private String description; + private HttpServletRequest request = null; + + public UserContext() { + } + + public static UserContext current() { + UserContext context = threadUserContext.get(); + if (context == null) { + logger.debug("initializing a new [anonymous] UserContext!"); + context = new UserContext(); + threadUserContext.set(context); + } + return context; + } + + public void initContext() { + annonymous = true; + } + + public void initContext(String accessKey, String secretKey, String canonicalUserId, String description, HttpServletRequest request) { + this.accessKey = accessKey; + this.secretKey = secretKey; + this.canonicalUserId = canonicalUserId; + this.description = description; + this.annonymous = false; + this.request = request; + } + + public HttpServletRequest getHttp() { + return request; + } + + public String getAccessKey() { + if (annonymous) + return StringHelper.EMPTY_STRING; + + if (accessKey == null) { + logger.error("Fatal - UserContext has not been correctly setup"); + throw new InternalErrorException("Uninitalized user context"); + } + return accessKey; + } + + public String getSecretKey() { + if (annonymous) + return StringHelper.EMPTY_STRING; + + if (secretKey == null) { + logger.error("Fatal - UserContext has not been correctly setup"); + throw new InternalErrorException("Uninitalized user context"); + } + + return secretKey; + } + + public String getCanonicalUserId() { + if (annonymous) + return StringHelper.EMPTY_STRING; + + if (canonicalUserId == null) { + logger.error("Fatal - UserContext has not been correctly setup"); + throw new InternalErrorException("Uninitalized user context"); + } + + return canonicalUserId; + } + + public String getDescription() { + if (description != null) + return description; + + return StringHelper.EMPTY_STRING; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/UserInfo.java b/awsapi/src/com/cloud/bridge/service/UserInfo.java index d19427feda5..8761e5387f3 100644 --- a/awsapi/src/com/cloud/bridge/service/UserInfo.java +++ b/awsapi/src/com/cloud/bridge/service/UserInfo.java @@ -1,61 +1,77 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service; - -/** - * @author Kelven Yang - */ -public class UserInfo { - private String accessKey; - private String secretKey; - private String canonicalUserId; - private String description; - - public UserInfo() { - } - - public String getAccessKey() { - return accessKey; - } - - public void setAccessKey(String accessKey) { - this.accessKey = accessKey; - } - - public String getSecretKey() { - return secretKey; - } - - public void setSecretKey(String secretKey) { - this.secretKey = secretKey; - } - - public String getCanonicalUserId() { - return canonicalUserId; - } - - public void setCanonicalUserId(String canonicalUserId) { - this.canonicalUserId = canonicalUserId; - } - - public String getDescription() { - return description; - } - - public void setDescription(String discription) { - this.description = discription; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service; + +/** + * @author Kelven Yang + */ +public class UserInfo { + private String accessKey; + private String secretKey; + private String canonicalUserId; + private String description; + + public UserInfo() { + } + + public String getAccessKey() { + return accessKey; + } + + public void setAccessKey(String accessKey) { + this.accessKey = accessKey; + } + + public String getSecretKey() { + return secretKey; + } + + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + + public String getCanonicalUserId() { + return canonicalUserId; + } + + public void setCanonicalUserId(String canonicalUserId) { + this.canonicalUserId = canonicalUserId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String discription) { + this.description = discription; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/controller/s3/S3BucketAction.java b/awsapi/src/com/cloud/bridge/service/controller/s3/S3BucketAction.java index 4ecacdf6e40..00120b4cf72 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/S3BucketAction.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/S3BucketAction.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java b/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java index 7283705c3ae..727752d4767 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/controller/s3/S3SerializableServiceImplementation.java b/awsapi/src/com/cloud/bridge/service/controller/s3/S3SerializableServiceImplementation.java index 1c34a783b97..b930f68efcd 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/S3SerializableServiceImplementation.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/S3SerializableServiceImplementation.java @@ -1,724 +1,740 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.controller.s3; - -import java.util.Calendar; - -import org.apache.axis2.AxisFault; -import org.apache.log4j.Logger; - -import com.amazon.s3.AccessControlList; -import com.amazon.s3.AccessControlPolicy; -import com.amazon.s3.AmazonS3SkeletonInterface; -import com.amazon.s3.CanonicalUser; -import com.amazon.s3.CopyObject; -import com.amazon.s3.CopyObjectResult; -import com.amazon.s3.Group; -import com.amazon.s3.CopyObjectResponse; -import com.amazon.s3.CreateBucket; -import com.amazon.s3.CreateBucketResponse; -import com.amazon.s3.CreateBucketResult; -import com.amazon.s3.DeleteBucket; -import com.amazon.s3.DeleteBucketResponse; -import com.amazon.s3.DeleteObject; -import com.amazon.s3.DeleteObjectResponse; -import com.amazon.s3.GetBucketAccessControlPolicy; -import com.amazon.s3.GetBucketAccessControlPolicyResponse; -import com.amazon.s3.GetBucketLoggingStatus; -import com.amazon.s3.GetBucketLoggingStatusResponse; -import com.amazon.s3.GetObject; -import com.amazon.s3.GetObjectAccessControlPolicy; -import com.amazon.s3.GetObjectAccessControlPolicyResponse; -import com.amazon.s3.GetObjectExtended; -import com.amazon.s3.GetObjectExtendedResponse; -import com.amazon.s3.GetObjectResponse; -import com.amazon.s3.GetObjectResult; -import com.amazon.s3.Grant; -import com.amazon.s3.Grantee; -import com.amazon.s3.ListAllMyBuckets; -import com.amazon.s3.ListAllMyBucketsEntry; -import com.amazon.s3.ListAllMyBucketsList; -import com.amazon.s3.ListAllMyBucketsResponse; -import com.amazon.s3.ListAllMyBucketsResult; -import com.amazon.s3.ListBucket; -import com.amazon.s3.ListBucketResponse; -import com.amazon.s3.ListBucketResult; -import com.amazon.s3.ListEntry; -import com.amazon.s3.MetadataDirective; -import com.amazon.s3.MetadataEntry; -import com.amazon.s3.Permission; -import com.amazon.s3.PrefixEntry; -import com.amazon.s3.PutObject; -import com.amazon.s3.PutObjectInline; -import com.amazon.s3.PutObjectInlineResponse; -import com.amazon.s3.PutObjectResponse; -import com.amazon.s3.PutObjectResult; -import com.amazon.s3.SetBucketAccessControlPolicy; -import com.amazon.s3.SetBucketAccessControlPolicyResponse; -import com.amazon.s3.SetBucketLoggingStatus; -import com.amazon.s3.SetBucketLoggingStatusResponse; -import com.amazon.s3.SetObjectAccessControlPolicy; -import com.amazon.s3.SetObjectAccessControlPolicyResponse; -import com.amazon.s3.Status; -import com.amazon.s3.StorageClass; -import com.cloud.bridge.model.SAcl; -import com.cloud.bridge.service.core.s3.S3AccessControlList; -import com.cloud.bridge.service.core.s3.S3AccessControlPolicy; -import com.cloud.bridge.service.core.s3.S3CanonicalUser; -import com.cloud.bridge.service.core.s3.S3ConditionalHeaders; -import com.cloud.bridge.service.core.s3.S3CopyObjectRequest; -import com.cloud.bridge.service.core.s3.S3CopyObjectResponse; -import com.cloud.bridge.service.core.s3.S3CreateBucketRequest; -import com.cloud.bridge.service.core.s3.S3CreateBucketResponse; -import com.cloud.bridge.service.core.s3.S3DeleteBucketRequest; -import com.cloud.bridge.service.core.s3.S3DeleteObjectRequest; -import com.cloud.bridge.service.core.s3.S3Engine; -import com.cloud.bridge.service.core.s3.S3GetBucketAccessControlPolicyRequest; -import com.cloud.bridge.service.core.s3.S3GetObjectAccessControlPolicyRequest; -import com.cloud.bridge.service.core.s3.S3GetObjectRequest; -import com.cloud.bridge.service.core.s3.S3GetObjectResponse; -import com.cloud.bridge.service.core.s3.S3Grant; -import com.cloud.bridge.service.core.s3.S3ListAllMyBucketsEntry; -import com.cloud.bridge.service.core.s3.S3ListAllMyBucketsRequest; -import com.cloud.bridge.service.core.s3.S3ListAllMyBucketsResponse; -import com.cloud.bridge.service.core.s3.S3ListBucketObjectEntry; -import com.cloud.bridge.service.core.s3.S3ListBucketPrefixEntry; -import com.cloud.bridge.service.core.s3.S3ListBucketRequest; -import com.cloud.bridge.service.core.s3.S3ListBucketResponse; -import com.cloud.bridge.service.core.s3.S3MetaDataEntry; -import com.cloud.bridge.service.core.s3.S3PutObjectInlineRequest; -import com.cloud.bridge.service.core.s3.S3PutObjectInlineResponse; -import com.cloud.bridge.service.core.s3.S3Response; -import com.cloud.bridge.service.core.s3.S3SetBucketAccessControlPolicyRequest; -import com.cloud.bridge.service.core.s3.S3SetObjectAccessControlPolicyRequest; -import com.cloud.bridge.service.exception.InternalErrorException; - -/* @Author Kelven Yang, John Zucker - * Implementation of S3 service requests as operations defined by the interface, com.amazon.s3.AmazonS3SkeletonInterface. - * The operations dispatched from this class are of the form of SOAP operations which define business logic to be executed by the request. - * The methods required for S3 services in accordance with the skeleton are either implementations of the following - * getBucketLoggingStatus - * copyObject - * getBucketAccessControlPolicy - * listBucket - * putObject - * createBucket - * listAllMyBuckets - * getObject - * deleteBucket - * setBucketLoggingStatus - * getObjectAccessControlPolicy - * deleteObject - * setBucketAccessControlPolicy - * setObjectAccessControlPolicy - * putObjectInline - * getObjectExtended - * or throw and Axis2 fault otherwise. - * These skeleton methods can be used as the implementation of services to satisfy SOAP calls, but also to provide the output - * to be serialized by the AXIOM XML processor. - * - * */ - -public class S3SerializableServiceImplementation implements AmazonS3SkeletonInterface { - protected final static Logger logger = Logger.getLogger(S3SerializableServiceImplementation.class); - - private S3Engine engine; - - public S3SerializableServiceImplementation(S3Engine engine) { - this.engine = engine; - } - - public GetBucketLoggingStatusResponse getBucketLoggingStatus( - GetBucketLoggingStatus getBucketLoggingStatus) { - throw new UnsupportedOperationException("Unsupported API"); - } - - public SetBucketLoggingStatusResponse setBucketLoggingStatus(SetBucketLoggingStatus setBucketLoggingStatus) { - throw new UnsupportedOperationException("Unsupported API"); - } - - public CopyObjectResponse copyObject(CopyObject copyObject) throws AxisFault { - S3CopyObjectRequest request = new S3CopyObjectRequest(); - - request.setSourceBucketName(copyObject.getSourceBucket()); - request.setSourceKey(copyObject.getSourceKey()); - request.setDestinationBucketName(copyObject.getDestinationBucket()); - request.setDestinationKey(copyObject.getDestinationKey()); - - MetadataDirective mdd = copyObject.getMetadataDirective(); - if (null != mdd) request.setDataDirective(mdd.getValue()); - - request.setMetaEntries(toEngineMetaEntries(copyObject.getMetadata())); - request.setAcl(toEngineAccessControlList(copyObject.getAccessControlList())); - - S3ConditionalHeaders conds = new S3ConditionalHeaders(); - conds.setModifiedSince(copyObject.getCopySourceIfModifiedSince()); - conds.setUnModifiedSince(copyObject.getCopySourceIfUnmodifiedSince()); - conds.setMatch(copyObject.getCopySourceIfMatch()); - conds.setNoneMatch(copyObject.getCopySourceIfNoneMatch()); - request.setConditions(conds); - - return toCopyObjectResponse(engine.handleRequest(request)); - } - - public GetBucketAccessControlPolicyResponse getBucketAccessControlPolicy( - GetBucketAccessControlPolicy getBucketAccessControlPolicy) { - // TODO - after authentication, we should setup user context - return toGetBucketAccessControlPolicyResponse(engine.handleRequest( - toEngineGetBucketAccessControlPolicyRequest(getBucketAccessControlPolicy))); - } - - private S3GetBucketAccessControlPolicyRequest toEngineGetBucketAccessControlPolicyRequest( - GetBucketAccessControlPolicy getBucketAccessControlPolicy) { - S3GetBucketAccessControlPolicyRequest request = new S3GetBucketAccessControlPolicyRequest(); - - request.setAccessKey(getBucketAccessControlPolicy.getAWSAccessKeyId()); - request.setRequestTimestamp(getBucketAccessControlPolicy.getTimestamp()); - request.setSignature(getBucketAccessControlPolicy.getSignature()); - request.setBucketName(getBucketAccessControlPolicy.getBucket()); - return request; - } - - public static GetBucketAccessControlPolicyResponse toGetBucketAccessControlPolicyResponse(S3AccessControlPolicy policy) { - GetBucketAccessControlPolicyResponse response = new GetBucketAccessControlPolicyResponse(); - response.setGetBucketAccessControlPolicyResponse(toAccessControlPolicy(policy)); - return response; - } - - public SetBucketAccessControlPolicyResponse setBucketAccessControlPolicy(SetBucketAccessControlPolicy setBucketAccessControlPolicy) { - S3SetBucketAccessControlPolicyRequest request = new S3SetBucketAccessControlPolicyRequest(); - request.setAccessKey(setBucketAccessControlPolicy.getAWSAccessKeyId()); - request.setRequestTimestamp(setBucketAccessControlPolicy.getTimestamp()); - request.setSignature(setBucketAccessControlPolicy.getSignature()); - request.setBucketName(setBucketAccessControlPolicy.getBucket()); - request.setAcl(toEngineAccessControlList(setBucketAccessControlPolicy.getAccessControlList())); - - SetBucketAccessControlPolicyResponse response = new SetBucketAccessControlPolicyResponse(); - return response; - } - - public ListBucketResponse listBucket (ListBucket listBucket) { - // after authentication, we should setup user context - return toListBucketResponse(engine.listBucketContents(toEngineListBucketRequest(listBucket), false)); - } - - private S3ListBucketRequest toEngineListBucketRequest(ListBucket listBucket) { - S3ListBucketRequest request = new S3ListBucketRequest(); - - request.setAccessKey(listBucket.getAWSAccessKeyId()); - request.setRequestTimestamp(listBucket.getTimestamp()); - request.setSignature(listBucket.getSignature()); - - request.setBucketName(listBucket.getBucket()); - request.setDelimiter(listBucket.getDelimiter()); - request.setMarker(listBucket.getMarker()); - request.setMaxKeys(listBucket.getMaxKeys()); - request.setPrefix(listBucket.getPrefix()); - return request; - } - - public static ListBucketResponse toListBucketResponse(S3ListBucketResponse engineResponse) { - ListBucketResponse response = new ListBucketResponse(); - ListBucketResult result = new ListBucketResult(); - result.setName(engineResponse.getBucketName()); - result.setDelimiter(engineResponse.getDelimiter()); - result.setPrefix(engineResponse.getPrefix()); - result.setMarker(engineResponse.getMarker()); - result.setMaxKeys(engineResponse.getMaxKeys()); - result.setIsTruncated(engineResponse.isTruncated()); - result.setNextMarker(engineResponse.getNextMarker()); - result.setCommonPrefixes(toPrefixEntry(engineResponse.getCommonPrefixes())); - result.setContents(toListEntry(engineResponse.getContents())); - response.setListBucketResponse(result); - return response; - } - - private static PrefixEntry[] toPrefixEntry(S3ListBucketPrefixEntry[] engineEntries) { - if(engineEntries != null) { - PrefixEntry[] entries = new PrefixEntry[engineEntries.length]; - for(int i = 0; i < engineEntries.length; i++) { - entries[i] = new PrefixEntry(); - entries[i].setPrefix(engineEntries[i].getPrefix()); - } - - return entries; - } - return null; - } - - private static ListEntry[] toListEntry(S3ListBucketObjectEntry[] engineEntries) { - if(engineEntries != null) { - ListEntry[] entries = new ListEntry[engineEntries.length]; - for(int i = 0; i < engineEntries.length; i++) { - entries[i] = new ListEntry(); - entries[i].setETag(engineEntries[i].getETag()); - entries[i].setKey(engineEntries[i].getKey()); - entries[i].setLastModified(engineEntries[i].getLastModified()); - entries[i].setSize(engineEntries[i].getSize()); - entries[i].setStorageClass(StorageClass.STANDARD); - - CanonicalUser owner = new CanonicalUser(); - owner.setID(engineEntries[i].getOwnerCanonicalId()); - owner.setDisplayName(engineEntries[i].getOwnerDisplayName()); - entries[i].setOwner(owner); - } - return entries; - } - - return null; - } - - public PutObjectResponse putObject(PutObject putObject) { - //TODO : fill this with the necessary business logic - throw new UnsupportedOperationException("Please implement " + this.getClass().getName() + "#putObject"); - } - - public CreateBucketResponse createBucket (CreateBucket createBucket) { - return toCreateBucketResponse(engine.handleRequest(toEngineCreateBucketRequest(createBucket))); - } - - private S3CreateBucketRequest toEngineCreateBucketRequest(CreateBucket createBucket) { - S3CreateBucketRequest request = new S3CreateBucketRequest(); - request.setAccessKey(createBucket.getAWSAccessKeyId()); - request.setRequestTimestamp(createBucket.getTimestamp()); - request.setSignature(createBucket.getSignature()); - request.setBucketName(createBucket.getBucket()); - request.setAcl(toEngineAccessControlList(createBucket.getAccessControlList())); - return request; - } - - private CreateBucketResponse toCreateBucketResponse(S3CreateBucketResponse engineResponse) { - CreateBucketResponse response = new CreateBucketResponse(); - CreateBucketResult result = new CreateBucketResult(); - result.setBucketName(engineResponse.getBucketName()); - response.setCreateBucketReturn(result); - return response; - } - - public ListAllMyBucketsResponse listAllMyBuckets (ListAllMyBuckets listAllMyBuckets) { - return toListAllMyBucketsResponse(engine.handleRequest(toEngineListAllMyBucketsRequest(listAllMyBuckets))); - } - - private S3ListAllMyBucketsRequest toEngineListAllMyBucketsRequest(ListAllMyBuckets listAllMyBuckets) { - S3ListAllMyBucketsRequest request = new S3ListAllMyBucketsRequest(); - request.setAccessKey(listAllMyBuckets.getAWSAccessKeyId()); - request.setRequestTimestamp(listAllMyBuckets.getTimestamp()); - request.setSignature(listAllMyBuckets.getSignature()); - return request; - } - - public static ListAllMyBucketsResponse toListAllMyBucketsResponse(S3ListAllMyBucketsResponse engineResponse) { - ListAllMyBucketsResponse response = new ListAllMyBucketsResponse(); - ListAllMyBucketsResult result = new ListAllMyBucketsResult(); - ListAllMyBucketsEntry[] entries = null; - - S3CanonicalUser ownerEngine = engineResponse.getOwner(); - CanonicalUser owner = new CanonicalUser(); - owner.setID(ownerEngine.getID()); - owner.setDisplayName(ownerEngine.getDisplayName()); - result.setOwner(owner); - S3ListAllMyBucketsEntry[] engineEntries = engineResponse.getBuckets(); - if (engineEntries != null) { - entries = new ListAllMyBucketsEntry[engineEntries.length]; - for(int i = 0; i < engineEntries.length; i++) { - entries[i] = new ListAllMyBucketsEntry(); - entries[i].setName(engineEntries[i].getName()); - entries[i].setCreationDate(engineEntries[i].getCreationDate()); //setTimeZone(TimeZone.getTimeZone("Z")); - } - - ListAllMyBucketsList list = new ListAllMyBucketsList(); - list.setBucket(entries); - result.setBuckets(list); - } - response.setListAllMyBucketsResponse(result); - return response; - } - - public DeleteBucketResponse deleteBucket(DeleteBucket deleteBucket) { - return toDeleteBucketResponse(engine.handleRequest(toEngineDeleteBucketRequest(deleteBucket))); - } - - private S3DeleteBucketRequest toEngineDeleteBucketRequest(DeleteBucket deleteBucket) { - S3DeleteBucketRequest request = new S3DeleteBucketRequest(); - request.setAccessKey(deleteBucket.getAWSAccessKeyId()); - request.setRequestTimestamp(deleteBucket.getTimestamp()); - request.setSignature(deleteBucket.getSignature()); - request.setBucketName(deleteBucket.getBucket()); - return request; - } - - private DeleteBucketResponse toDeleteBucketResponse(S3Response engineResponse) { - DeleteBucketResponse response = new DeleteBucketResponse(); - Status status = new Status(); - status.setCode(engineResponse.getResultCode()); - status.setDescription(engineResponse.getResultDescription()); - response.setDeleteBucketResponse(status); - return response; - } - - public GetObjectResponse getObject(com.amazon.s3.GetObject getObject) { - return toGetObjectResponse(engine.handleRequest(toEngineGetObjectRequest(getObject))); - } - - public GetObjectExtendedResponse getObjectExtended(GetObjectExtended getObjectExtended) { - return toGetObjectExtendedResponse(engine.handleRequest(toEngineGetObjectRequest(getObjectExtended))); - } - - private S3GetObjectRequest toEngineGetObjectRequest(GetObject getObject) - { - S3GetObjectRequest request = new S3GetObjectRequest(); - - request.setAccessKey(getObject.getAWSAccessKeyId()); - request.setRequestTimestamp(getObject.getTimestamp()); - request.setSignature(getObject.getSignature()); - request.setBucketName(getObject.getBucket()); - request.setKey(getObject.getKey()); - request.setReturnData(getObject.getGetData()); - request.setReturnMetadata(getObject.getGetMetadata()); - request.setInlineData(getObject.getInlineData()); - return request; - } - - private S3GetObjectRequest toEngineGetObjectRequest(GetObjectExtended getObjectExtended) { - S3GetObjectRequest request = new S3GetObjectRequest(); - request.setAccessKey(getObjectExtended.getAWSAccessKeyId()); - request.setRequestTimestamp(getObjectExtended.getTimestamp()); - request.setSignature(getObjectExtended.getSignature()); - request.setBucketName(getObjectExtended.getBucket()); - request.setKey(getObjectExtended.getKey()); - request.setReturnData(getObjectExtended.getGetData()); - request.setReturnMetadata(getObjectExtended.getGetMetadata()); - request.setInlineData(getObjectExtended.getInlineData()); - - S3ConditionalHeaders conds = new S3ConditionalHeaders(); - conds.setModifiedSince(getObjectExtended.getIfModifiedSince()); - conds.setUnModifiedSince(getObjectExtended.getIfUnmodifiedSince()); - conds.setMatch(getObjectExtended.getIfMatch()); - conds.setNoneMatch(getObjectExtended.getIfNoneMatch()); - request.setConditions(conds); - - request.setByteRangeStart(getObjectExtended.getByteRangeStart()); - request.setByteRangeEnd(getObjectExtended.getByteRangeEnd()); - request.setReturnCompleteObjectOnConditionFailure(getObjectExtended.getReturnCompleteObjectOnConditionFailure()); - return request; - } - - private GetObjectResponse toGetObjectResponse(S3GetObjectResponse engineResponse) { - GetObjectResponse response = new GetObjectResponse(); - int resultCode = engineResponse.getResultCode(); - - GetObjectResult result = new GetObjectResult(); - Status param1 = new Status(); - param1.setCode( resultCode); - param1.setDescription( engineResponse.getResultDescription()); - result.setStatus( param1 ); - - if ( 200 == resultCode ) - { - result.setData(engineResponse.getData()); - result.setETag( engineResponse.getETag()); - result.setMetadata(toMetadataEntry(engineResponse.getMetaEntries())); - result.setLastModified( engineResponse.getLastModified()); - } - else - { result.setETag( "" ); - result.setLastModified( Calendar.getInstance()); - } - - response.setGetObjectResponse(result); - return response; - } - - private GetObjectExtendedResponse toGetObjectExtendedResponse(S3GetObjectResponse engineResponse) { - GetObjectExtendedResponse response = new GetObjectExtendedResponse(); - int resultCode = engineResponse.getResultCode(); - - GetObjectResult result = new GetObjectResult(); - Status param1 = new Status(); - param1.setCode( resultCode ); - param1.setDescription( engineResponse.getResultDescription()); - result.setStatus( param1 ); - - if ( 200 == resultCode || 206 == resultCode ) - { - result.setData(engineResponse.getData()); - result.setETag( engineResponse.getETag()); - result.setMetadata(toMetadataEntry(engineResponse.getMetaEntries())); - result.setLastModified( engineResponse.getLastModified()); - } - else - { result.setETag( "" ); - result.setLastModified( Calendar.getInstance()); - } - - response.setGetObjectResponse(result); - return response; - } - - private MetadataEntry[] toMetadataEntry(S3MetaDataEntry[] engineEntries) { - if(engineEntries != null) { - MetadataEntry[] entries = new MetadataEntry[engineEntries.length]; - for(int i = 0; i < engineEntries.length; i++) { - entries[i] = new MetadataEntry(); - entries[i].setName(engineEntries[i].getName()); - entries[i].setValue(engineEntries[i].getValue()); - } - return entries; - } - return null; - } - - public GetObjectAccessControlPolicyResponse getObjectAccessControlPolicy( - GetObjectAccessControlPolicy getObjectAccessControlPolicy) { - return toGetObjectAccessControlPolicyResponse(engine.handleRequest( - toEngineGetObjectAccessControlPolicyRequest(getObjectAccessControlPolicy))); - } - - private S3GetObjectAccessControlPolicyRequest toEngineGetObjectAccessControlPolicyRequest( - GetObjectAccessControlPolicy getObjectAccessControlPolicy) { - S3GetObjectAccessControlPolicyRequest request = new S3GetObjectAccessControlPolicyRequest(); - - request.setAccessKey(getObjectAccessControlPolicy.getAWSAccessKeyId()); - request.setRequestTimestamp(getObjectAccessControlPolicy.getTimestamp()); - request.setSignature(getObjectAccessControlPolicy.getSignature()); - request.setBucketName(getObjectAccessControlPolicy.getBucket()); - request.setKey(getObjectAccessControlPolicy.getKey()); - return request; - } - - public static GetObjectAccessControlPolicyResponse toGetObjectAccessControlPolicyResponse(S3AccessControlPolicy policy) { - GetObjectAccessControlPolicyResponse response = new GetObjectAccessControlPolicyResponse(); - response.setGetObjectAccessControlPolicyResponse(toAccessControlPolicy(policy)); - return response; - } - - private static AccessControlPolicy toAccessControlPolicy(S3AccessControlPolicy enginePolicy) { - AccessControlPolicy policy = new AccessControlPolicy(); - CanonicalUser owner = new CanonicalUser(); - owner.setID(enginePolicy.getOwner().getID()); - owner.setDisplayName(enginePolicy.getOwner().getDisplayName()); - policy.setOwner(owner); - - AccessControlList acl = new AccessControlList(); - acl.setGrant(toGrants(enginePolicy.getGrants())); - policy.setAccessControlList(acl); - return policy; - } - - public DeleteObjectResponse deleteObject (DeleteObject deleteObject) { - return toDeleteObjectResponse(engine.handleRequest(toEngineDeleteObjectRequest(deleteObject))); - } - - private S3DeleteObjectRequest toEngineDeleteObjectRequest(DeleteObject deleteObject) { - S3DeleteObjectRequest request = new S3DeleteObjectRequest(); - request.setAccessKey(deleteObject.getAWSAccessKeyId()); - request.setRequestTimestamp(deleteObject.getTimestamp()); - request.setSignature(deleteObject.getSignature()); - request.setBucketName(deleteObject.getBucket()); - request.setKey(deleteObject.getKey()); - return request; - } - - private DeleteObjectResponse toDeleteObjectResponse(S3Response engineResponse) { - DeleteObjectResponse response = new DeleteObjectResponse(); - Status status = new Status(); - status.setCode(engineResponse.getResultCode()); - status.setDescription(engineResponse.getResultDescription()); - response.setDeleteObjectResponse(status); - return response; - } - - public SetObjectAccessControlPolicyResponse setObjectAccessControlPolicy(SetObjectAccessControlPolicy setObjectAccessControlPolicy) - { - S3SetObjectAccessControlPolicyRequest request = new S3SetObjectAccessControlPolicyRequest(); - request.setAccessKey(setObjectAccessControlPolicy.getAWSAccessKeyId()); - request.setRequestTimestamp(setObjectAccessControlPolicy.getTimestamp()); - request.setSignature(setObjectAccessControlPolicy.getSignature()); - request.setBucketName(setObjectAccessControlPolicy.getBucket()); - request.setKey(setObjectAccessControlPolicy.getKey()); - request.setAcl(toEngineAccessControlList(setObjectAccessControlPolicy.getAccessControlList())); - - engine.handleRequest(request); - SetObjectAccessControlPolicyResponse response = new SetObjectAccessControlPolicyResponse(); - return response; - } - - public PutObjectInlineResponse putObjectInline (PutObjectInline putObjectInline) { - return toPutObjectInlineResponse(engine.handleRequest(toEnginePutObjectInlineRequest(putObjectInline))); - } - - private S3PutObjectInlineRequest toEnginePutObjectInlineRequest(PutObjectInline putObjectInline) { - S3PutObjectInlineRequest request = new S3PutObjectInlineRequest(); - request.setAccessKey(putObjectInline.getAWSAccessKeyId()); - request.setRequestTimestamp(putObjectInline.getTimestamp()); - request.setSignature(putObjectInline.getSignature()); - request.setBucketName(putObjectInline.getBucket()); - request.setContentLength(putObjectInline.getContentLength()); - request.setKey(putObjectInline.getKey()); - request.setData(putObjectInline.getData()); - request.setMetaEntries(toEngineMetaEntries(putObjectInline.getMetadata())); - request.setAcl(toEngineAccessControlList(putObjectInline.getAccessControlList())); - return request; - } - - private S3MetaDataEntry[] toEngineMetaEntries(MetadataEntry[] metaEntries) { - if(metaEntries != null) { - S3MetaDataEntry[] engineMetaEntries = new S3MetaDataEntry[metaEntries.length]; - for(int i = 0; i < metaEntries.length; i++) { - engineMetaEntries[i] = new S3MetaDataEntry(); - engineMetaEntries[i].setName(metaEntries[i].getName()); - engineMetaEntries[i].setValue(metaEntries[i].getValue()); - } - return engineMetaEntries; - } - return null; - } - - private S3AccessControlList toEngineAccessControlList(AccessControlList acl) - { - if (acl == null) return null; - - S3AccessControlList engineAcl = new S3AccessControlList(); - - Grant[] grants = acl.getGrant(); - if (grants != null) - { - for (Grant grant: grants) - { - S3Grant engineGrant = new S3Grant(); - - Grantee grantee = grant.getGrantee(); - if (grantee instanceof CanonicalUser) - { - engineGrant.setGrantee(SAcl.GRANTEE_USER); - engineGrant.setCanonicalUserID(((CanonicalUser)grantee).getID()); - } - else if (grantee instanceof Group) - { - Group temp = (Group)grantee; - String uri = temp.getURI(); - if ( uri.equalsIgnoreCase( "http://acs.amazonaws.com/groups/global/AllUsers" )) { - // -> this allows all public unauthenticated access based on permission given - engineGrant.setGrantee(SAcl.GRANTEE_ALLUSERS); - engineGrant.setCanonicalUserID( "*" ); - } - else if (uri.equalsIgnoreCase( "http://acs.amazonaws.com/groups/global/Authenticated" )) { - // -> this allows any authenticated user access based on permission given - engineGrant.setGrantee(SAcl.GRANTEE_AUTHENTICATED); - engineGrant.setCanonicalUserID( "A" ); - } - else throw new UnsupportedOperationException("Unsupported grantee group URI: " + uri ); - - } - else throw new UnsupportedOperationException("Unsupported grantee type: " + grantee.getClass().getCanonicalName()); - - Permission permission = grant.getPermission(); - String permissionValue = permission.getValue(); - if(permissionValue.equalsIgnoreCase("READ")) { - engineGrant.setPermission(SAcl.PERMISSION_READ); - } else if(permissionValue.equalsIgnoreCase("WRITE")) { - engineGrant.setPermission(SAcl.PERMISSION_WRITE); - } else if(permissionValue.equalsIgnoreCase("READ_ACP")) { - engineGrant.setPermission(SAcl.PERMISSION_READ_ACL); - } else if(permissionValue.equalsIgnoreCase("WRITE_ACP")) { - engineGrant.setPermission(SAcl.PERMISSION_WRITE_ACL); - } else if(permissionValue.equalsIgnoreCase("FULL_CONTROL")) { - engineGrant.setPermission(SAcl.PERMISSION_FULL); - } else { - throw new UnsupportedOperationException("Unsupported permission: " + permissionValue); - } - engineAcl.addGrant(engineGrant); - } - } - return engineAcl; - } - - private static Grant[] toGrants(S3Grant[] engineGrants) { - Grantee grantee = null; - Grant[] grants = null; - - if (engineGrants != null && 0 < engineGrants.length) - { - grants = new Grant[engineGrants.length]; - for(int i = 0; i < engineGrants.length; i++) - { - grants[i] = new Grant(); - - switch( engineGrants[i].getGrantee()) { - case SAcl.GRANTEE_USER : - grantee = new CanonicalUser(); - ((CanonicalUser)grantee).setID(engineGrants[i].getCanonicalUserID()); - ((CanonicalUser)grantee).setDisplayName("TODO"); - grants[i].setGrantee(grantee); - break; - - case SAcl.GRANTEE_ALLUSERS: - grantee = new Group(); - ((Group)grantee).setURI( "http://acs.amazonaws.com/groups/global/AllUsers" ); - grants[i].setGrantee(grantee); - break; - - case SAcl.GRANTEE_AUTHENTICATED: - grantee = new Group(); - ((Group)grantee).setURI( "http://acs.amazonaws.com/groups/global/Authenticated" ); - grants[i].setGrantee(grantee); - break; - - default : - throw new InternalErrorException("Unsupported grantee type"); - } - - - switch( engineGrants[i].getPermission()) { - case SAcl.PERMISSION_READ: grants[i].setPermission(Permission.READ); break; - case SAcl.PERMISSION_WRITE: grants[i].setPermission(Permission.WRITE); break; - case SAcl.PERMISSION_READ_ACL: grants[i].setPermission(Permission.READ_ACP); break; - case SAcl.PERMISSION_WRITE_ACL: grants[i].setPermission(Permission.WRITE_ACP); break; - case SAcl.PERMISSION_FULL: grants[i].setPermission(Permission.FULL_CONTROL); break; - } - } - return grants; - } - return null; - } - - private PutObjectInlineResponse toPutObjectInlineResponse(S3PutObjectInlineResponse engineResponse) { - PutObjectInlineResponse response = new PutObjectInlineResponse(); - - PutObjectResult result = new PutObjectResult(); - result.setETag(engineResponse.getETag()); - result.setLastModified(engineResponse.getLastModified()); - response.setPutObjectInlineResponse(result); - return response; - } - - public static CopyObjectResponse toCopyObjectResponse(S3CopyObjectResponse engineResponse) throws AxisFault { - CopyObjectResponse response = new CopyObjectResponse(); - int resultCode = engineResponse.getResultCode(); - - CopyObjectResult result = new CopyObjectResult(); - if ( 300 <= resultCode ) - { - String description = engineResponse.getResultDescription(); - throw new AxisFault( "" + resultCode, (null == description ? "" : description)); - } - - result.setETag( "\"" + engineResponse.getETag() + "\"" ); - result.setLastModified(engineResponse.getLastModified()); - response.setCopyObjectResult(result); - return response; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.controller.s3; + +import java.util.Calendar; + +import org.apache.axis2.AxisFault; +import org.apache.log4j.Logger; + +import com.amazon.s3.AccessControlList; +import com.amazon.s3.AccessControlPolicy; +import com.amazon.s3.AmazonS3SkeletonInterface; +import com.amazon.s3.CanonicalUser; +import com.amazon.s3.CopyObject; +import com.amazon.s3.CopyObjectResult; +import com.amazon.s3.Group; +import com.amazon.s3.CopyObjectResponse; +import com.amazon.s3.CreateBucket; +import com.amazon.s3.CreateBucketResponse; +import com.amazon.s3.CreateBucketResult; +import com.amazon.s3.DeleteBucket; +import com.amazon.s3.DeleteBucketResponse; +import com.amazon.s3.DeleteObject; +import com.amazon.s3.DeleteObjectResponse; +import com.amazon.s3.GetBucketAccessControlPolicy; +import com.amazon.s3.GetBucketAccessControlPolicyResponse; +import com.amazon.s3.GetBucketLoggingStatus; +import com.amazon.s3.GetBucketLoggingStatusResponse; +import com.amazon.s3.GetObject; +import com.amazon.s3.GetObjectAccessControlPolicy; +import com.amazon.s3.GetObjectAccessControlPolicyResponse; +import com.amazon.s3.GetObjectExtended; +import com.amazon.s3.GetObjectExtendedResponse; +import com.amazon.s3.GetObjectResponse; +import com.amazon.s3.GetObjectResult; +import com.amazon.s3.Grant; +import com.amazon.s3.Grantee; +import com.amazon.s3.ListAllMyBuckets; +import com.amazon.s3.ListAllMyBucketsEntry; +import com.amazon.s3.ListAllMyBucketsList; +import com.amazon.s3.ListAllMyBucketsResponse; +import com.amazon.s3.ListAllMyBucketsResult; +import com.amazon.s3.ListBucket; +import com.amazon.s3.ListBucketResponse; +import com.amazon.s3.ListBucketResult; +import com.amazon.s3.ListEntry; +import com.amazon.s3.MetadataDirective; +import com.amazon.s3.MetadataEntry; +import com.amazon.s3.Permission; +import com.amazon.s3.PrefixEntry; +import com.amazon.s3.PutObject; +import com.amazon.s3.PutObjectInline; +import com.amazon.s3.PutObjectInlineResponse; +import com.amazon.s3.PutObjectResponse; +import com.amazon.s3.PutObjectResult; +import com.amazon.s3.SetBucketAccessControlPolicy; +import com.amazon.s3.SetBucketAccessControlPolicyResponse; +import com.amazon.s3.SetBucketLoggingStatus; +import com.amazon.s3.SetBucketLoggingStatusResponse; +import com.amazon.s3.SetObjectAccessControlPolicy; +import com.amazon.s3.SetObjectAccessControlPolicyResponse; +import com.amazon.s3.Status; +import com.amazon.s3.StorageClass; +import com.cloud.bridge.model.SAcl; +import com.cloud.bridge.service.core.s3.S3AccessControlList; +import com.cloud.bridge.service.core.s3.S3AccessControlPolicy; +import com.cloud.bridge.service.core.s3.S3CanonicalUser; +import com.cloud.bridge.service.core.s3.S3ConditionalHeaders; +import com.cloud.bridge.service.core.s3.S3CopyObjectRequest; +import com.cloud.bridge.service.core.s3.S3CopyObjectResponse; +import com.cloud.bridge.service.core.s3.S3CreateBucketRequest; +import com.cloud.bridge.service.core.s3.S3CreateBucketResponse; +import com.cloud.bridge.service.core.s3.S3DeleteBucketRequest; +import com.cloud.bridge.service.core.s3.S3DeleteObjectRequest; +import com.cloud.bridge.service.core.s3.S3Engine; +import com.cloud.bridge.service.core.s3.S3GetBucketAccessControlPolicyRequest; +import com.cloud.bridge.service.core.s3.S3GetObjectAccessControlPolicyRequest; +import com.cloud.bridge.service.core.s3.S3GetObjectRequest; +import com.cloud.bridge.service.core.s3.S3GetObjectResponse; +import com.cloud.bridge.service.core.s3.S3Grant; +import com.cloud.bridge.service.core.s3.S3ListAllMyBucketsEntry; +import com.cloud.bridge.service.core.s3.S3ListAllMyBucketsRequest; +import com.cloud.bridge.service.core.s3.S3ListAllMyBucketsResponse; +import com.cloud.bridge.service.core.s3.S3ListBucketObjectEntry; +import com.cloud.bridge.service.core.s3.S3ListBucketPrefixEntry; +import com.cloud.bridge.service.core.s3.S3ListBucketRequest; +import com.cloud.bridge.service.core.s3.S3ListBucketResponse; +import com.cloud.bridge.service.core.s3.S3MetaDataEntry; +import com.cloud.bridge.service.core.s3.S3PutObjectInlineRequest; +import com.cloud.bridge.service.core.s3.S3PutObjectInlineResponse; +import com.cloud.bridge.service.core.s3.S3Response; +import com.cloud.bridge.service.core.s3.S3SetBucketAccessControlPolicyRequest; +import com.cloud.bridge.service.core.s3.S3SetObjectAccessControlPolicyRequest; +import com.cloud.bridge.service.exception.InternalErrorException; + +/* @Author Kelven Yang, John Zucker + * Implementation of S3 service requests as operations defined by the interface, com.amazon.s3.AmazonS3SkeletonInterface. + * The operations dispatched from this class are of the form of SOAP operations which define business logic to be executed by the request. + * The methods required for S3 services in accordance with the skeleton are either implementations of the following + * getBucketLoggingStatus + * copyObject + * getBucketAccessControlPolicy + * listBucket + * putObject + * createBucket + * listAllMyBuckets + * getObject + * deleteBucket + * setBucketLoggingStatus + * getObjectAccessControlPolicy + * deleteObject + * setBucketAccessControlPolicy + * setObjectAccessControlPolicy + * putObjectInline + * getObjectExtended + * or throw and Axis2 fault otherwise. + * These skeleton methods can be used as the implementation of services to satisfy SOAP calls, but also to provide the output + * to be serialized by the AXIOM XML processor. + * + * */ + +public class S3SerializableServiceImplementation implements AmazonS3SkeletonInterface { + protected final static Logger logger = Logger.getLogger(S3SerializableServiceImplementation.class); + + private S3Engine engine; + + public S3SerializableServiceImplementation(S3Engine engine) { + this.engine = engine; + } + + public GetBucketLoggingStatusResponse getBucketLoggingStatus( + GetBucketLoggingStatus getBucketLoggingStatus) { + throw new UnsupportedOperationException("Unsupported API"); + } + + public SetBucketLoggingStatusResponse setBucketLoggingStatus(SetBucketLoggingStatus setBucketLoggingStatus) { + throw new UnsupportedOperationException("Unsupported API"); + } + + public CopyObjectResponse copyObject(CopyObject copyObject) throws AxisFault { + S3CopyObjectRequest request = new S3CopyObjectRequest(); + + request.setSourceBucketName(copyObject.getSourceBucket()); + request.setSourceKey(copyObject.getSourceKey()); + request.setDestinationBucketName(copyObject.getDestinationBucket()); + request.setDestinationKey(copyObject.getDestinationKey()); + + MetadataDirective mdd = copyObject.getMetadataDirective(); + if (null != mdd) request.setDataDirective(mdd.getValue()); + + request.setMetaEntries(toEngineMetaEntries(copyObject.getMetadata())); + request.setAcl(toEngineAccessControlList(copyObject.getAccessControlList())); + + S3ConditionalHeaders conds = new S3ConditionalHeaders(); + conds.setModifiedSince(copyObject.getCopySourceIfModifiedSince()); + conds.setUnModifiedSince(copyObject.getCopySourceIfUnmodifiedSince()); + conds.setMatch(copyObject.getCopySourceIfMatch()); + conds.setNoneMatch(copyObject.getCopySourceIfNoneMatch()); + request.setConditions(conds); + + return toCopyObjectResponse(engine.handleRequest(request)); + } + + public GetBucketAccessControlPolicyResponse getBucketAccessControlPolicy( + GetBucketAccessControlPolicy getBucketAccessControlPolicy) { + // TODO - after authentication, we should setup user context + return toGetBucketAccessControlPolicyResponse(engine.handleRequest( + toEngineGetBucketAccessControlPolicyRequest(getBucketAccessControlPolicy))); + } + + private S3GetBucketAccessControlPolicyRequest toEngineGetBucketAccessControlPolicyRequest( + GetBucketAccessControlPolicy getBucketAccessControlPolicy) { + S3GetBucketAccessControlPolicyRequest request = new S3GetBucketAccessControlPolicyRequest(); + + request.setAccessKey(getBucketAccessControlPolicy.getAWSAccessKeyId()); + request.setRequestTimestamp(getBucketAccessControlPolicy.getTimestamp()); + request.setSignature(getBucketAccessControlPolicy.getSignature()); + request.setBucketName(getBucketAccessControlPolicy.getBucket()); + return request; + } + + public static GetBucketAccessControlPolicyResponse toGetBucketAccessControlPolicyResponse(S3AccessControlPolicy policy) { + GetBucketAccessControlPolicyResponse response = new GetBucketAccessControlPolicyResponse(); + response.setGetBucketAccessControlPolicyResponse(toAccessControlPolicy(policy)); + return response; + } + + public SetBucketAccessControlPolicyResponse setBucketAccessControlPolicy(SetBucketAccessControlPolicy setBucketAccessControlPolicy) { + S3SetBucketAccessControlPolicyRequest request = new S3SetBucketAccessControlPolicyRequest(); + request.setAccessKey(setBucketAccessControlPolicy.getAWSAccessKeyId()); + request.setRequestTimestamp(setBucketAccessControlPolicy.getTimestamp()); + request.setSignature(setBucketAccessControlPolicy.getSignature()); + request.setBucketName(setBucketAccessControlPolicy.getBucket()); + request.setAcl(toEngineAccessControlList(setBucketAccessControlPolicy.getAccessControlList())); + + SetBucketAccessControlPolicyResponse response = new SetBucketAccessControlPolicyResponse(); + return response; + } + + public ListBucketResponse listBucket (ListBucket listBucket) { + // after authentication, we should setup user context + return toListBucketResponse(engine.listBucketContents(toEngineListBucketRequest(listBucket), false)); + } + + private S3ListBucketRequest toEngineListBucketRequest(ListBucket listBucket) { + S3ListBucketRequest request = new S3ListBucketRequest(); + + request.setAccessKey(listBucket.getAWSAccessKeyId()); + request.setRequestTimestamp(listBucket.getTimestamp()); + request.setSignature(listBucket.getSignature()); + + request.setBucketName(listBucket.getBucket()); + request.setDelimiter(listBucket.getDelimiter()); + request.setMarker(listBucket.getMarker()); + request.setMaxKeys(listBucket.getMaxKeys()); + request.setPrefix(listBucket.getPrefix()); + return request; + } + + public static ListBucketResponse toListBucketResponse(S3ListBucketResponse engineResponse) { + ListBucketResponse response = new ListBucketResponse(); + ListBucketResult result = new ListBucketResult(); + result.setName(engineResponse.getBucketName()); + result.setDelimiter(engineResponse.getDelimiter()); + result.setPrefix(engineResponse.getPrefix()); + result.setMarker(engineResponse.getMarker()); + result.setMaxKeys(engineResponse.getMaxKeys()); + result.setIsTruncated(engineResponse.isTruncated()); + result.setNextMarker(engineResponse.getNextMarker()); + result.setCommonPrefixes(toPrefixEntry(engineResponse.getCommonPrefixes())); + result.setContents(toListEntry(engineResponse.getContents())); + response.setListBucketResponse(result); + return response; + } + + private static PrefixEntry[] toPrefixEntry(S3ListBucketPrefixEntry[] engineEntries) { + if(engineEntries != null) { + PrefixEntry[] entries = new PrefixEntry[engineEntries.length]; + for(int i = 0; i < engineEntries.length; i++) { + entries[i] = new PrefixEntry(); + entries[i].setPrefix(engineEntries[i].getPrefix()); + } + + return entries; + } + return null; + } + + private static ListEntry[] toListEntry(S3ListBucketObjectEntry[] engineEntries) { + if(engineEntries != null) { + ListEntry[] entries = new ListEntry[engineEntries.length]; + for(int i = 0; i < engineEntries.length; i++) { + entries[i] = new ListEntry(); + entries[i].setETag(engineEntries[i].getETag()); + entries[i].setKey(engineEntries[i].getKey()); + entries[i].setLastModified(engineEntries[i].getLastModified()); + entries[i].setSize(engineEntries[i].getSize()); + entries[i].setStorageClass(StorageClass.STANDARD); + + CanonicalUser owner = new CanonicalUser(); + owner.setID(engineEntries[i].getOwnerCanonicalId()); + owner.setDisplayName(engineEntries[i].getOwnerDisplayName()); + entries[i].setOwner(owner); + } + return entries; + } + + return null; + } + + public PutObjectResponse putObject(PutObject putObject) { + //TODO : fill this with the necessary business logic + throw new UnsupportedOperationException("Please implement " + this.getClass().getName() + "#putObject"); + } + + public CreateBucketResponse createBucket (CreateBucket createBucket) { + return toCreateBucketResponse(engine.handleRequest(toEngineCreateBucketRequest(createBucket))); + } + + private S3CreateBucketRequest toEngineCreateBucketRequest(CreateBucket createBucket) { + S3CreateBucketRequest request = new S3CreateBucketRequest(); + request.setAccessKey(createBucket.getAWSAccessKeyId()); + request.setRequestTimestamp(createBucket.getTimestamp()); + request.setSignature(createBucket.getSignature()); + request.setBucketName(createBucket.getBucket()); + request.setAcl(toEngineAccessControlList(createBucket.getAccessControlList())); + return request; + } + + private CreateBucketResponse toCreateBucketResponse(S3CreateBucketResponse engineResponse) { + CreateBucketResponse response = new CreateBucketResponse(); + CreateBucketResult result = new CreateBucketResult(); + result.setBucketName(engineResponse.getBucketName()); + response.setCreateBucketReturn(result); + return response; + } + + public ListAllMyBucketsResponse listAllMyBuckets (ListAllMyBuckets listAllMyBuckets) { + return toListAllMyBucketsResponse(engine.handleRequest(toEngineListAllMyBucketsRequest(listAllMyBuckets))); + } + + private S3ListAllMyBucketsRequest toEngineListAllMyBucketsRequest(ListAllMyBuckets listAllMyBuckets) { + S3ListAllMyBucketsRequest request = new S3ListAllMyBucketsRequest(); + request.setAccessKey(listAllMyBuckets.getAWSAccessKeyId()); + request.setRequestTimestamp(listAllMyBuckets.getTimestamp()); + request.setSignature(listAllMyBuckets.getSignature()); + return request; + } + + public static ListAllMyBucketsResponse toListAllMyBucketsResponse(S3ListAllMyBucketsResponse engineResponse) { + ListAllMyBucketsResponse response = new ListAllMyBucketsResponse(); + ListAllMyBucketsResult result = new ListAllMyBucketsResult(); + ListAllMyBucketsEntry[] entries = null; + + S3CanonicalUser ownerEngine = engineResponse.getOwner(); + CanonicalUser owner = new CanonicalUser(); + owner.setID(ownerEngine.getID()); + owner.setDisplayName(ownerEngine.getDisplayName()); + result.setOwner(owner); + S3ListAllMyBucketsEntry[] engineEntries = engineResponse.getBuckets(); + if (engineEntries != null) { + entries = new ListAllMyBucketsEntry[engineEntries.length]; + for(int i = 0; i < engineEntries.length; i++) { + entries[i] = new ListAllMyBucketsEntry(); + entries[i].setName(engineEntries[i].getName()); + entries[i].setCreationDate(engineEntries[i].getCreationDate()); //setTimeZone(TimeZone.getTimeZone("Z")); + } + + ListAllMyBucketsList list = new ListAllMyBucketsList(); + list.setBucket(entries); + result.setBuckets(list); + } + response.setListAllMyBucketsResponse(result); + return response; + } + + public DeleteBucketResponse deleteBucket(DeleteBucket deleteBucket) { + return toDeleteBucketResponse(engine.handleRequest(toEngineDeleteBucketRequest(deleteBucket))); + } + + private S3DeleteBucketRequest toEngineDeleteBucketRequest(DeleteBucket deleteBucket) { + S3DeleteBucketRequest request = new S3DeleteBucketRequest(); + request.setAccessKey(deleteBucket.getAWSAccessKeyId()); + request.setRequestTimestamp(deleteBucket.getTimestamp()); + request.setSignature(deleteBucket.getSignature()); + request.setBucketName(deleteBucket.getBucket()); + return request; + } + + private DeleteBucketResponse toDeleteBucketResponse(S3Response engineResponse) { + DeleteBucketResponse response = new DeleteBucketResponse(); + Status status = new Status(); + status.setCode(engineResponse.getResultCode()); + status.setDescription(engineResponse.getResultDescription()); + response.setDeleteBucketResponse(status); + return response; + } + + public GetObjectResponse getObject(com.amazon.s3.GetObject getObject) { + return toGetObjectResponse(engine.handleRequest(toEngineGetObjectRequest(getObject))); + } + + public GetObjectExtendedResponse getObjectExtended(GetObjectExtended getObjectExtended) { + return toGetObjectExtendedResponse(engine.handleRequest(toEngineGetObjectRequest(getObjectExtended))); + } + + private S3GetObjectRequest toEngineGetObjectRequest(GetObject getObject) + { + S3GetObjectRequest request = new S3GetObjectRequest(); + + request.setAccessKey(getObject.getAWSAccessKeyId()); + request.setRequestTimestamp(getObject.getTimestamp()); + request.setSignature(getObject.getSignature()); + request.setBucketName(getObject.getBucket()); + request.setKey(getObject.getKey()); + request.setReturnData(getObject.getGetData()); + request.setReturnMetadata(getObject.getGetMetadata()); + request.setInlineData(getObject.getInlineData()); + return request; + } + + private S3GetObjectRequest toEngineGetObjectRequest(GetObjectExtended getObjectExtended) { + S3GetObjectRequest request = new S3GetObjectRequest(); + request.setAccessKey(getObjectExtended.getAWSAccessKeyId()); + request.setRequestTimestamp(getObjectExtended.getTimestamp()); + request.setSignature(getObjectExtended.getSignature()); + request.setBucketName(getObjectExtended.getBucket()); + request.setKey(getObjectExtended.getKey()); + request.setReturnData(getObjectExtended.getGetData()); + request.setReturnMetadata(getObjectExtended.getGetMetadata()); + request.setInlineData(getObjectExtended.getInlineData()); + + S3ConditionalHeaders conds = new S3ConditionalHeaders(); + conds.setModifiedSince(getObjectExtended.getIfModifiedSince()); + conds.setUnModifiedSince(getObjectExtended.getIfUnmodifiedSince()); + conds.setMatch(getObjectExtended.getIfMatch()); + conds.setNoneMatch(getObjectExtended.getIfNoneMatch()); + request.setConditions(conds); + + request.setByteRangeStart(getObjectExtended.getByteRangeStart()); + request.setByteRangeEnd(getObjectExtended.getByteRangeEnd()); + request.setReturnCompleteObjectOnConditionFailure(getObjectExtended.getReturnCompleteObjectOnConditionFailure()); + return request; + } + + private GetObjectResponse toGetObjectResponse(S3GetObjectResponse engineResponse) { + GetObjectResponse response = new GetObjectResponse(); + int resultCode = engineResponse.getResultCode(); + + GetObjectResult result = new GetObjectResult(); + Status param1 = new Status(); + param1.setCode( resultCode); + param1.setDescription( engineResponse.getResultDescription()); + result.setStatus( param1 ); + + if ( 200 == resultCode ) + { + result.setData(engineResponse.getData()); + result.setETag( engineResponse.getETag()); + result.setMetadata(toMetadataEntry(engineResponse.getMetaEntries())); + result.setLastModified( engineResponse.getLastModified()); + } + else + { result.setETag( "" ); + result.setLastModified( Calendar.getInstance()); + } + + response.setGetObjectResponse(result); + return response; + } + + private GetObjectExtendedResponse toGetObjectExtendedResponse(S3GetObjectResponse engineResponse) { + GetObjectExtendedResponse response = new GetObjectExtendedResponse(); + int resultCode = engineResponse.getResultCode(); + + GetObjectResult result = new GetObjectResult(); + Status param1 = new Status(); + param1.setCode( resultCode ); + param1.setDescription( engineResponse.getResultDescription()); + result.setStatus( param1 ); + + if ( 200 == resultCode || 206 == resultCode ) + { + result.setData(engineResponse.getData()); + result.setETag( engineResponse.getETag()); + result.setMetadata(toMetadataEntry(engineResponse.getMetaEntries())); + result.setLastModified( engineResponse.getLastModified()); + } + else + { result.setETag( "" ); + result.setLastModified( Calendar.getInstance()); + } + + response.setGetObjectResponse(result); + return response; + } + + private MetadataEntry[] toMetadataEntry(S3MetaDataEntry[] engineEntries) { + if(engineEntries != null) { + MetadataEntry[] entries = new MetadataEntry[engineEntries.length]; + for(int i = 0; i < engineEntries.length; i++) { + entries[i] = new MetadataEntry(); + entries[i].setName(engineEntries[i].getName()); + entries[i].setValue(engineEntries[i].getValue()); + } + return entries; + } + return null; + } + + public GetObjectAccessControlPolicyResponse getObjectAccessControlPolicy( + GetObjectAccessControlPolicy getObjectAccessControlPolicy) { + return toGetObjectAccessControlPolicyResponse(engine.handleRequest( + toEngineGetObjectAccessControlPolicyRequest(getObjectAccessControlPolicy))); + } + + private S3GetObjectAccessControlPolicyRequest toEngineGetObjectAccessControlPolicyRequest( + GetObjectAccessControlPolicy getObjectAccessControlPolicy) { + S3GetObjectAccessControlPolicyRequest request = new S3GetObjectAccessControlPolicyRequest(); + + request.setAccessKey(getObjectAccessControlPolicy.getAWSAccessKeyId()); + request.setRequestTimestamp(getObjectAccessControlPolicy.getTimestamp()); + request.setSignature(getObjectAccessControlPolicy.getSignature()); + request.setBucketName(getObjectAccessControlPolicy.getBucket()); + request.setKey(getObjectAccessControlPolicy.getKey()); + return request; + } + + public static GetObjectAccessControlPolicyResponse toGetObjectAccessControlPolicyResponse(S3AccessControlPolicy policy) { + GetObjectAccessControlPolicyResponse response = new GetObjectAccessControlPolicyResponse(); + response.setGetObjectAccessControlPolicyResponse(toAccessControlPolicy(policy)); + return response; + } + + private static AccessControlPolicy toAccessControlPolicy(S3AccessControlPolicy enginePolicy) { + AccessControlPolicy policy = new AccessControlPolicy(); + CanonicalUser owner = new CanonicalUser(); + owner.setID(enginePolicy.getOwner().getID()); + owner.setDisplayName(enginePolicy.getOwner().getDisplayName()); + policy.setOwner(owner); + + AccessControlList acl = new AccessControlList(); + acl.setGrant(toGrants(enginePolicy.getGrants())); + policy.setAccessControlList(acl); + return policy; + } + + public DeleteObjectResponse deleteObject (DeleteObject deleteObject) { + return toDeleteObjectResponse(engine.handleRequest(toEngineDeleteObjectRequest(deleteObject))); + } + + private S3DeleteObjectRequest toEngineDeleteObjectRequest(DeleteObject deleteObject) { + S3DeleteObjectRequest request = new S3DeleteObjectRequest(); + request.setAccessKey(deleteObject.getAWSAccessKeyId()); + request.setRequestTimestamp(deleteObject.getTimestamp()); + request.setSignature(deleteObject.getSignature()); + request.setBucketName(deleteObject.getBucket()); + request.setKey(deleteObject.getKey()); + return request; + } + + private DeleteObjectResponse toDeleteObjectResponse(S3Response engineResponse) { + DeleteObjectResponse response = new DeleteObjectResponse(); + Status status = new Status(); + status.setCode(engineResponse.getResultCode()); + status.setDescription(engineResponse.getResultDescription()); + response.setDeleteObjectResponse(status); + return response; + } + + public SetObjectAccessControlPolicyResponse setObjectAccessControlPolicy(SetObjectAccessControlPolicy setObjectAccessControlPolicy) + { + S3SetObjectAccessControlPolicyRequest request = new S3SetObjectAccessControlPolicyRequest(); + request.setAccessKey(setObjectAccessControlPolicy.getAWSAccessKeyId()); + request.setRequestTimestamp(setObjectAccessControlPolicy.getTimestamp()); + request.setSignature(setObjectAccessControlPolicy.getSignature()); + request.setBucketName(setObjectAccessControlPolicy.getBucket()); + request.setKey(setObjectAccessControlPolicy.getKey()); + request.setAcl(toEngineAccessControlList(setObjectAccessControlPolicy.getAccessControlList())); + + engine.handleRequest(request); + SetObjectAccessControlPolicyResponse response = new SetObjectAccessControlPolicyResponse(); + return response; + } + + public PutObjectInlineResponse putObjectInline (PutObjectInline putObjectInline) { + return toPutObjectInlineResponse(engine.handleRequest(toEnginePutObjectInlineRequest(putObjectInline))); + } + + private S3PutObjectInlineRequest toEnginePutObjectInlineRequest(PutObjectInline putObjectInline) { + S3PutObjectInlineRequest request = new S3PutObjectInlineRequest(); + request.setAccessKey(putObjectInline.getAWSAccessKeyId()); + request.setRequestTimestamp(putObjectInline.getTimestamp()); + request.setSignature(putObjectInline.getSignature()); + request.setBucketName(putObjectInline.getBucket()); + request.setContentLength(putObjectInline.getContentLength()); + request.setKey(putObjectInline.getKey()); + request.setData(putObjectInline.getData()); + request.setMetaEntries(toEngineMetaEntries(putObjectInline.getMetadata())); + request.setAcl(toEngineAccessControlList(putObjectInline.getAccessControlList())); + return request; + } + + private S3MetaDataEntry[] toEngineMetaEntries(MetadataEntry[] metaEntries) { + if(metaEntries != null) { + S3MetaDataEntry[] engineMetaEntries = new S3MetaDataEntry[metaEntries.length]; + for(int i = 0; i < metaEntries.length; i++) { + engineMetaEntries[i] = new S3MetaDataEntry(); + engineMetaEntries[i].setName(metaEntries[i].getName()); + engineMetaEntries[i].setValue(metaEntries[i].getValue()); + } + return engineMetaEntries; + } + return null; + } + + private S3AccessControlList toEngineAccessControlList(AccessControlList acl) + { + if (acl == null) return null; + + S3AccessControlList engineAcl = new S3AccessControlList(); + + Grant[] grants = acl.getGrant(); + if (grants != null) + { + for (Grant grant: grants) + { + S3Grant engineGrant = new S3Grant(); + + Grantee grantee = grant.getGrantee(); + if (grantee instanceof CanonicalUser) + { + engineGrant.setGrantee(SAcl.GRANTEE_USER); + engineGrant.setCanonicalUserID(((CanonicalUser)grantee).getID()); + } + else if (grantee instanceof Group) + { + Group temp = (Group)grantee; + String uri = temp.getURI(); + if ( uri.equalsIgnoreCase( "http://acs.amazonaws.com/groups/global/AllUsers" )) { + // -> this allows all public unauthenticated access based on permission given + engineGrant.setGrantee(SAcl.GRANTEE_ALLUSERS); + engineGrant.setCanonicalUserID( "*" ); + } + else if (uri.equalsIgnoreCase( "http://acs.amazonaws.com/groups/global/Authenticated" )) { + // -> this allows any authenticated user access based on permission given + engineGrant.setGrantee(SAcl.GRANTEE_AUTHENTICATED); + engineGrant.setCanonicalUserID( "A" ); + } + else throw new UnsupportedOperationException("Unsupported grantee group URI: " + uri ); + + } + else throw new UnsupportedOperationException("Unsupported grantee type: " + grantee.getClass().getCanonicalName()); + + Permission permission = grant.getPermission(); + String permissionValue = permission.getValue(); + if(permissionValue.equalsIgnoreCase("READ")) { + engineGrant.setPermission(SAcl.PERMISSION_READ); + } else if(permissionValue.equalsIgnoreCase("WRITE")) { + engineGrant.setPermission(SAcl.PERMISSION_WRITE); + } else if(permissionValue.equalsIgnoreCase("READ_ACP")) { + engineGrant.setPermission(SAcl.PERMISSION_READ_ACL); + } else if(permissionValue.equalsIgnoreCase("WRITE_ACP")) { + engineGrant.setPermission(SAcl.PERMISSION_WRITE_ACL); + } else if(permissionValue.equalsIgnoreCase("FULL_CONTROL")) { + engineGrant.setPermission(SAcl.PERMISSION_FULL); + } else { + throw new UnsupportedOperationException("Unsupported permission: " + permissionValue); + } + engineAcl.addGrant(engineGrant); + } + } + return engineAcl; + } + + private static Grant[] toGrants(S3Grant[] engineGrants) { + Grantee grantee = null; + Grant[] grants = null; + + if (engineGrants != null && 0 < engineGrants.length) + { + grants = new Grant[engineGrants.length]; + for(int i = 0; i < engineGrants.length; i++) + { + grants[i] = new Grant(); + + switch( engineGrants[i].getGrantee()) { + case SAcl.GRANTEE_USER : + grantee = new CanonicalUser(); + ((CanonicalUser)grantee).setID(engineGrants[i].getCanonicalUserID()); + ((CanonicalUser)grantee).setDisplayName("TODO"); + grants[i].setGrantee(grantee); + break; + + case SAcl.GRANTEE_ALLUSERS: + grantee = new Group(); + ((Group)grantee).setURI( "http://acs.amazonaws.com/groups/global/AllUsers" ); + grants[i].setGrantee(grantee); + break; + + case SAcl.GRANTEE_AUTHENTICATED: + grantee = new Group(); + ((Group)grantee).setURI( "http://acs.amazonaws.com/groups/global/Authenticated" ); + grants[i].setGrantee(grantee); + break; + + default : + throw new InternalErrorException("Unsupported grantee type"); + } + + + switch( engineGrants[i].getPermission()) { + case SAcl.PERMISSION_READ: grants[i].setPermission(Permission.READ); break; + case SAcl.PERMISSION_WRITE: grants[i].setPermission(Permission.WRITE); break; + case SAcl.PERMISSION_READ_ACL: grants[i].setPermission(Permission.READ_ACP); break; + case SAcl.PERMISSION_WRITE_ACL: grants[i].setPermission(Permission.WRITE_ACP); break; + case SAcl.PERMISSION_FULL: grants[i].setPermission(Permission.FULL_CONTROL); break; + } + } + return grants; + } + return null; + } + + private PutObjectInlineResponse toPutObjectInlineResponse(S3PutObjectInlineResponse engineResponse) { + PutObjectInlineResponse response = new PutObjectInlineResponse(); + + PutObjectResult result = new PutObjectResult(); + result.setETag(engineResponse.getETag()); + result.setLastModified(engineResponse.getLastModified()); + response.setPutObjectInlineResponse(result); + return response; + } + + public static CopyObjectResponse toCopyObjectResponse(S3CopyObjectResponse engineResponse) throws AxisFault { + CopyObjectResponse response = new CopyObjectResponse(); + int resultCode = engineResponse.getResultCode(); + + CopyObjectResult result = new CopyObjectResult(); + if ( 300 <= resultCode ) + { + String description = engineResponse.getResultDescription(); + throw new AxisFault( "" + resultCode, (null == description ? "" : description)); + } + + result.setETag( "\"" + engineResponse.getETag() + "\"" ); + result.setLastModified(engineResponse.getLastModified()); + response.setCopyObjectResult(result); + return response; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/controller/s3/ServiceProvider.java b/awsapi/src/com/cloud/bridge/service/controller/s3/ServiceProvider.java index 18acb1a9ca3..b44a88e0384 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/ServiceProvider.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/ServiceProvider.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved * diff --git a/awsapi/src/com/cloud/bridge/service/controller/s3/ServletAction.java b/awsapi/src/com/cloud/bridge/service/controller/s3/ServletAction.java index 14c898c5f88..50cfbc330f6 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/ServletAction.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/ServletAction.java @@ -1,29 +1,45 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.controller.s3; - -import java.io.IOException; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.stream.XMLStreamException; - -/** - * @author Kelven Yang - */ -public interface ServletAction { - void execute(HttpServletRequest request, HttpServletResponse response) throws IOException, XMLStreamException; -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.controller.s3; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.xml.stream.XMLStreamException; + +/** + * @author Kelven Yang + */ +public interface ServletAction { + void execute(HttpServletRequest request, HttpServletResponse response) throws IOException, XMLStreamException; +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/Account.java b/awsapi/src/com/cloud/bridge/service/core/ec2/Account.java index 5d5a94da506..3e662107655 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/Account.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/Account.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; public class Account { diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/DiskOffer.java b/awsapi/src/com/cloud/bridge/service/core/ec2/DiskOffer.java index 6aebe7a7bd5..96102c96839 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/DiskOffer.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/DiskOffer.java @@ -1,82 +1,98 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.Calendar; - -import com.cloud.bridge.util.EC2RestAuth; - -public class DiskOffer { - - private String id; - private String name; - private int diskSize; // <- in gigs - private Calendar created; - private boolean isCustomized; // <- true if disk offering uses custom size - - public DiskOffer() { - id = null; - name = null; - diskSize = 0; - created = null; - isCustomized = false; - } - - public void setId( String id ) { - this.id = id; - } - - public String getId() { - return this.id; - } - - public void setName( String name ) { - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setSize( String diskSize ) { - if ( null != diskSize ) { - // -> convert from number of bytes into the number of gigabytes - long bytes = Long.parseLong( diskSize ); - if (0 != bytes) this.diskSize = (int)(bytes / 1073741824); - } - else this.diskSize = 0; - } - - public int getSize() { - return this.diskSize; - } - - public void setCreated( String created ) { - this.created = EC2RestAuth.parseDateString( created ); - } - - public Calendar getCreated() { - return this.created; - } - - public boolean getIsCustomized(){ - return this.isCustomized; - } - - public void setIsCustomized( boolean isCustomized ) { - this.isCustomized = isCustomized; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.Calendar; + +import com.cloud.bridge.util.EC2RestAuth; + +public class DiskOffer { + + private String id; + private String name; + private int diskSize; // <- in gigs + private Calendar created; + private boolean isCustomized; // <- true if disk offering uses custom size + + public DiskOffer() { + id = null; + name = null; + diskSize = 0; + created = null; + isCustomized = false; + } + + public void setId( String id ) { + this.id = id; + } + + public String getId() { + return this.id; + } + + public void setName( String name ) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void setSize( String diskSize ) { + if ( null != diskSize ) { + // -> convert from number of bytes into the number of gigabytes + long bytes = Long.parseLong( diskSize ); + if (0 != bytes) this.diskSize = (int)(bytes / 1073741824); + } + else this.diskSize = 0; + } + + public int getSize() { + return this.diskSize; + } + + public void setCreated( String created ) { + this.created = EC2RestAuth.parseDateString( created ); + } + + public Calendar getCreated() { + return this.created; + } + + public boolean getIsCustomized(){ + return this.isCustomized; + } + + public void setIsCustomized( boolean isCustomized ) { + this.isCustomized = isCustomized; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/DiskOfferings.java b/awsapi/src/com/cloud/bridge/service/core/ec2/DiskOfferings.java index 01dc8ed2b5f..47e313c4aac 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/DiskOfferings.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/DiskOfferings.java @@ -1,35 +1,51 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class DiskOfferings { - - private List offerSet = new ArrayList(); - - public DiskOfferings() { - } - - public void addOffer( DiskOffer param ) { - offerSet.add( param ); - } - - public DiskOffer[] getOfferSet() { - return offerSet.toArray(new DiskOffer[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class DiskOfferings { + + private List offerSet = new ArrayList(); + + public DiskOfferings() { + } + + public void addOffer( DiskOffer param ) { + offerSet.add( param ); + } + + public DiskOffer[] getOfferSet() { + return offerSet.toArray(new DiskOffer[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Address.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Address.java index 99a50715bcb..313d6244354 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Address.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Address.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AddressFilterSet.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AddressFilterSet.java index f4f45550563..6a930bd3591 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AddressFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AddressFilterSet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AssociateAddress.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AssociateAddress.java index bdbddda1c30..c176d4a3d55 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AssociateAddress.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AssociateAddress.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AuthorizeRevokeSecurityGroup.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AuthorizeRevokeSecurityGroup.java index 25ec649b8c2..50db3320156 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AuthorizeRevokeSecurityGroup.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AuthorizeRevokeSecurityGroup.java @@ -1,30 +1,46 @@ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2AuthorizeRevokeSecurityGroup { - - private String name; - private List permissionSet = new ArrayList(); // a list of permissions to be removed from the group - - public EC2AuthorizeRevokeSecurityGroup() { - name = null; - } - - public void setName( String name ) { - this.name = name; - } - - public String getName() { - return this.name; - } - - public void addIpPermission( EC2IpPermission param ) { - permissionSet.add( param ); - } - - public EC2IpPermission[] getIpPermissionSet() { - return permissionSet.toArray(new EC2IpPermission[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2AuthorizeRevokeSecurityGroup { + + private String name; + private List permissionSet = new ArrayList(); // a list of permissions to be removed from the group + + public EC2AuthorizeRevokeSecurityGroup() { + name = null; + } + + public void setName( String name ) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void addIpPermission( EC2IpPermission param ) { + permissionSet.add( param ); + } + + public EC2IpPermission[] getIpPermissionSet() { + return permissionSet.toArray(new EC2IpPermission[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AvailabilityZonesFilterSet.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AvailabilityZonesFilterSet.java index 793af89deca..b4d4bd36b66 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AvailabilityZonesFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2AvailabilityZonesFilterSet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateImage.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateImage.java index 43f12fc27ef..f98fe7ab20e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateImage.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateImage.java @@ -1,53 +1,69 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -public class EC2CreateImage { - - private String instanceId; - private String name; - private String description; - - public EC2CreateImage() { - instanceId = null; - name = null; - description = null; - } - - public void setInstanceId( String instanceId ) { - this.instanceId = instanceId; - } - - public String getInstanceId() { - return this.instanceId; - } - - public void setName( String name ) { - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setDescription( String description ) { - this.description = description; - } - - public String getDescription() { - return this.description; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +public class EC2CreateImage { + + private String instanceId; + private String name; + private String description; + + public EC2CreateImage() { + instanceId = null; + name = null; + description = null; + } + + public void setInstanceId( String instanceId ) { + this.instanceId = instanceId; + } + + public String getInstanceId() { + return this.instanceId; + } + + public void setName( String name ) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void setDescription( String description ) { + this.description = description; + } + + public String getDescription() { + return this.description; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateImageResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateImageResponse.java index 80d56d0c6d9..868786bb8f0 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateImageResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateImageResponse.java @@ -1,33 +1,49 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -public class EC2CreateImageResponse { - - private String id; - - public EC2CreateImageResponse() { - id = null; - } - - public void setId( String id ) { - this.id = id; - } - - public String getId() { - return this.id; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +public class EC2CreateImageResponse { + + private String id; + + public EC2CreateImageResponse() { + id = null; + } + + public void setId( String id ) { + this.id = id; + } + + public String getId() { + return this.id; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateKeyPair.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateKeyPair.java index 036fadbdc0b..07068926177 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateKeyPair.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateKeyPair.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateVolume.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateVolume.java index 95ab69d5d0f..cba0b01d11a 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateVolume.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2CreateVolume.java @@ -1,76 +1,92 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.service.exception.EC2ServiceException; - - -public class EC2CreateVolume { - protected final static Logger logger = Logger.getLogger(EC2CreateVolume.class); - - private Long size; // <- in gigs - private String snapshotId; - private String zoneName; - - public EC2CreateVolume() { - snapshotId = null; - zoneName = null; - size = null; - } - - /** - * Define the size of the volume to create - * - * @param size - valid values are [1 .. 1024] and represent gigBytes - */ - public void setSize(String size) - { - if (null == size) return; // size is an optional parameter - - try { - this.size = Long.parseLong(size); - } - catch(NumberFormatException e) { - logger.error("Bad volume Size parameter: ", e); - throw new EC2ServiceException( "Bad volume size parameter: " + size + ", expecting [1..1024]", 400 ); - } - - if (!(1 <= this.size && 1024 >= this.size)) - throw new EC2ServiceException( "Bad volume size parameter: " + size + ", expecting [1..1024]", 400 ); - } - - public Long getSize() { - return this.size; - } - - public void setSnapshotId(String snapshotId ) { - this.snapshotId = snapshotId; - } - - public String getSnapshotId() { - return this.snapshotId; - } - - public void setZoneName( String zoneName ) { - this.zoneName = zoneName; - } - - public String getZoneName() { - return this.zoneName; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.service.exception.EC2ServiceException; + + +public class EC2CreateVolume { + protected final static Logger logger = Logger.getLogger(EC2CreateVolume.class); + + private Long size; // <- in gigs + private String snapshotId; + private String zoneName; + + public EC2CreateVolume() { + snapshotId = null; + zoneName = null; + size = null; + } + + /** + * Define the size of the volume to create + * + * @param size - valid values are [1 .. 1024] and represent gigBytes + */ + public void setSize(String size) + { + if (null == size) return; // size is an optional parameter + + try { + this.size = Long.parseLong(size); + } + catch(NumberFormatException e) { + logger.error("Bad volume Size parameter: ", e); + throw new EC2ServiceException( "Bad volume size parameter: " + size + ", expecting [1..1024]", 400 ); + } + + if (!(1 <= this.size && 1024 >= this.size)) + throw new EC2ServiceException( "Bad volume size parameter: " + size + ", expecting [1..1024]", 400 ); + } + + public Long getSize() { + return this.size; + } + + public void setSnapshotId(String snapshotId ) { + this.snapshotId = snapshotId; + } + + public String getSnapshotId() { + return this.snapshotId; + } + + public void setZoneName( String zoneName ) { + this.zoneName = zoneName; + } + + public String getZoneName() { + return this.zoneName; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DeleteKeyPair.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DeleteKeyPair.java index df3482f6271..02ee7d368ee 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DeleteKeyPair.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DeleteKeyPair.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddresses.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddresses.java index b1177a62c0a..4cf2b87b8ce 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddresses.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddresses.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddressesResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddressesResponse.java index 94e678adba9..361df225932 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddressesResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAddressesResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAvailabilityZones.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAvailabilityZones.java index d463b64402b..447872b6b7f 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAvailabilityZones.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAvailabilityZones.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeAvailabilityZones { - - private List zoneSet = new ArrayList(); // a list of strings identifying zones +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeAvailabilityZones { + + private List zoneSet = new ArrayList(); // a list of strings identifying zones private EC2AvailabilityZonesFilterSet azfs = null; - - public EC2DescribeAvailabilityZones() { - } - - public void addZone( String param ) { - zoneSet.add( param ); - } - - public String[] getZoneSet() { - return zoneSet.toArray(new String[0]); - } + + public EC2DescribeAvailabilityZones() { + } + + public void addZone( String param ) { + zoneSet.add( param ); + } + + public String[] getZoneSet() { + return zoneSet.toArray(new String[0]); + } public EC2AvailabilityZonesFilterSet getFilterSet() { return azfs; @@ -42,4 +58,4 @@ public class EC2DescribeAvailabilityZones { azfs = param; } -} +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAvailabilityZonesResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAvailabilityZonesResponse.java index b05daa8b3ee..5ca3d8c229e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAvailabilityZonesResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeAvailabilityZonesResponse.java @@ -1,49 +1,65 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeAvailabilityZonesResponse { - - private List zoneIds = new ArrayList(); - private List zoneNames = new ArrayList(); - - public EC2DescribeAvailabilityZonesResponse() { - } - - public void addZone(String id, String name) { - zoneIds.add(id); - zoneNames.add(name); - } - - /** - * The Amazon API only cares about the names of zones not their ID value. - * - * @return an array containing a set of zone names - */ - public String[] getZoneSet() { - return zoneNames.toArray(new String[0]); - } - - public String getZoneIdAt(int index) { - if (zoneIds.isEmpty() || index >= zoneIds.size()) { - return null; - } - return zoneIds.get(index); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeAvailabilityZonesResponse { + + private List zoneIds = new ArrayList(); + private List zoneNames = new ArrayList(); + + public EC2DescribeAvailabilityZonesResponse() { + } + + public void addZone(String id, String name) { + zoneIds.add(id); + zoneNames.add(name); + } + + /** + * The Amazon API only cares about the names of zones not their ID value. + * + * @return an array containing a set of zone names + */ + public String[] getZoneSet() { + return zoneNames.toArray(new String[0]); + } + + public String getZoneIdAt(int index) { + if (zoneIds.isEmpty() || index >= zoneIds.size()) { + return null; + } + return zoneIds.get(index); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImageAttribute.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImageAttribute.java index 3ccb35ab245..39db585e3ec 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImageAttribute.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImageAttribute.java @@ -1,46 +1,62 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - - - -import com.cloud.bridge.service.core.ec2.EC2ImageAttributes.ImageAttribute; - -public class EC2DescribeImageAttribute { - - private String imageId = null; //AMI id - private ImageAttribute attribute = null; - - public EC2DescribeImageAttribute() { - } - - public void setAttribute(ImageAttribute attribute) { - this.attribute = attribute; - } - - public ImageAttribute getAttribute() { - return attribute; - } - - public void setImageId(String imageId) { - this.imageId = imageId; - } - - public String getImageId() { - return imageId; - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + + + +import com.cloud.bridge.service.core.ec2.EC2ImageAttributes.ImageAttribute; + +public class EC2DescribeImageAttribute { + + private String imageId = null; //AMI id + private ImageAttribute attribute = null; + + public EC2DescribeImageAttribute() { + } + + public void setAttribute(ImageAttribute attribute) { + this.attribute = attribute; + } + + public ImageAttribute getAttribute() { + return attribute; + } + + public void setImageId(String imageId) { + this.imageId = imageId; + } + + public String getImageId() { + return imageId; + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImages.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImages.java index a327e8ab4f4..563af92ad59 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImages.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImages.java @@ -1,53 +1,69 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeImages { - - private List executableBySet = new ArrayList();; // a list of strings identifying users - private List imageSet = new ArrayList(); // a list of AMI id's - private List ownersSet = new ArrayList(); // a list of AMI owner id's - - public EC2DescribeImages() { - } - - public void addExecutableBySet( String param ) { - executableBySet.add( param ); - } - - public String[] getExcutableBySet() { - return executableBySet.toArray(new String[0]); - } - - public void addImageSet( String param ) { - imageSet.add( param ); - } - - public String[] getImageSet() { - return imageSet.toArray(new String[0]); - } - - public void addOwnersSet( String param ) { - ownersSet.add( param ); - } - - public String[] getOwnersSet() { - return ownersSet.toArray(new String[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeImages { + + private List executableBySet = new ArrayList();; // a list of strings identifying users + private List imageSet = new ArrayList(); // a list of AMI id's + private List ownersSet = new ArrayList(); // a list of AMI owner id's + + public EC2DescribeImages() { + } + + public void addExecutableBySet( String param ) { + executableBySet.add( param ); + } + + public String[] getExcutableBySet() { + return executableBySet.toArray(new String[0]); + } + + public void addImageSet( String param ) { + imageSet.add( param ); + } + + public String[] getImageSet() { + return imageSet.toArray(new String[0]); + } + + public void addOwnersSet( String param ) { + ownersSet.add( param ); + } + + public String[] getOwnersSet() { + return ownersSet.toArray(new String[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImagesResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImagesResponse.java index 0aa13108ca2..33bfab4d645 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImagesResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeImagesResponse.java @@ -1,35 +1,51 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeImagesResponse { - - private List imageSet = new ArrayList(); - - public EC2DescribeImagesResponse() { - } - - public void addImage( EC2Image param ) { - imageSet.add( param ); - } - - public EC2Image[] getImageSet() { - return imageSet.toArray(new EC2Image[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeImagesResponse { + + private List imageSet = new ArrayList(); + + public EC2DescribeImagesResponse() { + } + + public void addImage( EC2Image param ) { + imageSet.add( param ); + } + + public EC2Image[] getImageSet() { + return imageSet.toArray(new EC2Image[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeInstances.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeInstances.java index 887008075c6..b88a65b1dff 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeInstances.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeInstances.java @@ -1,44 +1,60 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeInstances { - - private List instancesSet = new ArrayList(); // a list of strings identifying instances - private EC2InstanceFilterSet ifs = null; - - public EC2DescribeInstances() { - } - - public void addInstanceId( String param ) { - instancesSet.add( param ); - } - - public String[] getInstancesSet() { - return instancesSet.toArray(new String[0]); - } - - public EC2InstanceFilterSet getFilterSet() { - return ifs; - } - - public void setFilterSet( EC2InstanceFilterSet param ) { - ifs = param; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeInstances { + + private List instancesSet = new ArrayList(); // a list of strings identifying instances + private EC2InstanceFilterSet ifs = null; + + public EC2DescribeInstances() { + } + + public void addInstanceId( String param ) { + instancesSet.add( param ); + } + + public String[] getInstancesSet() { + return instancesSet.toArray(new String[0]); + } + + public EC2InstanceFilterSet getFilterSet() { + return ifs; + } + + public void setFilterSet( EC2InstanceFilterSet param ) { + ifs = param; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeInstancesResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeInstancesResponse.java index 11a89bc9537..f381072f698 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeInstancesResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeInstancesResponse.java @@ -1,35 +1,51 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeInstancesResponse { - - private List instanceSet = new ArrayList(); - - public EC2DescribeInstancesResponse() { - } - - public void addInstance( EC2Instance param ) { - instanceSet.add( param ); - } - - public EC2Instance[] getInstanceSet() { - return instanceSet.toArray(new EC2Instance[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeInstancesResponse { + + private List instanceSet = new ArrayList(); + + public EC2DescribeInstancesResponse() { + } + + public void addInstance( EC2Instance param ) { + instanceSet.add( param ); + } + + public EC2Instance[] getInstanceSet() { + return instanceSet.toArray(new EC2Instance[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairs.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairs.java index 69e4bcbea41..d18234127f1 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairs.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairs.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairsResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairsResponse.java index 2a594b1c069..7a2dbabb65c 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairsResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeKeyPairsResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSecurityGroups.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSecurityGroups.java index ea3c6c90eef..95741d1812b 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSecurityGroups.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSecurityGroups.java @@ -1,29 +1,45 @@ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeSecurityGroups { - - private List groupSet = new ArrayList(); // a list of strings identifying each group - private EC2GroupFilterSet gfs = null; - - public EC2DescribeSecurityGroups() { - } - - public void addGroupName( String param ) { - groupSet.add( param ); - } - - public String[] getGroupSet() { - return groupSet.toArray(new String[0]); - } - - public EC2GroupFilterSet getFilterSet() { - return gfs; - } - - public void setFilterSet( EC2GroupFilterSet param ) { - gfs = param; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeSecurityGroups { + + private List groupSet = new ArrayList(); // a list of strings identifying each group + private EC2GroupFilterSet gfs = null; + + public EC2DescribeSecurityGroups() { + } + + public void addGroupName( String param ) { + groupSet.add( param ); + } + + public String[] getGroupSet() { + return groupSet.toArray(new String[0]); + } + + public EC2GroupFilterSet getFilterSet() { + return gfs; + } + + public void setFilterSet( EC2GroupFilterSet param ) { + gfs = param; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSecurityGroupsResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSecurityGroupsResponse.java index 20e4572142b..aab67cf3976 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSecurityGroupsResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSecurityGroupsResponse.java @@ -1,20 +1,36 @@ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeSecurityGroupsResponse { - - private List groupSet = new ArrayList(); - - public EC2DescribeSecurityGroupsResponse() { - } - - public void addGroup( EC2SecurityGroup param ) { - groupSet.add( param ); - } - - public EC2SecurityGroup[] getGroupSet() { - return groupSet.toArray(new EC2SecurityGroup[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeSecurityGroupsResponse { + + private List groupSet = new ArrayList(); + + public EC2DescribeSecurityGroupsResponse() { + } + + public void addGroup( EC2SecurityGroup param ) { + groupSet.add( param ); + } + + public EC2SecurityGroup[] getGroupSet() { + return groupSet.toArray(new EC2SecurityGroup[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSnapshots.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSnapshots.java index 8208da3c4be..71f0bac716e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSnapshots.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSnapshots.java @@ -1,44 +1,60 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeSnapshots { - - private List snapshotSet = new ArrayList(); // a list of strings identifying snapshots - private EC2SnapshotFilterSet sfs = null; - - public EC2DescribeSnapshots() { - } - - public void addSnapshotId( String param ) { - snapshotSet.add( param ); - } - - public String[] getSnapshotSet() { - return snapshotSet.toArray(new String[0]); - } - - public EC2SnapshotFilterSet getFilterSet() { - return sfs; - } - - public void setFilterSet( EC2SnapshotFilterSet param ) { - sfs = param; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeSnapshots { + + private List snapshotSet = new ArrayList(); // a list of strings identifying snapshots + private EC2SnapshotFilterSet sfs = null; + + public EC2DescribeSnapshots() { + } + + public void addSnapshotId( String param ) { + snapshotSet.add( param ); + } + + public String[] getSnapshotSet() { + return snapshotSet.toArray(new String[0]); + } + + public EC2SnapshotFilterSet getFilterSet() { + return sfs; + } + + public void setFilterSet( EC2SnapshotFilterSet param ) { + sfs = param; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSnapshotsResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSnapshotsResponse.java index c418e903c44..09512a3835b 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSnapshotsResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeSnapshotsResponse.java @@ -1,35 +1,51 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeSnapshotsResponse { - - private List snapshotSet = new ArrayList(); - - public EC2DescribeSnapshotsResponse() { - } - - public void addSnapshot( EC2Snapshot param ) { - snapshotSet.add( param ); - } - - public EC2Snapshot[] getSnapshotSet() { - return snapshotSet.toArray(new EC2Snapshot[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeSnapshotsResponse { + + private List snapshotSet = new ArrayList(); + + public EC2DescribeSnapshotsResponse() { + } + + public void addSnapshot( EC2Snapshot param ) { + snapshotSet.add( param ); + } + + public EC2Snapshot[] getSnapshotSet() { + return snapshotSet.toArray(new EC2Snapshot[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeVolumes.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeVolumes.java index a61b5ab60e0..0a810156bd3 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeVolumes.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeVolumes.java @@ -1,44 +1,60 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeVolumes { - - private List volumeSet = new ArrayList(); // a list of strings identifying volume ids - private EC2VolumeFilterSet vfs = null; - - public EC2DescribeVolumes() { - } - - public void addVolumeId( String param ) { - volumeSet.add( param ); - } - - public String[] getVolumeSet() { - return volumeSet.toArray(new String[0]); - } - - public EC2VolumeFilterSet getFilterSet() { - return vfs; - } - - public void setFilterSet( EC2VolumeFilterSet param ) { - vfs = param; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeVolumes { + + private List volumeSet = new ArrayList(); // a list of strings identifying volume ids + private EC2VolumeFilterSet vfs = null; + + public EC2DescribeVolumes() { + } + + public void addVolumeId( String param ) { + volumeSet.add( param ); + } + + public String[] getVolumeSet() { + return volumeSet.toArray(new String[0]); + } + + public EC2VolumeFilterSet getFilterSet() { + return vfs; + } + + public void setFilterSet( EC2VolumeFilterSet param ) { + vfs = param; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeVolumesResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeVolumesResponse.java index e7adbe7d75c..60b450370f4 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeVolumesResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DescribeVolumesResponse.java @@ -1,39 +1,55 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2DescribeVolumesResponse { - - private List volumeSet = new ArrayList(); - - public EC2DescribeVolumesResponse() { - } - - public void reset() { - volumeSet.clear(); - } - - public void addVolume( EC2Volume param ) { - volumeSet.add( param ); - } - - public EC2Volume[] getVolumeSet() { - return volumeSet.toArray(new EC2Volume[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2DescribeVolumesResponse { + + private List volumeSet = new ArrayList(); + + public EC2DescribeVolumesResponse() { + } + + public void reset() { + volumeSet.clear(); + } + + public void addVolume( EC2Volume param ) { + volumeSet.add( param ); + } + + public EC2Volume[] getVolumeSet() { + return volumeSet.toArray(new EC2Volume[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DisassociateAddress.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DisassociateAddress.java index 785a9fae592..23f833b7705 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DisassociateAddress.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2DisassociateAddress.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java index 3c14b893a9d..b15cb7b3915 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Filter.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Filter.java index 6e7c3a3a67d..d729be4ed7a 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Filter.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Filter.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2GroupFilterSet.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2GroupFilterSet.java index 7d291d35336..69c8e0fa17e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2GroupFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2GroupFilterSet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Image.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Image.java index f823c3f46ea..b011a5170d2 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Image.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Image.java @@ -1,107 +1,123 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -/** - * An EC2 Image is a Cloud template. - */ -public class EC2Image { - - private String id; - private String name; - private String description; - private String osTypeId; - private boolean isPublic; - private boolean isReady; - private String accountName; - private String domainId; - - public EC2Image() { - id = null; - name = null; - description = null; - osTypeId = null; - isPublic = false; - isReady = false; - accountName = null; - domainId = null; - } - - public void setId( String id ) { - this.id = id; - } - - public String getId() { - return this.id; - } - - public void setName( String name ) { - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setDescription( String description ) { - this.description = description; - } - - public String getDescription() { - return this.description; - } - - public void setOsTypeId( String osTypeId ) { - this.osTypeId = osTypeId; - } - - public String getOsTypeId() { - return this.osTypeId; - } - - public void setIsPublic( boolean isPublic ) { - this.isPublic = isPublic; - } - - public boolean getIsPublic() { - return this.isPublic; - } - - public void setIsReady( boolean isReady ) { - this.isReady = isReady; - } - - public boolean getIsReady() { - return this.isReady; - } - - public String getAccountName() { - return accountName; - } - - public void setAccountName(String accountName) { - this.accountName = accountName; - } - - public String getDomainId() { - return domainId; - } - - public void setDomainId(String domainId) { - this.domainId = domainId; - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +/** + * An EC2 Image is a Cloud template. + */ +public class EC2Image { + + private String id; + private String name; + private String description; + private String osTypeId; + private boolean isPublic; + private boolean isReady; + private String accountName; + private String domainId; + + public EC2Image() { + id = null; + name = null; + description = null; + osTypeId = null; + isPublic = false; + isReady = false; + accountName = null; + domainId = null; + } + + public void setId( String id ) { + this.id = id; + } + + public String getId() { + return this.id; + } + + public void setName( String name ) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void setDescription( String description ) { + this.description = description; + } + + public String getDescription() { + return this.description; + } + + public void setOsTypeId( String osTypeId ) { + this.osTypeId = osTypeId; + } + + public String getOsTypeId() { + return this.osTypeId; + } + + public void setIsPublic( boolean isPublic ) { + this.isPublic = isPublic; + } + + public boolean getIsPublic() { + return this.isPublic; + } + + public void setIsReady( boolean isReady ) { + this.isReady = isReady; + } + + public boolean getIsReady() { + return this.isReady; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ImageAttributes.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ImageAttributes.java index 5444c85e0f9..c0897900547 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ImageAttributes.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ImageAttributes.java @@ -1,86 +1,102 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.List; - -public class EC2ImageAttributes { - - private String imageId; - private String description; - private boolean isPublic; - private List accountNamesWithLaunchPermission; - private String domainId; - - public enum ImageAttribute{ - description, - launchPermission, - kernel, - ramdisk, - productCodes, - blockDeviceMapping - }; - - public EC2ImageAttributes() { - imageId = null; - description = null; - isPublic = false; - accountNamesWithLaunchPermission= null; - domainId = null; - } - - public void setImageId( String imageId ) { - this.imageId = imageId; - } - - public String getImageId() { - return this.imageId; - } - - public void setDescription( String description ) { - this.description = description; - } - - public String getDescription() { - return this.description; - } - - public void setIsPublic( boolean isPublic ) { - this.isPublic = isPublic; - } - - public boolean getIsPublic() { - return this.isPublic; - } - - - public String getDomainId() { - return domainId; - } - - public void setDomainId(String domainId) { - this.domainId = domainId; - } - - public void setAccountNamesWithLaunchPermission(List accountNamesWithLaunchPermission) { - this.accountNamesWithLaunchPermission = accountNamesWithLaunchPermission; - } - - public List getAccountNamesWithLaunchPermission() { - return accountNamesWithLaunchPermission; - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.List; + +public class EC2ImageAttributes { + + private String imageId; + private String description; + private boolean isPublic; + private List accountNamesWithLaunchPermission; + private String domainId; + + public enum ImageAttribute{ + description, + launchPermission, + kernel, + ramdisk, + productCodes, + blockDeviceMapping + }; + + public EC2ImageAttributes() { + imageId = null; + description = null; + isPublic = false; + accountNamesWithLaunchPermission= null; + domainId = null; + } + + public void setImageId( String imageId ) { + this.imageId = imageId; + } + + public String getImageId() { + return this.imageId; + } + + public void setDescription( String description ) { + this.description = description; + } + + public String getDescription() { + return this.description; + } + + public void setIsPublic( boolean isPublic ) { + this.isPublic = isPublic; + } + + public boolean getIsPublic() { + return this.isPublic; + } + + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + public void setAccountNamesWithLaunchPermission(List accountNamesWithLaunchPermission) { + this.accountNamesWithLaunchPermission = accountNamesWithLaunchPermission; + } + + public List getAccountNamesWithLaunchPermission() { + return accountNamesWithLaunchPermission; + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ImportKeyPair.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ImportKeyPair.java index cdf0473cbdf..1e9b1b653a2 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ImportKeyPair.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ImportKeyPair.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Instance.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Instance.java index f015f6ac910..65306258aca 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Instance.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Instance.java @@ -1,200 +1,216 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; - -import com.cloud.bridge.util.EC2RestAuth; - -public class EC2Instance { - - private String id; - private String name; - private String zoneName; - private String templateId; - private String group; - private String state; - private String previousState; - private String ipAddress; - private String privateIpAddress; - private String instanceType; - private Calendar created; - private String accountName; - private String domainId; - private String hypervisor; - private String rootDeviceType; - private String rootDeviceId; - private List groupSet; - - public EC2Instance() { - id = null; - name = null; - zoneName = null; - templateId = null; - group = null; - state = null; - previousState = null; - ipAddress = null; - privateIpAddress = null; - created = null; - instanceType = null; - accountName = null; - domainId = null; - hypervisor = null; - rootDeviceType = null; - rootDeviceId = null; - groupSet = new ArrayList(); - } - - public void setId( String id ) { - this.id = id; - } - - public String getId() { - return this.id; - } - - public void setName( String name ) { - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setZoneName( String zoneName ) { - this.zoneName = zoneName; - } - - public String getZoneName() { - return this.zoneName; - } - - public void setTemplateId( String templateId ) { - this.templateId = templateId; - } - - public String getTemplateId() { - return this.templateId; - } - - public void setGroup( String group ) { - this.group = group; - } - - public String getGroup() { - return this.group; - } - - public void setState( String state ) { - this.state = state; - } - - public String getState() { - return this.state; - } - - public void setPreviousState( String state ) { - this.previousState = state; - } - - public String getPreviousState() { - return this.previousState; - } - - public void setCreated( String created ) { - this.created = EC2RestAuth.parseDateString( created ); - } - - public Calendar getCreated() { - return this.created; - } - - public void setIpAddress( String ipAddress ) { - this.ipAddress = ipAddress; - } - - public String getIpAddress() { - return this.ipAddress; - } - - public void setPrivateIpAddress( String ipAddress ) { - this.privateIpAddress = ipAddress; - } - - public String getPrivateIpAddress() { - return this.privateIpAddress; - } - - public void setServiceOffering( String instanceType ) { - this.instanceType = instanceType; - } - - public String getServiceOffering() { - return this.instanceType; - } - - public String getAccountName() { - return accountName; - } - - public void setAccountName(String accountName) { - this.accountName = accountName; - } - - public String getDomainId() { - return domainId; - } - - public void setDomainId(String domainId) { - this.domainId = domainId; - } - - public String getHypervisor() { - return hypervisor; - } - - public void setHypervisor(String param) { - hypervisor = param; - } - - public String getRootDeviceType() { - return rootDeviceType; - } - - public void setRootDeviceType(String param) { - rootDeviceType = param; - } - - public String getRootDeviceId() { - return rootDeviceId; - } - - public void setRootDeviceId(String param) { - rootDeviceId = param; - } - - public void addGroupName( String param ) { - groupSet.add( param ); - } - - public String[] getGroupSet() { - return groupSet.toArray(new String[0]); - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import com.cloud.bridge.util.EC2RestAuth; + +public class EC2Instance { + + private String id; + private String name; + private String zoneName; + private String templateId; + private String group; + private String state; + private String previousState; + private String ipAddress; + private String privateIpAddress; + private String instanceType; + private Calendar created; + private String accountName; + private String domainId; + private String hypervisor; + private String rootDeviceType; + private String rootDeviceId; + private List groupSet; + + public EC2Instance() { + id = null; + name = null; + zoneName = null; + templateId = null; + group = null; + state = null; + previousState = null; + ipAddress = null; + privateIpAddress = null; + created = null; + instanceType = null; + accountName = null; + domainId = null; + hypervisor = null; + rootDeviceType = null; + rootDeviceId = null; + groupSet = new ArrayList(); + } + + public void setId( String id ) { + this.id = id; + } + + public String getId() { + return this.id; + } + + public void setName( String name ) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void setZoneName( String zoneName ) { + this.zoneName = zoneName; + } + + public String getZoneName() { + return this.zoneName; + } + + public void setTemplateId( String templateId ) { + this.templateId = templateId; + } + + public String getTemplateId() { + return this.templateId; + } + + public void setGroup( String group ) { + this.group = group; + } + + public String getGroup() { + return this.group; + } + + public void setState( String state ) { + this.state = state; + } + + public String getState() { + return this.state; + } + + public void setPreviousState( String state ) { + this.previousState = state; + } + + public String getPreviousState() { + return this.previousState; + } + + public void setCreated( String created ) { + this.created = EC2RestAuth.parseDateString( created ); + } + + public Calendar getCreated() { + return this.created; + } + + public void setIpAddress( String ipAddress ) { + this.ipAddress = ipAddress; + } + + public String getIpAddress() { + return this.ipAddress; + } + + public void setPrivateIpAddress( String ipAddress ) { + this.privateIpAddress = ipAddress; + } + + public String getPrivateIpAddress() { + return this.privateIpAddress; + } + + public void setServiceOffering( String instanceType ) { + this.instanceType = instanceType; + } + + public String getServiceOffering() { + return this.instanceType; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + public String getHypervisor() { + return hypervisor; + } + + public void setHypervisor(String param) { + hypervisor = param; + } + + public String getRootDeviceType() { + return rootDeviceType; + } + + public void setRootDeviceType(String param) { + rootDeviceType = param; + } + + public String getRootDeviceId() { + return rootDeviceId; + } + + public void setRootDeviceId(String param) { + rootDeviceId = param; + } + + public void addGroupName( String param ) { + groupSet.add( param ); + } + + public String[] getGroupSet() { + return groupSet.toArray(new String[0]); + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2InstanceFilterSet.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2InstanceFilterSet.java index 29cdecda2b7..3db621a3387 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2InstanceFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2InstanceFilterSet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2IpPermission.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2IpPermission.java index d816ffed925..5e14c3b9bd4 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2IpPermission.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2IpPermission.java @@ -1,120 +1,136 @@ -/* - * Copyright 2011 Cloud.com, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2IpPermission { - - private String protocol; - private String cidr; - private String ruleId; - private String icmpCode; - private String icmpType; - private Integer fromPort; - private Integer toPort; - private List userSet = new ArrayList(); // a list of groups identifying users - private List rangeSet = new ArrayList(); // a list of strings identifying CIDR - - public EC2IpPermission() { - protocol = null; - cidr = null; - ruleId = null; - icmpCode = null; - icmpType = null; - fromPort = null; - toPort = null; - } - - public void setProtocol( String protocol ) { - this.protocol = protocol; - } - - public String getProtocol() { - return this.protocol; - } - - public void setCIDR( String cidr ) { - this.cidr = cidr; - } - - public String getCIDR() { - return this.cidr; - } - - public void setRuleId( String ruleId ) { - this.ruleId = ruleId; - } - - public String getRuleId() { - return this.ruleId; - } - - public void setIcmpCode( String code ) { - this.icmpCode = code; - } - - public String getIcmpCode() { - return this.icmpCode; - } - - public void setIcmpType( String type ) { - this.icmpType = type; - } - - public String getIcmpType() { - return this.icmpType; - } - - public void setFromPort( Integer fromPort ) { - this.fromPort = fromPort; - } - - public Integer getFromPort() { - if (this.fromPort == null) - return new Integer(0); - else - return this.fromPort; - } - - public void setToPort( Integer toPort ) { - this.toPort = toPort; - } - - public Integer getToPort() { - if (this.toPort == null) - return new Integer(0); - else - return this.toPort; - } - - public void addUser( EC2SecurityGroup param ) { - userSet.add( param ); - } - - public EC2SecurityGroup[] getUserSet() { - return userSet.toArray(new EC2SecurityGroup[0]); - } - - public void addIpRange( String param ) { - rangeSet.add( param ); - } - - public String[] getIpRangeSet() { - return rangeSet.toArray(new String[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright 2011 Cloud.com, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2IpPermission { + + private String protocol; + private String cidr; + private String ruleId; + private String icmpCode; + private String icmpType; + private Integer fromPort; + private Integer toPort; + private List userSet = new ArrayList(); // a list of groups identifying users + private List rangeSet = new ArrayList(); // a list of strings identifying CIDR + + public EC2IpPermission() { + protocol = null; + cidr = null; + ruleId = null; + icmpCode = null; + icmpType = null; + fromPort = null; + toPort = null; + } + + public void setProtocol( String protocol ) { + this.protocol = protocol; + } + + public String getProtocol() { + return this.protocol; + } + + public void setCIDR( String cidr ) { + this.cidr = cidr; + } + + public String getCIDR() { + return this.cidr; + } + + public void setRuleId( String ruleId ) { + this.ruleId = ruleId; + } + + public String getRuleId() { + return this.ruleId; + } + + public void setIcmpCode( String code ) { + this.icmpCode = code; + } + + public String getIcmpCode() { + return this.icmpCode; + } + + public void setIcmpType( String type ) { + this.icmpType = type; + } + + public String getIcmpType() { + return this.icmpType; + } + + public void setFromPort( Integer fromPort ) { + this.fromPort = fromPort; + } + + public Integer getFromPort() { + if (this.fromPort == null) + return new Integer(0); + else + return this.fromPort; + } + + public void setToPort( Integer toPort ) { + this.toPort = toPort; + } + + public Integer getToPort() { + if (this.toPort == null) + return new Integer(0); + else + return this.toPort; + } + + public void addUser( EC2SecurityGroup param ) { + userSet.add( param ); + } + + public EC2SecurityGroup[] getUserSet() { + return userSet.toArray(new EC2SecurityGroup[0]); + } + + public void addIpRange( String param ) { + rangeSet.add( param ); + } + + public String[] getIpRangeSet() { + return rangeSet.toArray(new String[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2KeyPairFilterSet.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2KeyPairFilterSet.java index 842c130713f..3faefaf6735 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2KeyPairFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2KeyPairFilterSet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ModifyImageAttribute.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ModifyImageAttribute.java index 4fc93923143..76d6235b64f 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ModifyImageAttribute.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ModifyImageAttribute.java @@ -1,94 +1,110 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - - -import java.util.List; - -import com.cloud.bridge.service.core.ec2.EC2ImageAttributes.ImageAttribute; - -public class EC2ModifyImageAttribute { - - private String imageId = null; //AMI id - private ImageAttribute attribute = null; - private String description; - private Boolean isPublic = null; - - private Operation launchPermOperation = null; - public enum Operation{ - add, - remove, - reset; - } - - private List launchPermissionAccountsOrGroupList; - - public EC2ModifyImageAttribute() { - } - - - public void setAttribute(ImageAttribute attribute) { - this.attribute = attribute; - } - - public ImageAttribute getAttribute() { - return attribute; - } - - public void setImageId(String imageId) { - this.imageId = imageId; - } - - public String getImageId() { - return imageId; - } - - public void setDescription( String description ) { - this.description = description; - } - - public String getDescription() { - return this.description; - } - - public void setLaunchPermissionAccountsOrGroupList(List launchPermissionAccountsOrGroupList) { - this.launchPermissionAccountsOrGroupList = launchPermissionAccountsOrGroupList; - } - - public List getLaunchPermissionAccountsList() { - return launchPermissionAccountsOrGroupList; - } - - public void setLaunchPermOperation( Operation launchPermOperation ) { - this.launchPermOperation = launchPermOperation; - } - - public Operation getLaunchPermOperation() { - return this.launchPermOperation; - } - - - public void setIsPublic(Boolean isPublic) { - this.isPublic = isPublic; - } - - - public Boolean getIsPublic() { - return isPublic; - } - - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + + +import java.util.List; + +import com.cloud.bridge.service.core.ec2.EC2ImageAttributes.ImageAttribute; + +public class EC2ModifyImageAttribute { + + private String imageId = null; //AMI id + private ImageAttribute attribute = null; + private String description; + private Boolean isPublic = null; + + private Operation launchPermOperation = null; + public enum Operation{ + add, + remove, + reset; + } + + private List launchPermissionAccountsOrGroupList; + + public EC2ModifyImageAttribute() { + } + + + public void setAttribute(ImageAttribute attribute) { + this.attribute = attribute; + } + + public ImageAttribute getAttribute() { + return attribute; + } + + public void setImageId(String imageId) { + this.imageId = imageId; + } + + public String getImageId() { + return imageId; + } + + public void setDescription( String description ) { + this.description = description; + } + + public String getDescription() { + return this.description; + } + + public void setLaunchPermissionAccountsOrGroupList(List launchPermissionAccountsOrGroupList) { + this.launchPermissionAccountsOrGroupList = launchPermissionAccountsOrGroupList; + } + + public List getLaunchPermissionAccountsList() { + return launchPermissionAccountsOrGroupList; + } + + public void setLaunchPermOperation( Operation launchPermOperation ) { + this.launchPermOperation = launchPermOperation; + } + + public Operation getLaunchPermOperation() { + return this.launchPermOperation; + } + + + public void setIsPublic(Boolean isPublic) { + this.isPublic = isPublic; + } + + + public Boolean getIsPublic() { + return isPublic; + } + + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2PasswordData.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2PasswordData.java index a5a25bf8645..78091e19370 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2PasswordData.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2PasswordData.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; public class EC2PasswordData { diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RebootInstances.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RebootInstances.java index 071f297d5e5..67e0513b72e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RebootInstances.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RebootInstances.java @@ -1,35 +1,51 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2RebootInstances { - - private List instancesSet = new ArrayList(); // a list of strings identifying instances - - public EC2RebootInstances() { - } - - public void addInstanceId( String param ) { - instancesSet.add( param ); - } - - public String[] getInstancesSet() { - return instancesSet.toArray(new String[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2RebootInstances { + + private List instancesSet = new ArrayList(); // a list of strings identifying instances + + public EC2RebootInstances() { + } + + public void addInstanceId( String param ) { + instancesSet.add( param ); + } + + public String[] getInstancesSet() { + return instancesSet.toArray(new String[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RegisterImage.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RegisterImage.java index 2ba12a7f5f6..dd46717fe6f 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RegisterImage.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RegisterImage.java @@ -1,94 +1,110 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -public class EC2RegisterImage { - - private String location; - private String name; - private String description; - private String format; - private String zoneName; - private String osTypeName; - private String hypervisor; - - public EC2RegisterImage() { - location = null; - name = null; - description = null; - format = null; - zoneName = null; - osTypeName = null; - } - - public void setLocation( String location ) { - this.location = location; - } - - public String getLocation() { - return this.location; - } - - public void setName( String name ) { - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setDescription( String description ) { - this.description = description; - } - - public String getDescription() { - return this.description; - } - - /** - * We redefine the expected format of this field to be: - * "format:zonename:ostypename:hypervisor" - * - * @param param - */ - public void setArchitecture( String param ) { - if (null != param) { - String parts[] = param.split( ":" ); - if (3 <= parts.length) { - format = parts[0]; - zoneName = parts[1]; - osTypeName = parts[2]; - hypervisor = parts[3]; - } - } - } - - public String getFormat() { - return this.format; - } - - public String getZoneName() { - return this.zoneName; - } - - public String getOsTypeName() { - return this.osTypeName; - } - - public String getHypervisor() { - return hypervisor; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +public class EC2RegisterImage { + + private String location; + private String name; + private String description; + private String format; + private String zoneName; + private String osTypeName; + private String hypervisor; + + public EC2RegisterImage() { + location = null; + name = null; + description = null; + format = null; + zoneName = null; + osTypeName = null; + } + + public void setLocation( String location ) { + this.location = location; + } + + public String getLocation() { + return this.location; + } + + public void setName( String name ) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void setDescription( String description ) { + this.description = description; + } + + public String getDescription() { + return this.description; + } + + /** + * We redefine the expected format of this field to be: + * "format:zonename:ostypename:hypervisor" + * + * @param param + */ + public void setArchitecture( String param ) { + if (null != param) { + String parts[] = param.split( ":" ); + if (3 <= parts.length) { + format = parts[0]; + zoneName = parts[1]; + osTypeName = parts[2]; + hypervisor = parts[3]; + } + } + } + + public String getFormat() { + return this.format; + } + + public String getZoneName() { + return this.zoneName; + } + + public String getOsTypeName() { + return this.osTypeName; + } + + public String getHypervisor() { + return hypervisor; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ReleaseAddress.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ReleaseAddress.java index 086da72b743..754aecac6dd 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ReleaseAddress.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2ReleaseAddress.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstances.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstances.java index c9b6fd7ae12..36e39ee1e00 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstances.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstances.java @@ -1,125 +1,141 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2RunInstances { - - private String instanceType; - private String zoneName; - private String templateId; - private String groupId; - private String userData; - private String keyName; - private int maxCount; - private int minCount; - private Integer size; // <- in gigs - private List groupSet = new ArrayList(); - - public EC2RunInstances() { - instanceType = null; - zoneName = null; - templateId = null; - groupId = null; - userData = null; - keyName = null; - maxCount = 0; - minCount = 0; - size = 0; - } - - public void setInstanceType( String instanceType ) { - this.instanceType = instanceType; - } - - public String getInstanceType() { - return this.instanceType; - } - - public void setZoneName( String zoneName ) { - this.zoneName = zoneName; - } - - public String getZoneName() { - return this.zoneName; - } - - public void setTemplateId( String templateId ) { - this.templateId = templateId; - } - - public String getTemplateId() { - return this.templateId; - } - - public void setGroupId( String groupId ) { - this.groupId = groupId; - } - - public String getGroupId() { - return this.groupId; - } - - public void setUserData( String userData ) { - this.userData = userData; - } - - public String getUserData() { - return this.userData; - } - - public String getKeyName() { - return keyName; - } - - public void setKeyName(String publicKeyName) { - this.keyName = publicKeyName; - } - - public void setMaxCount( int maxCount ) { - this.maxCount = maxCount; - } - - public int getMaxCount() { - return this.maxCount; - } - - public void setMinCount( int minCount ) { - this.minCount = minCount; - } - - public int getMinCount() { - return this.minCount; - } - - public Integer getSize() { - return size; - } - - public void setSize(Integer size) { - this.size = size; - } - - public void addGroupName( String param ) { - groupSet.add( param ); - } - - public String[] getGroupSet() { - return groupSet.toArray(new String[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2RunInstances { + + private String instanceType; + private String zoneName; + private String templateId; + private String groupId; + private String userData; + private String keyName; + private int maxCount; + private int minCount; + private Integer size; // <- in gigs + private List groupSet = new ArrayList(); + + public EC2RunInstances() { + instanceType = null; + zoneName = null; + templateId = null; + groupId = null; + userData = null; + keyName = null; + maxCount = 0; + minCount = 0; + size = 0; + } + + public void setInstanceType( String instanceType ) { + this.instanceType = instanceType; + } + + public String getInstanceType() { + return this.instanceType; + } + + public void setZoneName( String zoneName ) { + this.zoneName = zoneName; + } + + public String getZoneName() { + return this.zoneName; + } + + public void setTemplateId( String templateId ) { + this.templateId = templateId; + } + + public String getTemplateId() { + return this.templateId; + } + + public void setGroupId( String groupId ) { + this.groupId = groupId; + } + + public String getGroupId() { + return this.groupId; + } + + public void setUserData( String userData ) { + this.userData = userData; + } + + public String getUserData() { + return this.userData; + } + + public String getKeyName() { + return keyName; + } + + public void setKeyName(String publicKeyName) { + this.keyName = publicKeyName; + } + + public void setMaxCount( int maxCount ) { + this.maxCount = maxCount; + } + + public int getMaxCount() { + return this.maxCount; + } + + public void setMinCount( int minCount ) { + this.minCount = minCount; + } + + public int getMinCount() { + return this.minCount; + } + + public Integer getSize() { + return size; + } + + public void setSize(Integer size) { + this.size = size; + } + + public void addGroupName( String param ) { + groupSet.add( param ); + } + + public String[] getGroupSet() { + return groupSet.toArray(new String[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstancesResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstancesResponse.java index b3a5594e78f..23839c24dee 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstancesResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstancesResponse.java @@ -1,37 +1,53 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -import com.cloud.bridge.service.core.ec2.EC2Instance; - -public class EC2RunInstancesResponse { - - private List instanceSet = new ArrayList(); - - public EC2RunInstancesResponse() { - } - - public void addInstance( EC2Instance param ) { - instanceSet.add( param ); - } - - public EC2Instance[] getInstanceSet() { - return instanceSet.toArray(new EC2Instance[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +import com.cloud.bridge.service.core.ec2.EC2Instance; + +public class EC2RunInstancesResponse { + + private List instanceSet = new ArrayList(); + + public EC2RunInstancesResponse() { + } + + public void addInstance( EC2Instance param ) { + instanceSet.add( param ); + } + + public EC2Instance[] getInstanceSet() { + return instanceSet.toArray(new EC2Instance[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SSHKeyPair.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SSHKeyPair.java index 7bb48e2e388..3b7f941b67e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SSHKeyPair.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SSHKeyPair.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.ec2; public class EC2SSHKeyPair { diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SecurityGroup.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SecurityGroup.java index d343bb0197f..468c3cc8dba 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SecurityGroup.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SecurityGroup.java @@ -1,79 +1,95 @@ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2SecurityGroup { - - private String id; - private String name; - private String description; - private String accountName; - private String domainId; - private List permissionSet = new ArrayList(); - - public EC2SecurityGroup() { - id = null; - name = null; - description = null; - accountName = null; - domainId = null; - } - - public void setId( String id ) { - this.id = id; - } - - public String getId() { - return this.id; - } - - public void setName( String name ) { - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setDescription( String description ) { - this.description = description; - } - - public String getDescription() { - return this.description; - } - - public void setAccount( String account ) { - this.accountName = account; - } - - public String getAccount() { - return this.accountName; - } - - public void addIpPermission( EC2IpPermission param ) { - permissionSet.add( param ); - } - - public EC2IpPermission[] getIpPermissionSet() { - return permissionSet.toArray(new EC2IpPermission[0]); - } - - public String getAccountName() { - return accountName; - } - - public void setAccountName(String accountName) { - this.accountName = accountName; - } - - public String getDomainId() { - return domainId; - } - - public void setDomainId(String domainId) { - this.domainId = domainId; - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2SecurityGroup { + + private String id; + private String name; + private String description; + private String accountName; + private String domainId; + private List permissionSet = new ArrayList(); + + public EC2SecurityGroup() { + id = null; + name = null; + description = null; + accountName = null; + domainId = null; + } + + public void setId( String id ) { + this.id = id; + } + + public String getId() { + return this.id; + } + + public void setName( String name ) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void setDescription( String description ) { + this.description = description; + } + + public String getDescription() { + return this.description; + } + + public void setAccount( String account ) { + this.accountName = account; + } + + public String getAccount() { + return this.accountName; + } + + public void addIpPermission( EC2IpPermission param ) { + permissionSet.add( param ); + } + + public EC2IpPermission[] getIpPermissionSet() { + return permissionSet.toArray(new EC2IpPermission[0]); + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Snapshot.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Snapshot.java index a03856d86fa..8812160a9df 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Snapshot.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Snapshot.java @@ -1,118 +1,134 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.Calendar; - -import com.cloud.bridge.util.EC2RestAuth; - -public class EC2Snapshot { - - private String id; - private String name; - private String volumeId; - private Long volumeSize; // in gigs - private String type; - private String state; - private Calendar created; - private String accountName; - private String domainId; - - public EC2Snapshot() { - id = null; - name = null; - volumeId = null; - volumeSize = new Long(0); - type = null; - state = null; - created = null; - accountName = null; - domainId = null; - } - - public void setId(String id ) { - this.id = id; - } - - public String getId() { - return this.id; - } - - public void setName( String name ) { - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setVolumeId(String volumeId ) { - this.volumeId = volumeId; - } - - public String getVolumeId() { - return this.volumeId; - } - - public void setVolumeSize( Long volumeSize ) { - this.volumeSize = volumeSize; - } - - public Long getVolumeSize() { - return this.volumeSize; - } - - public void setType( String type ) { - this.type = type; - } - - public String getType() { - return this.type; - } - - - public void setCreated( String created ) { - this.created = EC2RestAuth.parseDateString( created ); - } - - public Calendar getCreated() { - return this.created; - } - - public String getAccountName() { - return accountName; - } - - public void setAccountName(String accountName) { - this.accountName = accountName; - } - - public String getDomainId() { - return domainId; - } - - public void setDomainId(String domainId) { - this.domainId = domainId; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.Calendar; + +import com.cloud.bridge.util.EC2RestAuth; + +public class EC2Snapshot { + + private String id; + private String name; + private String volumeId; + private Long volumeSize; // in gigs + private String type; + private String state; + private Calendar created; + private String accountName; + private String domainId; + + public EC2Snapshot() { + id = null; + name = null; + volumeId = null; + volumeSize = new Long(0); + type = null; + state = null; + created = null; + accountName = null; + domainId = null; + } + + public void setId(String id ) { + this.id = id; + } + + public String getId() { + return this.id; + } + + public void setName( String name ) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void setVolumeId(String volumeId ) { + this.volumeId = volumeId; + } + + public String getVolumeId() { + return this.volumeId; + } + + public void setVolumeSize( Long volumeSize ) { + this.volumeSize = volumeSize; + } + + public Long getVolumeSize() { + return this.volumeSize; + } + + public void setType( String type ) { + this.type = type; + } + + public String getType() { + return this.type; + } + + + public void setCreated( String created ) { + this.created = EC2RestAuth.parseDateString( created ); + } + + public Calendar getCreated() { + return this.created; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SnapshotFilterSet.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SnapshotFilterSet.java index 9e3e4ade943..3803bece29e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SnapshotFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2SnapshotFilterSet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StartInstances.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StartInstances.java index ff6be8a608b..6cecfff2988 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StartInstances.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StartInstances.java @@ -1,35 +1,51 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2StartInstances { - - private List instancesSet = new ArrayList(); // a list of strings identifying instances - - public EC2StartInstances() { - } - - public void addInstanceId( String param ) { - instancesSet.add( param ); - } - - public String[] getInstancesSet() { - return instancesSet.toArray(new String[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2StartInstances { + + private List instancesSet = new ArrayList(); // a list of strings identifying instances + + public EC2StartInstances() { + } + + public void addInstanceId( String param ) { + instancesSet.add( param ); + } + + public String[] getInstancesSet() { + return instancesSet.toArray(new String[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StartInstancesResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StartInstancesResponse.java index b796140f24f..ce255db792d 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StartInstancesResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StartInstancesResponse.java @@ -1,36 +1,52 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2StartInstancesResponse { - - private List instanceSet = new ArrayList(); - - public EC2StartInstancesResponse() { - } - - public void addInstance( EC2Instance param ) { - instanceSet.add( param ); - } - - public EC2Instance[] getInstanceSet() { - return instanceSet.toArray(new EC2Instance[0]); - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2StartInstancesResponse { + + private List instanceSet = new ArrayList(); + + public EC2StartInstancesResponse() { + } + + public void addInstance( EC2Instance param ) { + instanceSet.add( param ); + } + + public EC2Instance[] getInstanceSet() { + return instanceSet.toArray(new EC2Instance[0]); + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StopInstances.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StopInstances.java index 421c166ede1..52630e7e4e0 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StopInstances.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StopInstances.java @@ -1,46 +1,62 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2StopInstances { - - private List instancesSet = new ArrayList(); // a list of strings identifying instances - private boolean destroyInstances; // we are destroying the instances rather than stopping them - - public EC2StopInstances() { - destroyInstances = false; - } - - public void addInstanceId( String param ) { - instancesSet.add( param ); - } - - public String[] getInstancesSet() { - return instancesSet.toArray(new String[0]); - } - - public void setDestroyInstances( boolean destroyInstances ) { - this.destroyInstances = destroyInstances; - } - - public boolean getDestroyInstances() { - return this.destroyInstances; - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2StopInstances { + + private List instancesSet = new ArrayList(); // a list of strings identifying instances + private boolean destroyInstances; // we are destroying the instances rather than stopping them + + public EC2StopInstances() { + destroyInstances = false; + } + + public void addInstanceId( String param ) { + instancesSet.add( param ); + } + + public String[] getInstancesSet() { + return instancesSet.toArray(new String[0]); + } + + public void setDestroyInstances( boolean destroyInstances ) { + this.destroyInstances = destroyInstances; + } + + public boolean getDestroyInstances() { + return this.destroyInstances; + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StopInstancesResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StopInstancesResponse.java index c26389e5d7b..bdee3824782 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StopInstancesResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2StopInstancesResponse.java @@ -1,35 +1,51 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class EC2StopInstancesResponse { - - private List instanceSet = new ArrayList(); - - public EC2StopInstancesResponse() { - } - - public void addInstance( EC2Instance param ) { - instanceSet.add( param ); - } - - public EC2Instance[] getInstanceSet() { - return instanceSet.toArray(new EC2Instance[0]); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class EC2StopInstancesResponse { + + private List instanceSet = new ArrayList(); + + public EC2StopInstancesResponse() { + } + + public void addInstance( EC2Instance param ) { + instanceSet.add( param ); + } + + public EC2Instance[] getInstanceSet() { + return instanceSet.toArray(new EC2Instance[0]); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Volume.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Volume.java index c6b5b0fe383..599a7e3dca8 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Volume.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Volume.java @@ -1,233 +1,249 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - - -public class EC2Volume { - - private String id; - private Long size; // <- in gigs - private String zoneName; - private String instanceId; - private String snapshotId; - private String device; - private String deviceId; - private String state; - private String type; - private String VMState; - private String hypervisor; - private String created; - private String attached; - - public EC2Volume() { - id = null; - zoneName = null; - instanceId = null; - snapshotId = null; - device = null; - deviceId = null; - state = null; - type = null; - VMState = null; - hypervisor = null; - created = null; - attached = null; - } - - public void setSize(Long size) { - if (size != null) { - this.size = (size / 1073741824); - } else - this.size = (long) 0; - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @return the size - */ - public Long getSize() { - return size; - } - - /** - * @return the zoneName - */ - public String getZoneName() { - return zoneName; - } - - /** - * @return the instanceId - */ - public String getInstanceId() { - return instanceId; - } - - /** - * @return the snapshotId - */ - public String getSnapshotId() { - return snapshotId; - } - - /** - * @return the device - */ - public String getDevice() { - return device; - } - - /** - * @return the deviceId - */ - public String getDeviceId() { - return deviceId; - } - - /** - * @return the state - */ - public String getState() { - return state; - } - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @return the VMState - */ - public String getVMState() { - return VMState; - } - - /** - * @return the hypervisor - */ - public String getHypervisor() { - return hypervisor; - } - - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @param zoneName the zoneName to set - */ - public void setZoneName(String zoneName) { - this.zoneName = zoneName; - } - - /** - * @param instanceId the instanceId to set - */ - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - /** - * @param snapshotId the snapshotId to set - */ - public void setSnapshotId(String snapshotId) { - this.snapshotId = snapshotId; - } - - /** - * @param device the device to set - */ - public void setDevice(String device) { - this.device = device; - } - - /** - * @param deviceId the deviceId to set - */ - public void setDeviceId(String deviceId) { - this.deviceId = deviceId; - } - - /** - * @param state the state to set - */ - public void setState(String state) { - this.state = state; - } - - /** - * @param type the type to set - */ - public void setType(String type) { - this.type = type; - } - - /** - * @param VMState the VMState to set - */ - public void setVMState(String VMState) { - this.VMState = VMState; - } - - /** - * @param hypervisor the hypervisor to set - */ - public void setHypervisor(String hypervisor) { - this.hypervisor = hypervisor; - } - - /** - * @return the created - */ - public String getCreated() { - return created; - } - - /** - * @return the attached - */ - public String getAttached() { - return attached; - } - - /** - * @param created the created to set - */ - public void setCreated(String created) { - this.created = created; - } - - /** - * @param attached the attached to set - */ - public void setAttached(String attached) { - this.attached = attached; - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + + +public class EC2Volume { + + private String id; + private Long size; // <- in gigs + private String zoneName; + private String instanceId; + private String snapshotId; + private String device; + private String deviceId; + private String state; + private String type; + private String VMState; + private String hypervisor; + private String created; + private String attached; + + public EC2Volume() { + id = null; + zoneName = null; + instanceId = null; + snapshotId = null; + device = null; + deviceId = null; + state = null; + type = null; + VMState = null; + hypervisor = null; + created = null; + attached = null; + } + + public void setSize(Long size) { + if (size != null) { + this.size = (size / 1073741824); + } else + this.size = (long) 0; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the size + */ + public Long getSize() { + return size; + } + + /** + * @return the zoneName + */ + public String getZoneName() { + return zoneName; + } + + /** + * @return the instanceId + */ + public String getInstanceId() { + return instanceId; + } + + /** + * @return the snapshotId + */ + public String getSnapshotId() { + return snapshotId; + } + + /** + * @return the device + */ + public String getDevice() { + return device; + } + + /** + * @return the deviceId + */ + public String getDeviceId() { + return deviceId; + } + + /** + * @return the state + */ + public String getState() { + return state; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @return the VMState + */ + public String getVMState() { + return VMState; + } + + /** + * @return the hypervisor + */ + public String getHypervisor() { + return hypervisor; + } + + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @param zoneName the zoneName to set + */ + public void setZoneName(String zoneName) { + this.zoneName = zoneName; + } + + /** + * @param instanceId the instanceId to set + */ + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } + + /** + * @param snapshotId the snapshotId to set + */ + public void setSnapshotId(String snapshotId) { + this.snapshotId = snapshotId; + } + + /** + * @param device the device to set + */ + public void setDevice(String device) { + this.device = device; + } + + /** + * @param deviceId the deviceId to set + */ + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + /** + * @param state the state to set + */ + public void setState(String state) { + this.state = state; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @param VMState the VMState to set + */ + public void setVMState(String VMState) { + this.VMState = VMState; + } + + /** + * @param hypervisor the hypervisor to set + */ + public void setHypervisor(String hypervisor) { + this.hypervisor = hypervisor; + } + + /** + * @return the created + */ + public String getCreated() { + return created; + } + + /** + * @return the attached + */ + public String getAttached() { + return attached; + } + + /** + * @param created the created to set + */ + public void setCreated(String created) { + this.created = created; + } + + /** + * @param attached the attached to set + */ + public void setAttached(String attached) { + this.attached = attached; + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2VolumeFilterSet.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2VolumeFilterSet.java index 0b0520403ac..28f939ffa2e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2VolumeFilterSet.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2VolumeFilterSet.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/IpForwardingRuleResponse.java b/awsapi/src/com/cloud/bridge/service/core/ec2/IpForwardingRuleResponse.java index 2fb038b3042..f7f3bf3e278 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/IpForwardingRuleResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/IpForwardingRuleResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved * diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/OfferingBundle.java b/awsapi/src/com/cloud/bridge/service/core/ec2/OfferingBundle.java index 8d2aa92619a..aa765841afe 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/OfferingBundle.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/OfferingBundle.java @@ -1,34 +1,50 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -public class OfferingBundle { - - private String serviceOfferingId; - - public OfferingBundle() { - serviceOfferingId = null; - } - - public void setServiceOfferingId( String id ) { - serviceOfferingId = id; - if (null != serviceOfferingId) serviceOfferingId = serviceOfferingId.trim(); - } - - public String getServiceOfferingId() { - return serviceOfferingId; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +public class OfferingBundle { + + private String serviceOfferingId; + + public OfferingBundle() { + serviceOfferingId = null; + } + + public void setServiceOfferingId( String id ) { + serviceOfferingId = id; + if (null != serviceOfferingId) serviceOfferingId = serviceOfferingId.trim(); + } + + public String getServiceOfferingId() { + return serviceOfferingId; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/ServiceOffer.java b/awsapi/src/com/cloud/bridge/service/core/ec2/ServiceOffer.java index 2c9a667842a..12ed19e2f75 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/ServiceOffer.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/ServiceOffer.java @@ -1,87 +1,103 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.Calendar; - -import com.cloud.bridge.util.EC2RestAuth; - -public class ServiceOffer { - - private String id; - private String name; - private String memory; - private String cpuNumber; - private String cpuSpeed; - private Calendar created; - - public ServiceOffer() { - id = null; - name = null; - memory = null; - cpuNumber = null; - cpuSpeed = null; - created = null; - } - - public void setId( String id ) { - this.id = id; - } - - public String getId() { - return this.id; - } - - public void setName( String name ) { - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setMemory( String memory ) { - this.memory = memory; - } - - public String getMemory() { - return this.memory; - } - - public void setCPUNumber( String param ) { - this.cpuNumber = param; - } - - public int getCPUNumber() { - return Integer.parseInt( this.cpuNumber ); - } - - public void setCPUSpeed( String param ) { - this.cpuSpeed = param; - } - - public String getCPUSpeed() { - return this.cpuSpeed; - } - - public void setCreated( String created ) { - this.created = EC2RestAuth.parseDateString( created ); - } - - public Calendar getCreated() { - return this.created; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.Calendar; + +import com.cloud.bridge.util.EC2RestAuth; + +public class ServiceOffer { + + private String id; + private String name; + private String memory; + private String cpuNumber; + private String cpuSpeed; + private Calendar created; + + public ServiceOffer() { + id = null; + name = null; + memory = null; + cpuNumber = null; + cpuSpeed = null; + created = null; + } + + public void setId( String id ) { + this.id = id; + } + + public String getId() { + return this.id; + } + + public void setName( String name ) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void setMemory( String memory ) { + this.memory = memory; + } + + public String getMemory() { + return this.memory; + } + + public void setCPUNumber( String param ) { + this.cpuNumber = param; + } + + public int getCPUNumber() { + return Integer.parseInt( this.cpuNumber ); + } + + public void setCPUSpeed( String param ) { + this.cpuSpeed = param; + } + + public String getCPUSpeed() { + return this.cpuSpeed; + } + + public void setCreated( String created ) { + this.created = EC2RestAuth.parseDateString( created ); + } + + public Calendar getCreated() { + return this.created; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/ServiceOfferings.java b/awsapi/src/com/cloud/bridge/service/core/ec2/ServiceOfferings.java index 7fb90666b69..370c7c52e69 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/ServiceOfferings.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/ServiceOfferings.java @@ -1,36 +1,52 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.ec2; - -import java.util.ArrayList; -import java.util.List; - -public class ServiceOfferings { - - private List offerSet = new ArrayList(); - - public ServiceOfferings() { - } - - public void addOffer( ServiceOffer param ) { - offerSet.add( param ); - } - - public ServiceOffer[] getOfferSet() { - return offerSet.toArray(new ServiceOffer[0]); - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.ec2; + +import java.util.ArrayList; +import java.util.List; + +public class ServiceOfferings { + + private List offerSet = new ArrayList(); + + public ServiceOfferings() { + } + + public void addOffer( ServiceOffer param ) { + offerSet.add( param ); + } + + public ServiceOffer[] getOfferSet() { + return offerSet.toArray(new ServiceOffer[0]); + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3AccessControlList.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3AccessControlList.java index bd43f55e22f..4918c673a6b 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3AccessControlList.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3AccessControlList.java @@ -1,42 +1,58 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Kelven Yang, John Zucker - * An S3AccessControlList is simply a holder of grants depicted as instances of S3Grant. - */ -public class S3AccessControlList { - private List list = new ArrayList(); - - public S3AccessControlList() { - } - - public S3Grant[] getGrants() { - return list.toArray(new S3Grant[0]); - } - - public void addGrant(S3Grant grant) { - list.add(grant); - } - - public int size() { - return list.size(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Kelven Yang, John Zucker + * An S3AccessControlList is simply a holder of grants depicted as instances of S3Grant. + */ +public class S3AccessControlList { + private List list = new ArrayList(); + + public S3AccessControlList() { + } + + public S3Grant[] getGrants() { + return list.toArray(new S3Grant[0]); + } + + public void addGrant(S3Grant grant) { + list.add(grant); + } + + public int size() { + return list.size(); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3AccessControlPolicy.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3AccessControlPolicy.java index cb7e0e72b1d..94d996e143b 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3AccessControlPolicy.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3AccessControlPolicy.java @@ -1,44 +1,60 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3AccessControlPolicy extends S3Response { - protected S3CanonicalUser owner; - protected S3Grant[] grants; - - public S3AccessControlPolicy() { - super(); - } - - public S3CanonicalUser getOwner() { - return owner; - } - - public void setOwner(S3CanonicalUser owner) { - this.owner = owner; - } - - public S3Grant[] getGrants() { - return grants; - } - - public void setGrants(S3Grant[] grants) { - this.grants = grants; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3AccessControlPolicy extends S3Response { + protected S3CanonicalUser owner; + protected S3Grant[] grants; + + public S3AccessControlPolicy() { + super(); + } + + public S3CanonicalUser getOwner() { + return owner; + } + + public void setOwner(S3CanonicalUser owner) { + this.owner = owner; + } + + public S3Grant[] getGrants() { + return grants; + } + + public void setGrants(S3Grant[] grants) { + this.grants = grants; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3AuthParams.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3AuthParams.java index a22f5fb8ba6..861c1ef05e5 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3AuthParams.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3AuthParams.java @@ -1,42 +1,58 @@ -package com.cloud.bridge.service.core.s3; - -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import com.cloud.bridge.util.HeaderParam; - -/** - * We need to be able to pass in specific values into the S3 REST authentication algorithm - * where these values can be obtained from either HTTP headers directly or from the body - * of a POST request. - */ -public class S3AuthParams { - - private List headerList = new ArrayList(); - - public S3AuthParams() { - } - - public HeaderParam[] getHeaders() { - return headerList.toArray(new HeaderParam[0]); - } - - public void addHeader(HeaderParam param) { - headerList.add( param ); - } - - public String getHeader( String header ) - { - // ToDO - make this look up faster - ListIterator it = headerList.listIterator(); - while( it.hasNext()) - { - HeaderParam temp = (HeaderParam)it.next(); - if (header.equalsIgnoreCase( temp.getName())) { - return temp.getValue(); - } - } - return null; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.bridge.service.core.s3; + +import java.util.ArrayList; +import java.util.List; +import java.util.ListIterator; + +import com.cloud.bridge.util.HeaderParam; + +/** + * We need to be able to pass in specific values into the S3 REST authentication algorithm + * where these values can be obtained from either HTTP headers directly or from the body + * of a POST request. + */ +public class S3AuthParams { + + private List headerList = new ArrayList(); + + public S3AuthParams() { + } + + public HeaderParam[] getHeaders() { + return headerList.toArray(new HeaderParam[0]); + } + + public void addHeader(HeaderParam param) { + headerList.add( param ); + } + + public String getHeader( String header ) + { + // ToDO - make this look up faster + ListIterator it = headerList.listIterator(); + while( it.hasNext()) + { + HeaderParam temp = (HeaderParam)it.next(); + if (header.equalsIgnoreCase( temp.getName())) { + return temp.getValue(); + } + } + return null; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3BucketAdapter.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3BucketAdapter.java index 0900a03c3f6..20634b08938 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3BucketAdapter.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3BucketAdapter.java @@ -1,37 +1,53 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.io.InputStream; -import java.io.OutputStream; - -import javax.activation.DataHandler; - -import com.cloud.bridge.util.OrderedPair; - -/** - * @author Kelven Yang - */ -public interface S3BucketAdapter { - void createContainer(String mountedRoot, String bucket); - void deleteContainer(String mountedRoot, String bucket); - String getBucketFolderDir(String mountedRoot, String bucket); - String saveObject(InputStream is, String mountedRoot, String bucket, String fileName); - DataHandler loadObject(String mountedRoot, String bucket, String fileName); - DataHandler loadObjectRange(String mountedRoot, String bucket, String fileName, long startPos, long endPos); - void deleteObject(String mountedRoot, String bucket, String fileName); - OrderedPair concatentateObjects(String mountedRoot, String destBucket, String fileName, String sourceBucket, S3MultipartPart[] parts, OutputStream os); -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.io.InputStream; +import java.io.OutputStream; + +import javax.activation.DataHandler; + +import com.cloud.bridge.util.OrderedPair; + +/** + * @author Kelven Yang + */ +public interface S3BucketAdapter { + void createContainer(String mountedRoot, String bucket); + void deleteContainer(String mountedRoot, String bucket); + String getBucketFolderDir(String mountedRoot, String bucket); + String saveObject(InputStream is, String mountedRoot, String bucket, String fileName); + DataHandler loadObject(String mountedRoot, String bucket, String fileName); + DataHandler loadObjectRange(String mountedRoot, String bucket, String fileName, long startPos, long endPos); + void deleteObject(String mountedRoot, String bucket, String fileName); + OrderedPair concatentateObjects(String mountedRoot, String destBucket, String fileName, String sourceBucket, S3MultipartPart[] parts, OutputStream os); +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3BucketPolicy.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3BucketPolicy.java index b439101d609..eb2a5060dba 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3BucketPolicy.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3BucketPolicy.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3CanonicalUser.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3CanonicalUser.java index 3a86463ec01..a59c8bb0317 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3CanonicalUser.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3CanonicalUser.java @@ -1,49 +1,65 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import com.cloud.bridge.util.XElement; - -/** - * @author Kelven Yang - */ -public class S3CanonicalUser { - - @XElement(name="ID") - private String ID; - - @XElement(name="DisplayName") - private String displayName; - - public S3CanonicalUser() { - } - - public String getID() { - return ID; - } - - public void setID(String iD) { - ID = iD; - } - - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import com.cloud.bridge.util.XElement; + +/** + * @author Kelven Yang + */ +public class S3CanonicalUser { + + @XElement(name="ID") + private String ID; + + @XElement(name="DisplayName") + private String displayName; + + public S3CanonicalUser() { + } + + public String getID() { + return ID; + } + + public void setID(String iD) { + ID = iD; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3ConditionFactory.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3ConditionFactory.java index e827dcc5586..d9d2cf30e1e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3ConditionFactory.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3ConditionFactory.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3ConditionalHeaders.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3ConditionalHeaders.java index 414f1ee3020..e1b4e0e6695 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3ConditionalHeaders.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3ConditionalHeaders.java @@ -1,167 +1,183 @@ -package com.cloud.bridge.service.core.s3; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -public class S3ConditionalHeaders { - protected Date modifiedSince; - protected Date unmodifiedSince; - protected String[] ifMatch; - protected String[] ifNoneMatch; - - public S3ConditionalHeaders() { - modifiedSince = null; - unmodifiedSince = null; - ifMatch = null; - ifNoneMatch = null; - } - - public void setModifiedSince( Calendar ifModifiedSince ) { - if (null != ifModifiedSince) modifiedSince = ifModifiedSince.getTime(); - } - - public void setUnModifiedSince( Calendar ifUnmodifiedSince ) { - if (null != ifUnmodifiedSince) unmodifiedSince = ifUnmodifiedSince.getTime(); - } - - public void setModifiedSince( String ifModifiedSince ) { - DateFormat formatter = null; - Calendar cal = Calendar.getInstance(); - - try { - formatter = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss z" ); - cal.setTime( formatter.parse( ifModifiedSince )); - modifiedSince = cal.getTime(); - } catch( Exception e ) {} - } - - public void setUnModifiedSince( String ifUnmodifiedSince ) { - DateFormat formatter = null; - Calendar cal = Calendar.getInstance(); - - try { - formatter = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss z" ); - cal.setTime( formatter.parse( ifUnmodifiedSince )); - unmodifiedSince = cal.getTime(); - } catch( Exception e ) {} - } - - public void setMatch( String[] ifMatch ) { - this.ifMatch = ifMatch; - } - - /** - * Takes the header value from HTTP "If-Match", for example is: - * If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz" - * - * @param ifMatch - */ - public void setMatch( String ifMatch ) { - if ( null == ifMatch ) { - this.ifMatch = null; - } - else { - String[] parts = ifMatch.split( "," ); - this.ifMatch = new String[parts.length]; - for( int i=0; i < parts.length; i++ ) { - String temp = new String( parts[i].trim()); - if (temp.startsWith( "\"" )) temp = temp.substring( 1 ); - if (temp.endsWith( "\"" )) temp = temp.substring( 0, temp.length()-1 ); - this.ifMatch[i] = temp; - } - } - } - - public void setNoneMatch( String[] ifNoneMatch ) { - this.ifNoneMatch = ifNoneMatch; - } - - public void setNoneMatch( String ifNoneMatch ) { - if ( null == ifNoneMatch ) { - this.ifNoneMatch = null; - } - else { - String[] parts = ifNoneMatch.split( "," ); - this.ifNoneMatch = new String[parts.length]; - for( int i=0; i < parts.length; i++ ) { - String temp = new String( parts[i].trim()); - if (temp.startsWith( "\"" )) temp = temp.substring( 1 ); - if (temp.endsWith( "\"" )) temp = temp.substring( 0, temp.length()-1 ); - this.ifNoneMatch[i] = temp; - System.out.println( i + "> " + temp ); - } - } - } - - /** - * Has the object been modified since the client has last checked? - * - * @param lastModified - * @return a negative value means that the object has not been modified since - * a postive value means that this test should be ignored. - */ - public int ifModifiedSince( Date lastModified ) - { - if (null == modifiedSince) return 1; - - if ( 0 >= modifiedSince.compareTo( lastModified )) - return 2; - else return -1; - } - - /** - * Has the object been modified since the unmodified date? - * - * @param lastModified - * @return a negative value means that the object has been modified since - * a postive value means that this test should be ignored. - */ - public int ifUnmodifiedSince( Date lastModified ) - { - if (null == unmodifiedSince) return 1; - - if ( 0 < unmodifiedSince.compareTo( lastModified )) - return 2; - else return -1; - } - - /** - * Does the object's contents (its MD5 signature) match what the client thinks - * it is? - * - * @param ETag - an MD5 signature of the content of the data being stored in S3 - * @return a negative value means that the test has failed, - * a positive value means that the test succeeded or could not be done (so ignore it) - */ - public int ifMatchEtag( String ETag ) - { - if (null == ifMatch || null == ETag) return 1; - - for( int i=0; i < ifMatch.length; i++ ) - { - if (ifMatch[i].equals( ETag )) return 2; - } - return -1; - } - - /** - * None of the given ETags in the "If-None-Match" can match the ETag parameter for this - * function to pass. - * - * @param ETag - an MD5 signature of the content of the data being stored in S3 - * @return a negative value means that the test has failed, - * a positive value means that the test succeeded or could not be done (so ignore it) - */ - public int ifNoneMatchEtag( String ETag ) - { - if (null == ifNoneMatch || null == ETag) return 1; - - for( int i=0; i < ifNoneMatch.length; i++ ) - { - if (ifNoneMatch[i].equals( ETag )) return -1; - } - return 2; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.bridge.service.core.s3; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +public class S3ConditionalHeaders { + protected Date modifiedSince; + protected Date unmodifiedSince; + protected String[] ifMatch; + protected String[] ifNoneMatch; + + public S3ConditionalHeaders() { + modifiedSince = null; + unmodifiedSince = null; + ifMatch = null; + ifNoneMatch = null; + } + + public void setModifiedSince( Calendar ifModifiedSince ) { + if (null != ifModifiedSince) modifiedSince = ifModifiedSince.getTime(); + } + + public void setUnModifiedSince( Calendar ifUnmodifiedSince ) { + if (null != ifUnmodifiedSince) unmodifiedSince = ifUnmodifiedSince.getTime(); + } + + public void setModifiedSince( String ifModifiedSince ) { + DateFormat formatter = null; + Calendar cal = Calendar.getInstance(); + + try { + formatter = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss z" ); + cal.setTime( formatter.parse( ifModifiedSince )); + modifiedSince = cal.getTime(); + } catch( Exception e ) {} + } + + public void setUnModifiedSince( String ifUnmodifiedSince ) { + DateFormat formatter = null; + Calendar cal = Calendar.getInstance(); + + try { + formatter = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss z" ); + cal.setTime( formatter.parse( ifUnmodifiedSince )); + unmodifiedSince = cal.getTime(); + } catch( Exception e ) {} + } + + public void setMatch( String[] ifMatch ) { + this.ifMatch = ifMatch; + } + + /** + * Takes the header value from HTTP "If-Match", for example is: + * If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz" + * + * @param ifMatch + */ + public void setMatch( String ifMatch ) { + if ( null == ifMatch ) { + this.ifMatch = null; + } + else { + String[] parts = ifMatch.split( "," ); + this.ifMatch = new String[parts.length]; + for( int i=0; i < parts.length; i++ ) { + String temp = new String( parts[i].trim()); + if (temp.startsWith( "\"" )) temp = temp.substring( 1 ); + if (temp.endsWith( "\"" )) temp = temp.substring( 0, temp.length()-1 ); + this.ifMatch[i] = temp; + } + } + } + + public void setNoneMatch( String[] ifNoneMatch ) { + this.ifNoneMatch = ifNoneMatch; + } + + public void setNoneMatch( String ifNoneMatch ) { + if ( null == ifNoneMatch ) { + this.ifNoneMatch = null; + } + else { + String[] parts = ifNoneMatch.split( "," ); + this.ifNoneMatch = new String[parts.length]; + for( int i=0; i < parts.length; i++ ) { + String temp = new String( parts[i].trim()); + if (temp.startsWith( "\"" )) temp = temp.substring( 1 ); + if (temp.endsWith( "\"" )) temp = temp.substring( 0, temp.length()-1 ); + this.ifNoneMatch[i] = temp; + System.out.println( i + "> " + temp ); + } + } + } + + /** + * Has the object been modified since the client has last checked? + * + * @param lastModified + * @return a negative value means that the object has not been modified since + * a postive value means that this test should be ignored. + */ + public int ifModifiedSince( Date lastModified ) + { + if (null == modifiedSince) return 1; + + if ( 0 >= modifiedSince.compareTo( lastModified )) + return 2; + else return -1; + } + + /** + * Has the object been modified since the unmodified date? + * + * @param lastModified + * @return a negative value means that the object has been modified since + * a postive value means that this test should be ignored. + */ + public int ifUnmodifiedSince( Date lastModified ) + { + if (null == unmodifiedSince) return 1; + + if ( 0 < unmodifiedSince.compareTo( lastModified )) + return 2; + else return -1; + } + + /** + * Does the object's contents (its MD5 signature) match what the client thinks + * it is? + * + * @param ETag - an MD5 signature of the content of the data being stored in S3 + * @return a negative value means that the test has failed, + * a positive value means that the test succeeded or could not be done (so ignore it) + */ + public int ifMatchEtag( String ETag ) + { + if (null == ifMatch || null == ETag) return 1; + + for( int i=0; i < ifMatch.length; i++ ) + { + if (ifMatch[i].equals( ETag )) return 2; + } + return -1; + } + + /** + * None of the given ETags in the "If-None-Match" can match the ETag parameter for this + * function to pass. + * + * @param ETag - an MD5 signature of the content of the data being stored in S3 + * @return a negative value means that the test has failed, + * a positive value means that the test succeeded or could not be done (so ignore it) + */ + public int ifNoneMatchEtag( String ETag ) + { + if (null == ifNoneMatch || null == ETag) return 1; + + for( int i=0; i < ifNoneMatch.length; i++ ) + { + if (ifNoneMatch[i].equals( ETag )) return -1; + } + return 2; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3CopyObjectRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3CopyObjectRequest.java index 48b66b7c463..1746db79a8f 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3CopyObjectRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3CopyObjectRequest.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /** * */ diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3CopyObjectResponse.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3CopyObjectResponse.java index b75a12ff48b..934221e5556 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3CopyObjectResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3CopyObjectResponse.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.s3; import java.util.Calendar; diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketConfiguration.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketConfiguration.java index f47f40c3a6a..5b47b3a4727 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketConfiguration.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketConfiguration.java @@ -1,42 +1,58 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import com.cloud.bridge.util.XElement; -import com.cloud.bridge.util.XSerializer; - -/** - * @author Kelven Yang - */ -public class S3CreateBucketConfiguration { - @XElement(name="LocationConstraint") - private String location; - - static { - XSerializer.registerRootType("CreateBucketConfiguration", S3CreateBucketConfiguration.class); - } - - public S3CreateBucketConfiguration() { - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import com.cloud.bridge.util.XElement; +import com.cloud.bridge.util.XSerializer; + +/** + * @author Kelven Yang + */ +public class S3CreateBucketConfiguration { + @XElement(name="LocationConstraint") + private String location; + + static { + XSerializer.registerRootType("CreateBucketConfiguration", S3CreateBucketConfiguration.class); + } + + public S3CreateBucketConfiguration() { + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketRequest.java index fb494743293..fba27946ebb 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketRequest.java @@ -1,62 +1,78 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3CreateBucketRequest extends S3Request { - protected String bucketName; - protected S3CreateBucketConfiguration config; - protected String cannedAccessPolicy; // -> REST only sets an acl with a simple keyword - protected S3AccessControlList acl; - - public S3CreateBucketRequest() { - super(); - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public S3CreateBucketConfiguration getConfig() { - return config; - } - - public void setConfig(S3CreateBucketConfiguration config) { - this.config = config; - } - - public String getCannedAccess() { - return cannedAccessPolicy; - } - - public void setCannedAccess(String cannedAccessPolicy) { - this.cannedAccessPolicy = cannedAccessPolicy; - } - - public S3AccessControlList getAcl() { - return acl; - } - - public void setAcl(S3AccessControlList acl) { - this.acl = acl; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3CreateBucketRequest extends S3Request { + protected String bucketName; + protected S3CreateBucketConfiguration config; + protected String cannedAccessPolicy; // -> REST only sets an acl with a simple keyword + protected S3AccessControlList acl; + + public S3CreateBucketRequest() { + super(); + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public S3CreateBucketConfiguration getConfig() { + return config; + } + + public void setConfig(S3CreateBucketConfiguration config) { + this.config = config; + } + + public String getCannedAccess() { + return cannedAccessPolicy; + } + + public void setCannedAccess(String cannedAccessPolicy) { + this.cannedAccessPolicy = cannedAccessPolicy; + } + + public S3AccessControlList getAcl() { + return acl; + } + + public void setAcl(S3AccessControlList acl) { + this.acl = acl; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketResponse.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketResponse.java index f37753a1acb..232a80f3ebe 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3CreateBucketResponse.java @@ -1,35 +1,51 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3CreateBucketResponse extends S3Response { - protected String bucketName; - - public S3CreateBucketResponse() { - super(); - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3CreateBucketResponse extends S3Response { + protected String bucketName; + + public S3CreateBucketResponse() { + super(); + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3DeleteBucketRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3DeleteBucketRequest.java index 16155e0f971..67d4f2d3946 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3DeleteBucketRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3DeleteBucketRequest.java @@ -1,35 +1,51 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3DeleteBucketRequest extends S3Request { - protected String bucketName; - - public S3DeleteBucketRequest() { - super(); - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3DeleteBucketRequest extends S3Request { + protected String bucketName; + + public S3DeleteBucketRequest() { + super(); + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3DeleteObjectRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3DeleteObjectRequest.java index a6f6deef774..b4e69560224 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3DeleteObjectRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3DeleteObjectRequest.java @@ -1,54 +1,70 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3DeleteObjectRequest extends S3Request { - protected String bucketName; - protected String key; - protected String version; - - public S3DeleteObjectRequest() { - super(); - version = null; - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3DeleteObjectRequest extends S3Request { + protected String bucketName; + protected String key; + protected String version; + + public S3DeleteObjectRequest() { + super(); + version = null; + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java index 4b04d3db711..73a1aac054c 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java @@ -1,1879 +1,1895 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.Random; -import java.util.Set; -import java.util.TimeZone; -import java.util.UUID; - -import javax.servlet.http.HttpServletResponse; - -import org.apache.log4j.Logger; -import org.hibernate.LockMode; -import org.hibernate.Session; -import org.json.simple.parser.ParseException; - -import com.cloud.bridge.io.S3FileSystemBucketAdapter; -import com.cloud.bridge.model.MHost; -import com.cloud.bridge.model.MHostMount; -import com.cloud.bridge.model.SAcl; -import com.cloud.bridge.model.SBucket; -import com.cloud.bridge.model.SHost; -import com.cloud.bridge.model.SMeta; -import com.cloud.bridge.model.SObject; -import com.cloud.bridge.model.SObjectItem; -import com.cloud.bridge.persist.PersistContext; -import com.cloud.bridge.persist.dao.BucketPolicyDao; -import com.cloud.bridge.persist.dao.MHostDao; -import com.cloud.bridge.persist.dao.MHostMountDao; -import com.cloud.bridge.persist.dao.MultipartLoadDao; -import com.cloud.bridge.persist.dao.SAclDao; -import com.cloud.bridge.persist.dao.SBucketDao; -import com.cloud.bridge.persist.dao.SHostDao; -import com.cloud.bridge.persist.dao.SMetaDao; -import com.cloud.bridge.persist.dao.SObjectDao; -import com.cloud.bridge.persist.dao.SObjectItemDao; -import com.cloud.bridge.service.S3Constants; -import com.cloud.bridge.service.UserContext; -import com.cloud.bridge.service.controller.s3.ServiceProvider; -import com.cloud.bridge.service.core.s3.S3BucketPolicy.PolicyAccess; -import com.cloud.bridge.service.core.s3.S3CopyObjectRequest.MetadataDirective; -import com.cloud.bridge.service.core.s3.S3PolicyAction.PolicyActions; -import com.cloud.bridge.service.core.s3.S3PolicyCondition.ConditionKeys; -import com.cloud.bridge.service.exception.HostNotMountedException; -import com.cloud.bridge.service.exception.InternalErrorException; -import com.cloud.bridge.service.exception.InvalidBucketName; -import com.cloud.bridge.service.exception.NoSuchObjectException; -import com.cloud.bridge.service.exception.ObjectAlreadyExistsException; -import com.cloud.bridge.service.exception.OutOfServiceException; -import com.cloud.bridge.service.exception.OutOfStorageException; -import com.cloud.bridge.service.exception.PermissionDeniedException; -import com.cloud.bridge.service.exception.UnsupportedException; -import com.cloud.bridge.util.DateHelper; -import com.cloud.bridge.util.PolicyParser; -import com.cloud.bridge.util.StringHelper; -import com.cloud.bridge.util.OrderedPair; -import com.cloud.bridge.util.Triple; - -/** - * @author Kelven Yang, John Zucker - * The CRUD control actions to be invoked from S3BucketAction or S3ObjectAction. - */ -public class S3Engine { - protected final static Logger logger = Logger.getLogger(S3Engine.class); - - private final int LOCK_ACQUIRING_TIMEOUT_SECONDS = 10; // ten seconds - - private final Map bucketAdapters = new HashMap(); - - public S3Engine() { - bucketAdapters.put(SHost.STORAGE_HOST_TYPE_LOCAL, new S3FileSystemBucketAdapter()); - } - - - /** - * Return a S3CopyObjectResponse which represents an object being copied from source - * to destination bucket. - * Called from S3ObjectAction when copying an object. - * This can be treated as first a GET followed by a PUT of the object the user wants to copy. - */ - - public S3CopyObjectResponse handleRequest(S3CopyObjectRequest request) - { - S3CopyObjectResponse response = new S3CopyObjectResponse(); - - // [A] Get the object we want to copy - S3GetObjectRequest getRequest = new S3GetObjectRequest(); - getRequest.setBucketName(request.getSourceBucketName()); - getRequest.setKey(request.getSourceKey()); - getRequest.setVersion(request.getVersion()); - getRequest.setConditions( request.getConditions()); - - getRequest.setInlineData( true ); - getRequest.setReturnData( true ); - if ( MetadataDirective.COPY == request.getDirective()) - getRequest.setReturnMetadata( true ); - else getRequest.setReturnMetadata( false ); - - //-> before we do anything verify the permissions on a copy basis - String destinationBucketName = request.getDestinationBucketName(); - String destinationKeyName = request.getDestinationKey(); - S3PolicyContext context = new S3PolicyContext( PolicyActions.PutObject, destinationBucketName ); - context.setKeyName( destinationKeyName ); - context.setEvalParam( ConditionKeys.MetaData, request.getDirective().toString()); - context.setEvalParam( ConditionKeys.CopySource, "/" + request.getSourceBucketName() + "/" + request.getSourceKey()); - if (PolicyAccess.DENY == verifyPolicy( context )) - throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" ); - - S3GetObjectResponse originalObject = handleRequest(getRequest); - int resultCode = originalObject.getResultCode(); - if (200 != resultCode) { - response.setResultCode( resultCode ); - response.setResultDescription( originalObject.getResultDescription()); - return response; - } - - response.setCopyVersion( originalObject.getVersion()); - - - // [B] Put the object into the destination bucket - S3PutObjectInlineRequest putRequest = new S3PutObjectInlineRequest(); - putRequest.setBucketName(request.getDestinationBucketName()) ; - putRequest.setKey(destinationKeyName); - if ( MetadataDirective.COPY == request.getDirective()) - putRequest.setMetaEntries(originalObject.getMetaEntries()); - else putRequest.setMetaEntries(request.getMetaEntries()); - putRequest.setAcl(request.getAcl()); // -> if via a SOAP call - putRequest.setCannedAccess(request.getCannedAccess()); // -> if via a REST call - putRequest.setContentLength(originalObject.getContentLength()); - putRequest.setData(originalObject.getData()); - - S3PutObjectInlineResponse putResp = handleRequest(putRequest); - response.setResultCode( putResp.resultCode ); - response.setResultDescription( putResp.getResultDescription()); - response.setETag( putResp.getETag()); - response.setLastModified( putResp.getLastModified()); - response.setPutVersion( putResp.getVersion()); - return response; - } - - public S3CreateBucketResponse handleRequest(S3CreateBucketRequest request) - { - S3CreateBucketResponse response = new S3CreateBucketResponse(); - String cannedAccessPolicy = request.getCannedAccess(); - String bucketName = request.getBucketName(); - response.setBucketName( bucketName ); - - verifyBucketName( bucketName, false ); - - S3PolicyContext context = new S3PolicyContext( PolicyActions.CreateBucket, bucketName ); - context.setEvalParam( ConditionKeys.Acl, cannedAccessPolicy ); - if (PolicyAccess.DENY == verifyPolicy( context )) - throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" ); - - if (PersistContext.acquireNamedLock("bucket.creation", LOCK_ACQUIRING_TIMEOUT_SECONDS)) - { - OrderedPair shost_storagelocation_pair = null; - boolean success = false; - try { - SBucketDao bucketDao = new SBucketDao(); - SAclDao aclDao = new SAclDao(); - - if (bucketDao.getByName(request.getBucketName()) != null) - throw new ObjectAlreadyExistsException("Bucket already exists"); - - shost_storagelocation_pair = allocBucketStorageHost(request.getBucketName(), null); - - SBucket sbucket = new SBucket(); - sbucket.setName(request.getBucketName()); - sbucket.setCreateTime(DateHelper.currentGMTTime()); - sbucket.setOwnerCanonicalId( UserContext.current().getCanonicalUserId()); - sbucket.setShost(shost_storagelocation_pair.getFirst()); - shost_storagelocation_pair.getFirst().getBuckets().add(sbucket); - bucketDao.save(sbucket); - - S3AccessControlList acl = request.getAcl(); - - if ( null != cannedAccessPolicy ) - setCannedAccessControls( cannedAccessPolicy, "SBucket", sbucket.getId(), sbucket ); - else if (null != acl) - aclDao.save( "SBucket", sbucket.getId(), acl ); - else setSingleAcl( "SBucket", sbucket.getId(), SAcl.PERMISSION_FULL ); - - // explicitly commit the transaction - PersistContext.commitTransaction(); - success = true; - } - finally - { - if(!success && shost_storagelocation_pair != null) { - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(shost_storagelocation_pair.getFirst()); - bucketAdapter.deleteContainer(shost_storagelocation_pair.getSecond(), request.getBucketName()); - } - PersistContext.rollbackTransaction(false); - PersistContext.releaseNamedLock("bucket.creation"); - } - - } else { - throw new OutOfServiceException("Unable to acquire synchronization lock"); - } - - return response; - } - - /** - * Return a S3Response which represents the effect of an object being deleted from its bucket. - * Called from S3BucketAction when deleting an object. - */ - - public S3Response handleRequest( S3DeleteBucketRequest request ) - { - S3Response response = new S3Response(); - SBucketDao bucketDao = new SBucketDao(); - String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName( bucketName ); - - if ( sbucket != null ) - { - S3PolicyContext context = new S3PolicyContext( PolicyActions.DeleteBucket, bucketName ); - switch( verifyPolicy( context )) - { - case ALLOW: - // The bucket policy can give users permission to delete a bucket whereas ACLs cannot - break; - - case DENY: - throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" ); - - case DEFAULT_DENY: - default: - // Irrespective of what the ACLs say, only the owner can delete a bucket - String client = UserContext.current().getCanonicalUserId(); - if (!client.equals( sbucket.getOwnerCanonicalId())) { - throw new PermissionDeniedException( "Access Denied - only the owner can delete a bucket" ); - } - break; - } - - - // Delete the file from its storage location - OrderedPair host_storagelocation_pair = getBucketStorageHost(sbucket); - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); - bucketAdapter.deleteContainer(host_storagelocation_pair.getSecond(), request.getBucketName()); - - // Cascade-deleting can delete related SObject/SObjectItem objects, but not SAcl, SMeta and policy objects. - // To delete SMeta & SAcl objects: - // (1)Get all the objects in the bucket, - // (2)then all the items in each object, - // (3) then all meta & acl data for each item - Set objectsInBucket = sbucket.getObjectsInBucket(); - Iterator it = objectsInBucket.iterator(); - while( it.hasNext()) - { - SObject oneObject = (SObject)it.next(); - Set itemsInObject = oneObject.getItems(); - Iterator is = itemsInObject.iterator(); - while( is.hasNext()) - { - SObjectItem oneItem = (SObjectItem)is.next(); - deleteMetaData( oneItem.getId()); - deleteObjectAcls( "SObjectItem", oneItem.getId()); - } - } - - // Delete all the policy state associated with the bucket - try { - ServiceProvider.getInstance().deleteBucketPolicy( bucketName ); - BucketPolicyDao policyDao = new BucketPolicyDao(); - policyDao.deletePolicy( bucketName ); - } - catch( Exception e ) { - logger.error("When deleting a bucket we must try to delete its policy: ", e); - } - - deleteBucketAcls( sbucket.getId()); - bucketDao.delete( sbucket ); - response.setResultCode(204); - response.setResultDescription("OK"); - } - else - { response.setResultCode(404); - response.setResultDescription("Bucket does not exist"); - } - return response; - } - - /** - * Return a S3ListBucketResponse which represents a list of up to 1000 objects contained ins the bucket. - * Called from S3BucketAction for GETting objects and for GETting object versions. - */ - - public S3ListBucketResponse listBucketContents(S3ListBucketRequest request, boolean includeVersions) - { - S3ListBucketResponse response = new S3ListBucketResponse(); - String bucketName = request.getBucketName(); - String prefix = request.getPrefix(); - if (prefix == null) prefix = StringHelper.EMPTY_STRING; - String marker = request.getMarker(); - if (marker == null) marker = StringHelper.EMPTY_STRING; - - String delimiter = request.getDelimiter(); - int maxKeys = request.getMaxKeys(); - if(maxKeys <= 0) maxKeys = 1000; - - SBucketDao bucketDao = new SBucketDao(); - SBucket sbucket = bucketDao.getByName(bucketName); - if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); - - PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket); - S3PolicyContext context = new S3PolicyContext( action, bucketName ); - context.setEvalParam( ConditionKeys.MaxKeys, new String( "" + maxKeys )); - context.setEvalParam( ConditionKeys.Prefix, prefix ); - context.setEvalParam( ConditionKeys.Delimiter, delimiter ); - verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ ); - - - // Wen execting the query, request one more item so that we know how to set isTruncated flag - SObjectDao sobjectDao = new SObjectDao(); - List l = null; - - if ( includeVersions ) - l = sobjectDao.listAllBucketObjects( sbucket, prefix, marker, maxKeys+1 ); - else l = sobjectDao.listBucketObjects( sbucket, prefix, marker, maxKeys+1 ); - - response.setBucketName(bucketName); - response.setMarker(marker); - response.setMaxKeys(maxKeys); - response.setPrefix(prefix); - response.setDelimiter(delimiter); - response.setTruncated(l.size() > maxKeys); - if(l.size() > maxKeys) { - response.setNextMarker(l.get(l.size() - 1).getNameKey()); - } - - // If needed - SOAP response does not support versioning - response.setContents( composeListBucketContentEntries(l, prefix, delimiter, maxKeys, includeVersions, request.getVersionIdMarker())); - response.setCommonPrefixes( composeListBucketPrefixEntries(l, prefix, delimiter, maxKeys)); - return response; - } - - /** - * Return a S3ListAllMyBucketResponse which represents a list of all buckets owned by the requester. - * Called from S3BucketAction for GETting all buckets. - * To check on bucket policies defined we have to (look for and) evaluate the policy on each - * bucket the user owns. - */ - public S3ListAllMyBucketsResponse handleRequest(S3ListAllMyBucketsRequest request) - { - S3ListAllMyBucketsResponse response = new S3ListAllMyBucketsResponse(); - SBucketDao bucketDao = new SBucketDao(); - - // "...you can only list buckets for which you are the owner." - List buckets = bucketDao.listBuckets(UserContext.current().getCanonicalUserId()); - S3CanonicalUser owner = new S3CanonicalUser(); - owner.setID(UserContext.current().getCanonicalUserId()); - owner.setDisplayName(""); - response.setOwner(owner); - - if (buckets != null) - { - S3ListAllMyBucketsEntry[] entries = new S3ListAllMyBucketsEntry[buckets.size()]; - int i = 0; - for(SBucket bucket : buckets) - { - String bucketName = bucket.getName(); - S3PolicyContext context = new S3PolicyContext( PolicyActions.ListAllMyBuckets, bucketName ); - verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_PASS ); - - entries[i] = new S3ListAllMyBucketsEntry(); - entries[i].setName(bucketName); - entries[i].setCreationDate(DateHelper.toCalendar(bucket.getCreateTime())); - i++; - } - response.setBuckets(entries); - } - return response; - } - - /** - * Return an S3Response representing the result of PUTTING the ACL of a given bucket. - * Called from S3BucketAction to PUT its ACL. - */ - - public S3Response handleRequest(S3SetBucketAccessControlPolicyRequest request) - { - S3Response response = new S3Response(); - SBucketDao bucketDao = new SBucketDao(); - String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName(bucketName); - if(sbucket == null) { - response.setResultCode(404); - response.setResultDescription("Bucket does not exist"); - return response; - } - - S3PolicyContext context = new S3PolicyContext( PolicyActions.PutBucketAcl, bucketName ); - verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_WRITE_ACL ); - - SAclDao aclDao = new SAclDao(); - aclDao.save("SBucket", sbucket.getId(), request.getAcl()); - - response.setResultCode(200); - response.setResultDescription("OK"); - return response; - } - - - /** - * Return a S3AccessControlPolicy representing the ACL of a given bucket. - * Called from S3BucketAction to GET its ACL. - */ - - public S3AccessControlPolicy handleRequest(S3GetBucketAccessControlPolicyRequest request) - { - S3AccessControlPolicy policy = new S3AccessControlPolicy(); - SBucketDao bucketDao = new SBucketDao(); - String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName( bucketName ); - if (sbucket == null) - throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); - - S3CanonicalUser owner = new S3CanonicalUser(); - owner.setID(sbucket.getOwnerCanonicalId()); - owner.setDisplayName(""); - policy.setOwner(owner); - - S3PolicyContext context = new S3PolicyContext( PolicyActions.GetBucketAcl, bucketName ); - verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ_ACL ); - - SAclDao aclDao = new SAclDao(); - List grants = aclDao.listGrants("SBucket", sbucket.getId()); - policy.setGrants(S3Grant.toGrants(grants)); - return policy; - } - - /** - * This method should be called if a multipart upload is aborted OR has completed successfully and - * the individual parts have to be cleaned up. - * Called from S3ObjectAction when executing at completion or when aborting multipart upload. - * @param bucketName - * @param uploadId - * @param verifyPermission - If false then do not check the user's permission to clean up the state - */ - public int freeUploadParts(String bucketName, int uploadId, boolean verifyPermission) - { - // -> we need to look up the final bucket to figure out which mount point to use to save the part in - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); - if (bucket == null) { - logger.error( "initiateMultipartUpload failed since " + bucketName + " does not exist" ); - return 404; - } - - OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); - - try { - MultipartLoadDao uploadDao = new MultipartLoadDao(); - OrderedPair exists = uploadDao.multipartExits( uploadId ); - if (null == exists) { - logger.error( "initiateMultipartUpload failed since multipart upload" + uploadId + " does not exist" ); - return 404; - } - - // -> the multipart initiator or bucket owner can do this action by default - if (verifyPermission) - { - String initiator = uploadDao.getInitiator( uploadId ); - if (null == initiator || !initiator.equals( UserContext.current().getAccessKey())) - { - // -> write permission on a bucket allows a PutObject / DeleteObject action on any object in the bucket - S3PolicyContext context = new S3PolicyContext( PolicyActions.AbortMultipartUpload, bucketName ); - context.setKeyName( exists.getSecond()); - verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); - } - } - - // -> first get a list of all the uploaded files and delete one by one - S3MultipartPart[] parts = uploadDao.getParts( uploadId, 10000, 0 ); - for( int i=0; i < parts.length; i++ ) - { - bucketAdapter.deleteObject( host_storagelocation_pair.getSecond(), ServiceProvider.getInstance().getMultipartDir(), parts[i].getPath()); - } - - uploadDao.deleteUpload( uploadId ); - return 204; - - } - catch( PermissionDeniedException e ) { - logger.error("freeUploadParts failed due to [" + e.getMessage() + "]", e); - throw e; - } - catch (Exception e) { - logger.error("freeUploadParts failed due to [" + e.getMessage() + "]", e); - return 500; - } - } - - /** - * The initiator must have permission to write to the bucket in question in order to initiate - * a multipart upload. Also check to make sure the special folder used to store parts of - * a multipart exists for this bucket. - * Called from S3ObjectAction during many stages of multipart upload. - */ - public S3PutObjectInlineResponse initiateMultipartUpload(S3PutObjectInlineRequest request) - { - S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); - String bucketName = request.getBucketName(); - String nameKey = request.getKey(); - - // -> does the bucket exist and can we write to it? - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); - if (bucket == null) { - logger.error( "initiateMultipartUpload failed since " + bucketName + " does not exist" ); - response.setResultCode(404); - } - - S3PolicyContext context = new S3PolicyContext( PolicyActions.PutObject, bucketName ); - context.setKeyName( nameKey ); - context.setEvalParam( ConditionKeys.Acl, request.getCannedAccess()); - verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); - - createUploadFolder( bucketName ); - - try { - MultipartLoadDao uploadDao = new MultipartLoadDao(); - int uploadId = uploadDao.initiateUpload( UserContext.current().getAccessKey(), bucketName, nameKey, request.getCannedAccess(), request.getMetaEntries()); - response.setUploadId( uploadId ); - response.setResultCode(200); - - } catch( Exception e ) { - logger.error("initiateMultipartUpload exception: ", e); - response.setResultCode(500); - } - - return response; - } - - /** - * Save the object fragment in a special (i.e., hidden) directory inside the same mount point as - * the bucket location that the final object will be stored in. - * Called from S3ObjectAction during many stages of multipart upload. - * @param request - * @param uploadId - * @param partNumber - * @return S3PutObjectInlineResponse - */ - public S3PutObjectInlineResponse saveUploadPart(S3PutObjectInlineRequest request, int uploadId, int partNumber) - { - S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); - String bucketName = request.getBucketName(); - - // -> we need to look up the final bucket to figure out which mount point to use to save the part in - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); - if (bucket == null) { - logger.error( "saveUploadedPart failed since " + bucketName + " does not exist" ); - response.setResultCode(404); - } - S3PolicyContext context = new S3PolicyContext( PolicyActions.PutObject, bucketName ); - context.setKeyName( request.getKey()); - verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); - - OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); - String itemFileName = new String( uploadId + "-" + partNumber ); - InputStream is = null; - - try { - is = request.getDataInputStream(); - String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), ServiceProvider.getInstance().getMultipartDir(), itemFileName); - response.setETag(md5Checksum); - - MultipartLoadDao uploadDao = new MultipartLoadDao(); - uploadDao.savePart( uploadId, partNumber, md5Checksum, itemFileName, (int)request.getContentLength()); - response.setResultCode(200); - - } catch (IOException e) { - logger.error("UploadPart failed due to " + e.getMessage(), e); - response.setResultCode(500); - } catch (OutOfStorageException e) { - logger.error("UploadPart failed due to " + e.getMessage(), e); - response.setResultCode(500); - } catch (Exception e) { - logger.error("UploadPart failed due to " + e.getMessage(), e); - response.setResultCode(500); - } finally { - if(is != null) { - try { - is.close(); - } catch (IOException e) { - logger.error("UploadPart unable to close stream from data handler.", e); - } - } - } - - return response; - } - - /** - * Create the real object represented by all the parts of the multipart upload. - * Called from S3ObjectAction at completion of multipart upload. - * @param httpResp - Servlet response handle to return the headers of the response (including version header) - * @param request - Normal parameters needed to create a new object (including metadata) - * @param parts - List of files that make up the multipart - * @param outputStream - Response output stream - * N.B. - This method can be long-lasting - * We are required to keep the connection alive by returning whitespace characters back periodically. - */ - - public S3PutObjectInlineResponse concatentateMultipartUploads(HttpServletResponse httpResp, S3PutObjectInlineRequest request, S3MultipartPart[] parts, OutputStream outputStream) throws IOException - { - // [A] Set up and initial error checking - S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); - String bucketName = request.getBucketName(); - String key = request.getKey(); - S3MetaDataEntry[] meta = request.getMetaEntries(); - - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); - if (bucket == null) { - logger.error( "completeMultipartUpload( failed since " + bucketName + " does not exist" ); - response.setResultCode(404); - } - - // [B] Now we need to create the final re-assembled object - // -> the allocObjectItem checks for the bucket policy PutObject permissions - OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, null, request.getCannedAccess()); - OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); - - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); - String itemFileName = object_objectitem_pair.getSecond().getStoredPath(); - - // -> Amazon defines that we must return a 200 response immediately to the client, but - // -> we don't know the version header until we hit here - httpResp.setStatus(200); - httpResp.setContentType("text/xml; charset=UTF-8"); - String version = object_objectitem_pair.getSecond().getVersion(); - if (null != version) httpResp.addHeader( "x-amz-version-id", version ); - httpResp.flushBuffer(); - - - // [C] Re-assemble the object from its uploaded file parts - try { - // explicit transaction control to avoid holding transaction during long file concatenation process - PersistContext.commitTransaction(); - - OrderedPair result = bucketAdapter. - concatentateObjects - ( host_storagelocation_pair.getSecond(), - bucket.getName(), - itemFileName, - ServiceProvider.getInstance().getMultipartDir(), - parts, - outputStream ); - response.setETag(result.getFirst()); - response.setLastModified(DateHelper.toCalendar( object_objectitem_pair.getSecond().getLastModifiedTime())); - - SObjectItemDao itemDao = new SObjectItemDao(); - SObjectItem item = itemDao.get( object_objectitem_pair.getSecond().getId()); - item.setMd5(result.getFirst()); - item.setStoredSize(result.getSecond().longValue()); - response.setResultCode(200); - - PersistContext.getSession().save(item); - } - catch (Exception e) { - logger.error("completeMultipartUpload failed due to " + e.getMessage(), e); - } - return response; - } - - /** - * Return a S3PutObjectInlineResponse which represents an object being created into a bucket - * Called from S3ObjectAction when PUTting or POTing an object. - */ - - public S3PutObjectInlineResponse handleRequest(S3PutObjectInlineRequest request) - { - S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); - String bucketName = request.getBucketName(); - String key = request.getKey(); - long contentLength = request.getContentLength(); - S3MetaDataEntry[] meta = request.getMetaEntries(); - S3AccessControlList acl = request.getAcl(); - - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); - if (bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); - - - // Is the caller allowed to write the object? - // The allocObjectItem checks for the bucket policy PutObject permissions - OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, acl, request.getCannedAccess()); - OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); - - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); - String itemFileName = object_objectitem_pair.getSecond().getStoredPath(); - InputStream is = null; - - try { - // explicit transaction control to avoid holding transaction during file-copy process - PersistContext.commitTransaction(); - - is = request.getDataInputStream(); - String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), bucket.getName(), itemFileName); - response.setETag(md5Checksum); - response.setLastModified(DateHelper.toCalendar( object_objectitem_pair.getSecond().getLastModifiedTime())); - response.setVersion( object_objectitem_pair.getSecond().getVersion()); - - SObjectItemDao itemDao = new SObjectItemDao(); - SObjectItem item = itemDao.get( object_objectitem_pair.getSecond().getId()); - item.setMd5(md5Checksum); - item.setStoredSize(contentLength); - PersistContext.getSession().save(item); - - } catch (IOException e) { - logger.error("PutObjectInline failed due to " + e.getMessage(), e); - } catch (OutOfStorageException e) { - logger.error("PutObjectInline failed due to " + e.getMessage(), e); - } finally { - if(is != null) { - try { - is.close(); - } catch (IOException e) { - logger.error("PutObjectInline unable to close stream from data handler.", e); - } - } - } - - return response; - } - - /** - * Return a S3PutObjectResponse which represents an object being created into a bucket - * Called from S3RestServlet when processing a DIME request. - */ - - public S3PutObjectResponse handleRequest(S3PutObjectRequest request) - { - S3PutObjectResponse response = new S3PutObjectResponse(); - String bucketName = request.getBucketName(); - String key = request.getKey(); - long contentLength = request.getContentLength(); - S3MetaDataEntry[] meta = request.getMetaEntries(); - S3AccessControlList acl = request.getAcl(); - - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); - if(bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); - - // Is the caller allowed to write the object? - // The allocObjectItem checks for the bucket policy PutObject permissions - OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, acl, null); - OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); - - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); - String itemFileName = object_objectitem_pair.getSecond().getStoredPath(); - InputStream is = null; - try { - // explicit transaction control to avoid holding transaction during file-copy process - PersistContext.commitTransaction(); - - is = request.getInputStream(); - String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), bucket.getName(), itemFileName); - response.setETag(md5Checksum); - response.setLastModified(DateHelper.toCalendar( object_objectitem_pair.getSecond().getLastModifiedTime())); - - SObjectItemDao itemDao = new SObjectItemDao(); - SObjectItem item = itemDao.get( object_objectitem_pair.getSecond().getId()); - item.setMd5(md5Checksum); - item.setStoredSize(contentLength); - PersistContext.getSession().save(item); - - } catch (OutOfStorageException e) { - logger.error("PutObject failed due to " + e.getMessage(), e); - } finally { - if(is != null) { - try { - is.close(); - } catch (IOException e) { - logger.error("Unable to close stream from data handler.", e); - } - } - } - - return response; - } - - /** - * The ACL of an object is set at the object version level. By default, PUT sets the ACL of the latest - * version of an object. To set the ACL of a different version, using the versionId subresource. - * Called from S3ObjectAction to PUT an object's ACL. - */ - - public S3Response handleRequest(S3SetObjectAccessControlPolicyRequest request) - { - S3PolicyContext context = null; - - // [A] First find the object in the bucket - S3Response response = new S3Response(); - SBucketDao bucketDao = new SBucketDao(); - String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName( bucketName ); - if(sbucket == null) { - response.setResultCode(404); - response.setResultDescription("Bucket " + bucketName + "does not exist"); - return response; - } - - SObjectDao sobjectDao = new SObjectDao(); - String nameKey = request.getKey(); - SObject sobject = sobjectDao.getByNameKey( sbucket, nameKey ); - if(sobject == null) { - response.setResultCode(404); - response.setResultDescription("Object " + request.getKey() + " in bucket " + bucketName + " does not exist"); - return response; - } - - String deletionMark = sobject.getDeletionMark(); - if (null != deletionMark) { - response.setResultCode(404); - response.setResultDescription("Object " + request.getKey() + " has been deleted (1)"); - return response; - } - - - // [B] Versioning allow the client to ask for a specific version not just the latest - SObjectItem item = null; - int versioningStatus = sbucket.getVersioningStatus(); - String wantVersion = request.getVersion(); - if ( SBucket.VERSIONING_ENABLED == versioningStatus && null != wantVersion) - item = sobject.getVersion( wantVersion ); - else item = sobject.getLatestVersion(( SBucket.VERSIONING_ENABLED != versioningStatus )); - - if (item == null) { - response.setResultCode(404); - response.setResultDescription("Object " + request.getKey() + " has been deleted (2)"); - return response; - } - - if ( SBucket.VERSIONING_ENABLED == versioningStatus ) { - context = new S3PolicyContext( PolicyActions.PutObjectAclVersion, bucketName ); - context.setEvalParam( ConditionKeys.VersionId, wantVersion ); - response.setVersion( item.getVersion()); - } - else context = new S3PolicyContext( PolicyActions.PutObjectAcl, bucketName ); - context.setKeyName( nameKey ); - verifyAccess( context, "SObjectItem", item.getId(), SAcl.PERMISSION_WRITE_ACL ); - - // -> the acl always goes on the instance of the object - SAclDao aclDao = new SAclDao(); - aclDao.save("SObjectItem", item.getId(), request.getAcl()); - - response.setResultCode(200); - response.setResultDescription("OK"); - return response; - } - - /** - * By default, GET returns ACL information about the latest version of an object. To return ACL - * information about a different version, use the versionId subresource - * Called from S3ObjectAction to get an object's ACL. - */ - - public S3AccessControlPolicy handleRequest(S3GetObjectAccessControlPolicyRequest request) - { - S3PolicyContext context = null; - - // [A] Does the object exist that holds the ACL we are looking for? - S3AccessControlPolicy policy = new S3AccessControlPolicy(); - SBucketDao bucketDao = new SBucketDao(); - String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName( bucketName ); - if (sbucket == null) - throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); - - SObjectDao sobjectDao = new SObjectDao(); - String nameKey = request.getKey(); - SObject sobject = sobjectDao.getByNameKey( sbucket, nameKey ); - if (sobject == null) - throw new NoSuchObjectException("Object " + request.getKey() + " does not exist"); - - String deletionMark = sobject.getDeletionMark(); - if (null != deletionMark) { - policy.setResultCode(404); - policy.setResultDescription("Object " + request.getKey() + " has been deleted (1)"); - return policy; - } - - - // [B] Versioning allow the client to ask for a specific version not just the latest - SObjectItem item = null; - int versioningStatus = sbucket.getVersioningStatus(); - String wantVersion = request.getVersion(); - if ( SBucket.VERSIONING_ENABLED == versioningStatus && null != wantVersion) - item = sobject.getVersion( wantVersion ); - else item = sobject.getLatestVersion(( SBucket.VERSIONING_ENABLED != versioningStatus )); - - if (item == null) { - policy.setResultCode(404); - policy.setResultDescription("Object " + request.getKey() + " has been deleted (2)"); - return policy; - } - - if ( SBucket.VERSIONING_ENABLED == versioningStatus ) { - context = new S3PolicyContext( PolicyActions.GetObjectVersionAcl, bucketName ); - context.setEvalParam( ConditionKeys.VersionId, wantVersion ); - policy.setVersion( item.getVersion()); - } - else context = new S3PolicyContext( PolicyActions.GetObjectAcl, bucketName ); - context.setKeyName( nameKey ); - verifyAccess( context, "SObjectItem", item.getId(), SAcl.PERMISSION_READ_ACL ); - - - // [C] ACLs are ALWAYS on an instance of the object - S3CanonicalUser owner = new S3CanonicalUser(); - owner.setID(sobject.getOwnerCanonicalId()); - owner.setDisplayName(""); - policy.setOwner(owner); - policy.setResultCode(200); - - SAclDao aclDao = new SAclDao(); - List grants = aclDao.listGrants( "SObjectItem", item.getId()); - policy.setGrants(S3Grant.toGrants(grants)); - return policy; - } - - /** - * Handle requests for GET object and HEAD "get object extended" - * Called from S3ObjectAction for GET and HEAD of an object. - */ - - public S3GetObjectResponse handleRequest(S3GetObjectRequest request) - { - S3GetObjectResponse response = new S3GetObjectResponse(); - S3PolicyContext context = null; - boolean ifRange = false; - long bytesStart = request.getByteRangeStart(); - long bytesEnd = request.getByteRangeEnd(); - int resultCode = 200; - - // [A] Verify that the bucket and the object exist - SBucketDao bucketDao = new SBucketDao(); - String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName(bucketName); - if (sbucket == null) { - response.setResultCode(404); - response.setResultDescription("Bucket " + request.getBucketName() + " does not exist"); - return response; - } - - SObjectDao objectDao = new SObjectDao(); - String nameKey = request.getKey(); - SObject sobject = objectDao.getByNameKey( sbucket, nameKey ); - if (sobject == null) { - response.setResultCode(404); - response.setResultDescription("Object " + request.getKey() + " does not exist in bucket " + request.getBucketName()); - return response; - } - - String deletionMark = sobject.getDeletionMark(); - if (null != deletionMark) { - response.setDeleteMarker( deletionMark ); - response.setResultCode(404); - response.setResultDescription("Object " + request.getKey() + " has been deleted (1)"); - return response; - } - - - // [B] Versioning allow the client to ask for a specific version not just the latest - SObjectItem item = null; - int versioningStatus = sbucket.getVersioningStatus(); - String wantVersion = request.getVersion(); - if ( SBucket.VERSIONING_ENABLED == versioningStatus && null != wantVersion) - item = sobject.getVersion( wantVersion ); - else item = sobject.getLatestVersion(( SBucket.VERSIONING_ENABLED != versioningStatus )); - - if (item == null) { - response.setResultCode(404); - response.setResultDescription("Object " + request.getKey() + " has been deleted (2)"); - return response; - } - - if ( SBucket.VERSIONING_ENABLED == versioningStatus ) { - context = new S3PolicyContext( PolicyActions.GetObjectVersion, bucketName ); - context.setEvalParam( ConditionKeys.VersionId, wantVersion ); - } - else context = new S3PolicyContext( PolicyActions.GetObject, bucketName ); - context.setKeyName( nameKey ); - verifyAccess( context, "SObjectItem", item.getId(), SAcl.PERMISSION_READ ); - - - // [C] Handle all the IFModifiedSince ... conditions, and access privileges - // -> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.27 (HTTP If-Range header) - if (request.isReturnCompleteObjectOnConditionFailure() && (0 <= bytesStart && 0 <= bytesEnd)) ifRange = true; - - resultCode = conditionPassed( request.getConditions(), item.getLastModifiedTime(), item.getMd5(), ifRange ); - if ( -1 == resultCode ) { - // -> If-Range implementation, we have to return the entire object - resultCode = 200; - bytesStart = -1; - bytesEnd = -1; - } - else if (200 != resultCode) { - response.setResultCode( resultCode ); - response.setResultDescription( "Precondition Failed" ); - return response; - } - - - // [D] Return the contents of the object inline - // -> extract the meta data that corresponds the specific versioned item - SMetaDao metaDao = new SMetaDao(); - List itemMetaData = metaDao.getByTarget( "SObjectItem", item.getId()); - if (null != itemMetaData) - { - int i = 0; - S3MetaDataEntry[] metaEntries = new S3MetaDataEntry[ itemMetaData.size() ]; - ListIterator it = itemMetaData.listIterator(); - while( it.hasNext()) { - SMeta oneTag = (SMeta)it.next(); - S3MetaDataEntry oneEntry = new S3MetaDataEntry(); - oneEntry.setName( oneTag.getName()); - oneEntry.setValue( oneTag.getValue()); - metaEntries[i++] = oneEntry; - } - response.setMetaEntries( metaEntries ); - } - - // -> support a single byte range - if ( 0 <= bytesStart && 0 <= bytesEnd ) { - response.setContentLength( bytesEnd - bytesStart ); - resultCode = 206; - } - else response.setContentLength( item.getStoredSize()); - - if(request.isReturnData()) - { - response.setETag(item.getMd5()); - response.setLastModified(DateHelper.toCalendar( item.getLastModifiedTime())); - response.setVersion( item.getVersion()); - if (request.isInlineData()) - { - OrderedPair tupleSHostInfo = getBucketStorageHost(sbucket); - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(tupleSHostInfo.getFirst()); - - if ( 0 <= bytesStart && 0 <= bytesEnd ) - response.setData(bucketAdapter.loadObjectRange(tupleSHostInfo.getSecond(), - request.getBucketName(), item.getStoredPath(), bytesStart, bytesEnd )); - else response.setData(bucketAdapter.loadObject(tupleSHostInfo.getSecond(), request.getBucketName(), item.getStoredPath())); - } - } - - response.setResultCode( resultCode ); - response.setResultDescription("OK"); - return response; - } - - /** - * Handle object deletion requests, both versioning and non-versioning requirements. - * Called from S3ObjectAction for deletion. - */ - public S3Response handleRequest(S3DeleteObjectRequest request) - { - // Verify that the bucket and object exist - S3Response response = new S3Response(); - SBucketDao bucketDao = new SBucketDao(); - String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName( bucketName ); - if (sbucket == null) { - response.setResultCode(404); - response.setResultDescription("Bucket dosen't existsBucket " + bucketName + " does not exist"); - return response; - } - - SObjectDao objectDao = new SObjectDao(); - String nameKey = request.getKey(); - SObject sobject = objectDao.getByNameKey( sbucket, nameKey ); - if (sobject == null) { - response.setResultCode(404); - response.setResultDescription("Not FoundNo object with key " + nameKey + " exists in bucket " + bucketName+""); - return response; - } - - - // Discover whether versioning is enabled. If so versioning requires the setting of a deletion marker. - String storedPath = null; - SObjectItem item = null; - int versioningStatus = sbucket.getVersioningStatus(); - if ( SBucket.VERSIONING_ENABLED == versioningStatus ) - { - String wantVersion = request.getVersion(); - S3PolicyContext context = new S3PolicyContext( PolicyActions.DeleteObjectVersion, bucketName ); - context.setKeyName( nameKey ); - context.setEvalParam( ConditionKeys.VersionId, wantVersion ); - verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_WRITE ); - - if (null == wantVersion) { - // If versioning is on and no versionId is given then we just write a deletion marker - sobject.setDeletionMark( UUID.randomUUID().toString()); - objectDao.update( sobject ); - response.setResultDescription("true"+ sobject.getDeletionMark() +""); - } - else { - // Otherwise remove the deletion marker if this has been set - String deletionMarker = sobject.getDeletionMark(); - if (null != deletionMarker && wantVersion.equalsIgnoreCase( deletionMarker )) { - sobject.setDeletionMark( null ); - objectDao.update( sobject ); - response.setResultDescription("" + wantVersion +""); - response.setResultDescription("true"+ sobject.getDeletionMark() +""); - response.setResultCode(204); - return response; - } - - // If versioning is on and the versionId is given (non-null) then delete the object matching that version - if ( null == (item = sobject.getVersion( wantVersion ))) { - response.setResultCode(404); - return response; - } - else { - // Providing versionId is non-null, then just delete the one item that matches the versionId from the database - storedPath = item.getStoredPath(); - sobject.deleteItem( item.getId()); - objectDao.update( sobject ); - response.setResultDescription("" + wantVersion +""); - } - } - } - else - { // If versioning is off then we do delete the null object - S3PolicyContext context = new S3PolicyContext( PolicyActions.DeleteObject, bucketName ); - context.setKeyName( nameKey ); - verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_WRITE ); - - if ( null == (item = sobject.getLatestVersion( true ))) { - response.setResultCode(404); - response.setResultDescription("AccessDeniedAccess Denied"); - return response; - } - else { - // If there is no item with a null version then we are done - if (null == item.getVersion()) { - // Otherwiswe remove the entire object - // Cascade-deleting can delete related SObject/SObjectItem objects, but not SAcl and SMeta objects. - storedPath = item.getStoredPath(); - deleteMetaData( item.getId()); - deleteObjectAcls( "SObjectItem", item.getId()); - objectDao.delete( sobject ); - } - } - } - - // Delete the file holding the object - if (null != storedPath) - { - OrderedPair host_storagelocation_pair = getBucketStorageHost( sbucket ); - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter( host_storagelocation_pair.getFirst()); - bucketAdapter.deleteObject( host_storagelocation_pair.getSecond(), bucketName, storedPath ); - } - - response.setResultCode(204); - return response; - } - - - private void deleteMetaData( long itemId ) { - SMetaDao metaDao = new SMetaDao(); - List itemMetaData = metaDao.getByTarget( "SObjectItem", itemId ); - if (null != itemMetaData) - { - ListIterator it = itemMetaData.listIterator(); - while( it.hasNext()) { - SMeta oneTag = (SMeta)it.next(); - metaDao.delete( oneTag ); - } - } - } - - private void deleteObjectAcls( String target, long itemId ) { - SAclDao aclDao = new SAclDao(); - List itemAclData = aclDao.listGrants( target, itemId ); - if (null != itemAclData) - { - ListIterator it = itemAclData.listIterator(); - while( it.hasNext()) { - SAcl oneTag = (SAcl)it.next(); - aclDao.delete( oneTag ); - } - } - } - - private void deleteBucketAcls( long bucketId ) { - SAclDao aclDao = new SAclDao(); - List bucketAclData = aclDao.listGrants( "SBucket", bucketId ); - if (null != bucketAclData) - { - ListIterator it = bucketAclData.listIterator(); - while( it.hasNext()) { - SAcl oneTag = (SAcl)it.next(); - aclDao.delete( oneTag ); - } - } - } - - private S3ListBucketPrefixEntry[] composeListBucketPrefixEntries(List l, String prefix, String delimiter, int maxKeys) - { - List entries = new ArrayList(); - int count = 0; - - for(SObject sobject : l) - { - if(delimiter != null && !delimiter.isEmpty()) - { - String subName = StringHelper.substringInBetween(sobject.getNameKey(), prefix, delimiter); - if(subName != null) - { - S3ListBucketPrefixEntry entry = new S3ListBucketPrefixEntry(); - if ( prefix != null && prefix.length() > 0) - entry.setPrefix(prefix + delimiter + subName); - else entry.setPrefix(subName); - } - } - count++; - if(count >= maxKeys) break; - } - - if(entries.size() > 0) return entries.toArray(new S3ListBucketPrefixEntry[0]); - return null; - } - - /** - * The 'versionIdMarker' parameter only makes sense if enableVersion is true. - * versionIdMarker is the starting point to return information back. So for example if an - * object has versions 1,2,3,4,5 and the versionIdMarker is '3', then 3,4,5 will be returned - * by this function. If the versionIdMarker is null then all versions are returned. - * - * TODO - how does the versionIdMarker work when there is a deletion marker in the object? - */ - private S3ListBucketObjectEntry[] composeListBucketContentEntries(List l, String prefix, String delimiter, int maxKeys, boolean enableVersion, String versionIdMarker) - { - List entries = new ArrayList(); - SObjectItem latest = null; - boolean hitIdMarker = false; - int count = 0; - - for( SObject sobject : l ) - { - if (delimiter != null && !delimiter.isEmpty()) - { - if (StringHelper.substringInBetween(sobject.getNameKey(), prefix, delimiter) != null) - continue; - } - - if (enableVersion) - { - hitIdMarker = (null == versionIdMarker ? true : false); - - // This supports GET REST calls with /?versions - String deletionMarker = sobject.getDeletionMark(); - if ( null != deletionMarker ) - { - // TODO we should also save the timestamp when something is deleted - S3ListBucketObjectEntry entry = new S3ListBucketObjectEntry(); - entry.setKey(sobject.getNameKey()); - entry.setVersion( deletionMarker ); - entry.setIsLatest( true ); - entry.setIsDeletionMarker( true ); - entry.setLastModified( Calendar.getInstance( TimeZone.getTimeZone("GMT") )); - entry.setOwnerCanonicalId(sobject.getOwnerCanonicalId()); - entry.setOwnerDisplayName(""); - entries.add( entry ); - latest = null; - } - else latest = sobject.getLatestVersion( false ); - - Iterator it = sobject.getItems().iterator(); - while( it.hasNext()) - { - SObjectItem item = (SObjectItem)it.next(); - - if ( !hitIdMarker ) - { - if (item.getVersion().equalsIgnoreCase( versionIdMarker )) { - hitIdMarker = true; - entries.add( toListEntry( sobject, item, latest )); - } - } - else entries.add( toListEntry( sobject, item, latest )); - } - } - else - { // -> if there are multiple versions of an object then just return its last version - Iterator it = sobject.getItems().iterator(); - SObjectItem lastestItem = null; - int maxVersion = 0; - int version = 0; - while(it.hasNext()) - { - SObjectItem item = (SObjectItem)it.next(); - String versionStr = item.getVersion(); - - if ( null != versionStr ) - version = Integer.parseInt(item.getVersion()); - else lastestItem = item; - - // -> if the bucket has versions turned on - if (version > maxVersion) { - maxVersion = version; - lastestItem = item; - } - } - if (lastestItem != null) { - entries.add( toListEntry( sobject, lastestItem, null )); - } - } - - count++; - if(count >= maxKeys) break; - } - - if ( entries.size() > 0 ) - return entries.toArray(new S3ListBucketObjectEntry[0]); - else return null; - } - - private static S3ListBucketObjectEntry toListEntry( SObject sobject, SObjectItem item, SObjectItem latest ) - { - S3ListBucketObjectEntry entry = new S3ListBucketObjectEntry(); - entry.setKey(sobject.getNameKey()); - entry.setVersion( item.getVersion()); - entry.setETag( "\"" + item.getMd5() + "\"" ); - entry.setSize(item.getStoredSize()); - entry.setStorageClass( "STANDARD" ); - entry.setLastModified(DateHelper.toCalendar(item.getLastModifiedTime())); - entry.setOwnerCanonicalId(sobject.getOwnerCanonicalId()); - entry.setOwnerDisplayName(""); - - if (null != latest && item == latest) entry.setIsLatest( true ); - return entry; - } - - private OrderedPair getBucketStorageHost(SBucket bucket) - { - MHostMountDao mountDao = new MHostMountDao(); - - SHost shost = bucket.getShost(); - if(shost.getHostType() == SHost.STORAGE_HOST_TYPE_LOCAL) { - return new OrderedPair(shost, shost.getExportRoot()); - } - - MHostMount mount = mountDao.getHostMount(ServiceProvider.getInstance().getManagementHostId(), shost.getId()); - if(mount != null) { - return new OrderedPair(shost, mount.getMountPath()); - } - - // need to redirect request to other node - throw new HostNotMountedException("Storage host " + shost.getHost() + " is not locally mounted"); - } - - /** - * Locate the folder to hold upload parts at the same mount point as the upload's final bucket - * location. Create the upload folder dynamically. - * - * @param bucketName - */ - private void createUploadFolder(String bucketName) - { - if (PersistContext.acquireNamedLock("bucket.creation", LOCK_ACQUIRING_TIMEOUT_SECONDS)) - { - try { - allocBucketStorageHost(bucketName, ServiceProvider.getInstance().getMultipartDir()); - } - finally { - PersistContext.releaseNamedLock("bucket.creation"); - } - } - } - - /** - * The overrideName is used to create a hidden storage bucket (folder) in the same location - * as the given bucketName. This can be used to create a folder for parts of a multipart - * upload for the associated bucket. - * - * @param bucketName - * @param overrideName - * @return - */ - private OrderedPair allocBucketStorageHost(String bucketName, String overrideName) - { - MHostDao mhostDao = new MHostDao(); - SHostDao shostDao = new SHostDao(); - - MHost mhost = mhostDao.get(ServiceProvider.getInstance().getManagementHostId()); - if(mhost == null) - throw new OutOfServiceException("Temporarily out of service"); - - if(mhost.getMounts().size() > 0) { - Random random = new Random(); - MHostMount[] mounts = (MHostMount[])mhost.getMounts().toArray(); - MHostMount mount = mounts[random.nextInt(mounts.length)]; - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(mount.getShost()); - bucketAdapter.createContainer(mount.getMountPath(), (null != overrideName ? overrideName : bucketName)); - return new OrderedPair(mount.getShost(), mount.getMountPath()); - } - - // To make things simple, only allow one local mounted storage root TODO - Change in the future - String localStorageRoot = ServiceProvider.getInstance().getStartupProperties().getProperty("storage.root"); - if(localStorageRoot != null) { - SHost localSHost = shostDao.getLocalStorageHost(mhost.getId(), localStorageRoot); - if(localSHost == null) - throw new InternalErrorException("storage.root is configured but not initialized"); - - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(localSHost); - bucketAdapter.createContainer(localSHost.getExportRoot(),(null != overrideName ? overrideName : bucketName)); - return new OrderedPair(localSHost, localStorageRoot); - } - - throw new OutOfStorageException("No storage host is available"); - } - - public S3BucketAdapter getStorageHostBucketAdapter(SHost shost) - { - S3BucketAdapter adapter = bucketAdapters.get(shost.getHostType()); - if(adapter == null) - throw new InternalErrorException("Bucket adapter is not installed for host type: " + shost.getHostType()); - - return adapter; - } - - /** - * If acl is set then the cannedAccessPolicy parameter should be null and is ignored. - * The cannedAccessPolicy parameter is for REST Put requests only where a simple set of ACLs can be - * created with a single header value. Note that we do not currently support "anonymous" un-authenticated - * access in our implementation. - * - * @throws IOException - */ - @SuppressWarnings("deprecation") - public OrderedPair allocObjectItem(SBucket bucket, String nameKey, S3MetaDataEntry[] meta, S3AccessControlList acl, String cannedAccessPolicy) - { - SObjectDao objectDao = new SObjectDao(); - SObjectItemDao objectItemDao = new SObjectItemDao(); - SMetaDao metaDao = new SMetaDao(); - SAclDao aclDao = new SAclDao(); - SObjectItem item = null; - int versionSeq = 1; - int versioningStatus = bucket.getVersioningStatus(); - - Session session = PersistContext.getSession(); - - // [A] To write into a bucket the user must have write permission to that bucket - S3PolicyContext context = new S3PolicyContext( PolicyActions.PutObject, bucket.getName()); - context.setKeyName( nameKey ); - context.setEvalParam( ConditionKeys.Acl, cannedAccessPolicy); - - verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); // TODO - check this validates plain POSTs - - // [B] If versioning is off them we over write a null object item - SObject object = objectDao.getByNameKey(bucket, nameKey); - if ( object != null ) - { - // -> if versioning is on create new object items - if ( SBucket.VERSIONING_ENABLED == versioningStatus ) - { - session.lock(object, LockMode.UPGRADE); - versionSeq = object.getNextSequence(); - object.setNextSequence(versionSeq + 1); - session.save(object); - - item = new SObjectItem(); - item.setTheObject(object); - object.getItems().add(item); - item.setVersion(String.valueOf(versionSeq)); - Date ts = DateHelper.currentGMTTime(); - item.setCreateTime(ts); - item.setLastAccessTime(ts); - item.setLastModifiedTime(ts); - session.save(item); - } - else - { // -> find an object item with a null version, can be null - // if bucket started out with versioning enabled and was then suspended - item = objectItemDao.getByObjectIdNullVersion( object.getId()); - if (item == null) - { - item = new SObjectItem(); - item.setTheObject(object); - object.getItems().add(item); - Date ts = DateHelper.currentGMTTime(); - item.setCreateTime(ts); - item.setLastAccessTime(ts); - item.setLastModifiedTime(ts); - session.save(item); - } - } - } - else - { // -> there is no object nor an object item - object = new SObject(); - object.setBucket(bucket); - object.setNameKey(nameKey); - object.setNextSequence(2); - object.setCreateTime(DateHelper.currentGMTTime()); - object.setOwnerCanonicalId(UserContext.current().getCanonicalUserId()); - session.save(object); - - item = new SObjectItem(); - item.setTheObject(object); - object.getItems().add(item); - if (SBucket.VERSIONING_ENABLED == versioningStatus) item.setVersion(String.valueOf(versionSeq)); - Date ts = DateHelper.currentGMTTime(); - item.setCreateTime(ts); - item.setLastAccessTime(ts); - item.setLastModifiedTime(ts); - session.save(item); - } - - - // [C] We will use the item DB id as the file name, MD5/contentLength will be stored later - String suffix = null; - int dotPos = nameKey.lastIndexOf('.'); - if (dotPos >= 0) suffix = nameKey.substring(dotPos); - if ( suffix != null ) - item.setStoredPath(String.valueOf(item.getId()) + suffix); - else item.setStoredPath(String.valueOf(item.getId())); - - metaDao.save("SObjectItem", item.getId(), meta); - - - // [D] Are we setting an ACL along with the object - // -> the ACL is ALWAYS set on a particular instance of the object (i.e., a version) - if ( null != cannedAccessPolicy ) - { - setCannedAccessControls( cannedAccessPolicy, "SObjectItem", item.getId(), bucket ); - } - else if (null == acl || 0 == acl.size()) - { - // -> this is termed the "private" or default ACL, "Owner gets FULL_CONTROL" - setSingleAcl( "SObjectItem", item.getId(), SAcl.PERMISSION_FULL ); - } - else if (null != acl) { - aclDao.save( "SObjectItem", item.getId(), acl ); - } - - session.update(item); - return new OrderedPair(object, item); - } - - - /** - * Access controls that are specified via the "x-amz-acl:" headers in REST requests. - * Note that canned policies can be set when the object's contents are set - */ - public void setCannedAccessControls( String cannedAccessPolicy, String target, long objectId, SBucket bucket ) - { - // Find the permission and symbol for the principal corresponding to the requested cannedAccessPolicy - Triple permission_permission_symbol_triple = - SAcl.getCannedAccessControls(cannedAccessPolicy, target, bucket.getOwnerCanonicalId()); - if ( null == permission_permission_symbol_triple.getThird() ) - setSingleAcl(target, objectId, permission_permission_symbol_triple.getFirst()); - else - { setDefaultAcls( target, - objectId, - permission_permission_symbol_triple.getFirst(), // permission according to ownership of object - permission_permission_symbol_triple.getSecond(), // permission according to ownership of bucket - permission_permission_symbol_triple.getThird() ); // "symbol" to indicate principal or otherwise name of owner - - } - } - - - private void setSingleAcl( String target, long targetId, int permission ) - { - SAclDao aclDao = new SAclDao(); - S3AccessControlList defaultAcl = new S3AccessControlList(); - - // -> if an annoymous request, then do not rewrite the ACL - String userId = UserContext.current().getCanonicalUserId(); - if (0 < userId.length()) - { - S3Grant defaultGrant = new S3Grant(); - defaultGrant.setGrantee(SAcl.GRANTEE_USER); - defaultGrant.setCanonicalUserID( userId ); - defaultGrant.setPermission( permission ); - defaultAcl.addGrant( defaultGrant ); - aclDao.save( target, targetId, defaultAcl ); - } - } - - - /** - * The Cloud Stack API Access key is used for for the Canonical User Id everywhere (buckets and objects). - * - * @param owner - this can be the Cloud Access Key for a bucket owner or one of the - * following special symbols: - * (a) '*' - any principal authenticated user (i.e., any user with a registered Cloud Access Key) - * (b) 'A' - any anonymous principal (i.e., S3 request without an Authorization header) - */ - private void setDefaultAcls( String target, long objectId, int permission1, int permission2, String owner ) - { - SAclDao aclDao = new SAclDao(); - S3AccessControlList defaultAcl = new S3AccessControlList(); - - // -> object owner - S3Grant defaultGrant = new S3Grant(); - defaultGrant.setGrantee(SAcl.GRANTEE_USER); - defaultGrant.setCanonicalUserID( UserContext.current().getCanonicalUserId()); - defaultGrant.setPermission( permission1 ); - defaultAcl.addGrant( defaultGrant ); - - // -> bucket owner - defaultGrant = new S3Grant(); - defaultGrant.setGrantee(SAcl.GRANTEE_USER); - defaultGrant.setCanonicalUserID( owner ); - defaultGrant.setPermission( permission2 ); - defaultAcl.addGrant( defaultGrant ); - aclDao.save( target, objectId, defaultAcl ); - } - - public static PolicyAccess verifyPolicy( S3PolicyContext context ) - { - S3BucketPolicy policy = null; - - // Ordinarily a REST request will pass in an S3PolicyContext for a given bucket by this stage. The HttpServletRequest object - // should be held in the UserContext ready for extraction of the S3BucketPolicy. - // If there is an error in obtaining the request object or in loading the policy then log the failure and return a S3PolicyContext - // which indicates DEFAULT_DENY. Where there is no failure, the policy returned should be specific to the Canonical User ID of the requester. - - try { - // -> in SOAP the HttpServletRequest object is hidden and not passed around - if (null != context) { - context.setHttp( UserContext.current().getHttp()); - policy = loadPolicy( context ); - } - - if ( null != policy ) - return policy.eval(context, UserContext.current().getCanonicalUserId()); - else return PolicyAccess.DEFAULT_DENY; - } - catch( Exception e ) { - logger.error("verifyAccess - loadPolicy failed, bucket: " + context.getBucketName() + " policy ignored", e); - return PolicyAccess.DEFAULT_DENY; - } - } - - /** - * To determine access to a bucket or an object in a bucket evaluate first a define - * bucket policy and then any defined ACLs. - * - * @param context - all data needed for bucket policies - * @param target - used for ACL evaluation, object identifier - * @param targetId - used for ACL evaluation - * @param requestedPermission - ACL type access requested - * - * @throws ParseException, SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException - */ - public static void verifyAccess( S3PolicyContext context, String target, long targetId, int requestedPermission ) - { - switch( verifyPolicy( context ) ) { - case ALLOW: // overrides ACLs (?) - return; - - case DENY: - throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" ); - - case DEFAULT_DENY: - default: - accessAllowed( target, targetId, requestedPermission ); - break; - } - } - - /** - * This method verifies that the accessing client has the requested - * permission on the object/bucket/Acl represented by the tuple: - * - * For cases where an ACL is meant for any authenticated user we place a "*" for the - * Canonical User Id. N.B. - "*" is not a legal Cloud (Bridge) Access key. - * - * For cases where an ACL is meant for any anonymous user (or 'AllUsers') we place a "A" for the - * Canonical User Id. N.B. - "A" is not a legal Cloud (Bridge) Access key. - */ - public static void accessAllowed( String target, long targetId, int requestedPermission ) - { - if (SAcl.PERMISSION_PASS == requestedPermission) return; - - SAclDao aclDao = new SAclDao(); - - // If an annoymous request, then canonicalUserId is an empty string - String userId = UserContext.current().getCanonicalUserId(); - if ( 0 == userId.length()) - { - // Is an anonymous principal ACL set for this ? - if (hasPermission( aclDao.listGrants( target, targetId, "A" ), requestedPermission )) return; - } - else - { - if (hasPermission( aclDao.listGrants( target, targetId, userId ), requestedPermission )) return; - // Or alternatively is there is any principal authenticated ACL set for this ? - if (hasPermission( aclDao.listGrants( target, targetId, "*" ), requestedPermission )) return; - } - // No privileges implies that no access is allowed in the case of an anonymous user - throw new PermissionDeniedException( "Access Denied - ACLs do not give user the required permission" ); - } - - /** - * This method assumes that the bucket has been tested to make sure it exists before - * it is called. - * - * @param context - * @return S3BucketPolicy - * @throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, ParseException - */ - public static S3BucketPolicy loadPolicy( S3PolicyContext context ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException, ParseException - { - OrderedPair result = ServiceProvider.getInstance().getBucketPolicy( context.getBucketName()); - S3BucketPolicy policy = result.getFirst(); - if ( null == policy ) - { - // -> do we have to load it from the database (any other value means there is no policy)? - if (-1 == result.getSecond().intValue()) - { - BucketPolicyDao policyDao = new BucketPolicyDao(); - String policyInJson = policyDao.getPolicy( context.getBucketName()); - // -> place in cache that no policy exists in the database - if (null == policyInJson) { - ServiceProvider.getInstance().setBucketPolicy(context.getBucketName(), null); - return null; - } - - PolicyParser parser = new PolicyParser(); - policy = parser.parse( policyInJson, context.getBucketName()); - if (null != policy) - ServiceProvider.getInstance().setBucketPolicy(context.getBucketName(), policy); - } - } - return policy; - } - - public static void verifyBucketName( String bucketName, boolean useDNSGuidelines ) throws InvalidBucketName - { - // [A] To comply with Amazon S3 basic requirements, bucket names must meet the following conditions - // -> must be between 3 and 255 characters long - int size = bucketName.length(); - if (3 > size || size > 255) - throw new InvalidBucketName( bucketName + " is not between 3 and 255 characters long" ); - - // -> must start with a number or letter - if (!Character.isLetterOrDigit( bucketName.charAt( 0 ))) - throw new InvalidBucketName( bucketName + " does not start with a number or letter" ); - - // -> can contain lowercase letters, numbers, periods (.), underscores (_), and dashes (-) - // -> the bucket name can also contain uppercase letters but it is not recommended - for( int i=0; i < bucketName.length(); i++ ) - { - char next = bucketName.charAt(i); - if (Character.isLetter( next )) continue; - else if (Character.isDigit( next )) continue; - else if ('.' == next) continue; - else if ('_' == next) continue; - else if ('-' == next) continue; - else throw new InvalidBucketName( bucketName + " contains the invalid character: " + next ); - } - - // -> must not be formatted as an IP address (e.g., 192.168.5.4) - String[] parts = bucketName.split( "\\." ); - if (4 == parts.length) - { - try { - int first = Integer.parseInt( parts[0] ); - int second = Integer.parseInt( parts[1] ); - int third = Integer.parseInt( parts[2] ); - int fourth = Integer.parseInt( parts[3] ); - throw new InvalidBucketName( bucketName + " is formatted as an IP address" ); - } - catch( NumberFormatException e ) - {throw new InvalidBucketName( bucketName);} - } - - - // [B] To conform with DNS requirements, Amazon recommends following these additional guidelines when creating buckets - // -> bucket names should be between 3 and 63 characters long - if (useDNSGuidelines) - { - // -> bucket names should be between 3 and 63 characters long - if (3 > size || size > 63) - throw new InvalidBucketName( "DNS requiremens, bucket name: " + bucketName + " is not between 3 and 63 characters long" ); - - // -> bucket names should not contain underscores (_) - int pos = bucketName.indexOf( '_' ); - if (-1 != pos) - throw new InvalidBucketName( "DNS requiremens, bucket name: " + bucketName + " should not contain underscores" ); - - // -> bucket names should not end with a dash - if (bucketName.endsWith( "-" )) - throw new InvalidBucketName( "DNS requiremens, bucket name: " + bucketName + " should not end with a dash" ); - - // -> bucket names cannot contain two, adjacent periods - pos = bucketName.indexOf( ".." ); - if (-1 != pos) - throw new InvalidBucketName( "DNS requiremens, bucket name: " + bucketName + " should not contain \"..\"" ); - - // -> bucket names cannot contain dashes next to periods (e.g., "my-.bucket.com" and "my.-bucket" are invalid) - if (-1 != bucketName.indexOf( "-." ) || -1 != bucketName.indexOf( ".-" )) - throw new InvalidBucketName( "DNS requiremens, bucket name: " + bucketName + " should not contain \".-\" or \"-.\"" ); - } - } - - private static boolean hasPermission( List privileges, int requestedPermission ) - { - ListIterator it = privileges.listIterator(); - while( it.hasNext()) - { - // True providing the requested permission is contained in one or the granted rights for this user. False otherwise. - SAcl rights = (SAcl)it.next(); - int permission = rights.getPermission(); - if (requestedPermission == (permission & requestedPermission)) return true; - } - return false; - } - - /** - * ifRange is true and ifUnmodifiedSince or IfMatch fails then we return the entire object (indicated by - * returning a -1 as the function result. - * - * @param ifCond - conditional get defined by these tests - * @param lastModified - value used on ifModifiedSince or ifUnmodifiedSince - * @param ETag - value used on ifMatch and ifNoneMatch - * @param ifRange - using an if-Range HTTP functionality - * @return -1 means return the entire object with an HTTP 200 (not a subrange) - */ - private int conditionPassed( S3ConditionalHeaders ifCond, Date lastModified, String ETag, boolean ifRange ) - { - if (null == ifCond) return 200; - - if (0 > ifCond.ifModifiedSince( lastModified )) - return 304; - - if (0 > ifCond.ifUnmodifiedSince( lastModified )) - return (ifRange ? -1 : 412); - - if (0 > ifCond.ifMatchEtag( ETag )) - return (ifRange ? -1 : 412); - - if (0 > ifCond.ifNoneMatchEtag( ETag )) - return 412; - - return 200; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.TimeZone; +import java.util.UUID; + +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.hibernate.LockMode; +import org.hibernate.Session; +import org.json.simple.parser.ParseException; + +import com.cloud.bridge.io.S3FileSystemBucketAdapter; +import com.cloud.bridge.model.MHost; +import com.cloud.bridge.model.MHostMount; +import com.cloud.bridge.model.SAcl; +import com.cloud.bridge.model.SBucket; +import com.cloud.bridge.model.SHost; +import com.cloud.bridge.model.SMeta; +import com.cloud.bridge.model.SObject; +import com.cloud.bridge.model.SObjectItem; +import com.cloud.bridge.persist.PersistContext; +import com.cloud.bridge.persist.dao.BucketPolicyDao; +import com.cloud.bridge.persist.dao.MHostDao; +import com.cloud.bridge.persist.dao.MHostMountDao; +import com.cloud.bridge.persist.dao.MultipartLoadDao; +import com.cloud.bridge.persist.dao.SAclDao; +import com.cloud.bridge.persist.dao.SBucketDao; +import com.cloud.bridge.persist.dao.SHostDao; +import com.cloud.bridge.persist.dao.SMetaDao; +import com.cloud.bridge.persist.dao.SObjectDao; +import com.cloud.bridge.persist.dao.SObjectItemDao; +import com.cloud.bridge.service.S3Constants; +import com.cloud.bridge.service.UserContext; +import com.cloud.bridge.service.controller.s3.ServiceProvider; +import com.cloud.bridge.service.core.s3.S3BucketPolicy.PolicyAccess; +import com.cloud.bridge.service.core.s3.S3CopyObjectRequest.MetadataDirective; +import com.cloud.bridge.service.core.s3.S3PolicyAction.PolicyActions; +import com.cloud.bridge.service.core.s3.S3PolicyCondition.ConditionKeys; +import com.cloud.bridge.service.exception.HostNotMountedException; +import com.cloud.bridge.service.exception.InternalErrorException; +import com.cloud.bridge.service.exception.InvalidBucketName; +import com.cloud.bridge.service.exception.NoSuchObjectException; +import com.cloud.bridge.service.exception.ObjectAlreadyExistsException; +import com.cloud.bridge.service.exception.OutOfServiceException; +import com.cloud.bridge.service.exception.OutOfStorageException; +import com.cloud.bridge.service.exception.PermissionDeniedException; +import com.cloud.bridge.service.exception.UnsupportedException; +import com.cloud.bridge.util.DateHelper; +import com.cloud.bridge.util.PolicyParser; +import com.cloud.bridge.util.StringHelper; +import com.cloud.bridge.util.OrderedPair; +import com.cloud.bridge.util.Triple; + +/** + * @author Kelven Yang, John Zucker + * The CRUD control actions to be invoked from S3BucketAction or S3ObjectAction. + */ +public class S3Engine { + protected final static Logger logger = Logger.getLogger(S3Engine.class); + + private final int LOCK_ACQUIRING_TIMEOUT_SECONDS = 10; // ten seconds + + private final Map bucketAdapters = new HashMap(); + + public S3Engine() { + bucketAdapters.put(SHost.STORAGE_HOST_TYPE_LOCAL, new S3FileSystemBucketAdapter()); + } + + + /** + * Return a S3CopyObjectResponse which represents an object being copied from source + * to destination bucket. + * Called from S3ObjectAction when copying an object. + * This can be treated as first a GET followed by a PUT of the object the user wants to copy. + */ + + public S3CopyObjectResponse handleRequest(S3CopyObjectRequest request) + { + S3CopyObjectResponse response = new S3CopyObjectResponse(); + + // [A] Get the object we want to copy + S3GetObjectRequest getRequest = new S3GetObjectRequest(); + getRequest.setBucketName(request.getSourceBucketName()); + getRequest.setKey(request.getSourceKey()); + getRequest.setVersion(request.getVersion()); + getRequest.setConditions( request.getConditions()); + + getRequest.setInlineData( true ); + getRequest.setReturnData( true ); + if ( MetadataDirective.COPY == request.getDirective()) + getRequest.setReturnMetadata( true ); + else getRequest.setReturnMetadata( false ); + + //-> before we do anything verify the permissions on a copy basis + String destinationBucketName = request.getDestinationBucketName(); + String destinationKeyName = request.getDestinationKey(); + S3PolicyContext context = new S3PolicyContext( PolicyActions.PutObject, destinationBucketName ); + context.setKeyName( destinationKeyName ); + context.setEvalParam( ConditionKeys.MetaData, request.getDirective().toString()); + context.setEvalParam( ConditionKeys.CopySource, "/" + request.getSourceBucketName() + "/" + request.getSourceKey()); + if (PolicyAccess.DENY == verifyPolicy( context )) + throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" ); + + S3GetObjectResponse originalObject = handleRequest(getRequest); + int resultCode = originalObject.getResultCode(); + if (200 != resultCode) { + response.setResultCode( resultCode ); + response.setResultDescription( originalObject.getResultDescription()); + return response; + } + + response.setCopyVersion( originalObject.getVersion()); + + + // [B] Put the object into the destination bucket + S3PutObjectInlineRequest putRequest = new S3PutObjectInlineRequest(); + putRequest.setBucketName(request.getDestinationBucketName()) ; + putRequest.setKey(destinationKeyName); + if ( MetadataDirective.COPY == request.getDirective()) + putRequest.setMetaEntries(originalObject.getMetaEntries()); + else putRequest.setMetaEntries(request.getMetaEntries()); + putRequest.setAcl(request.getAcl()); // -> if via a SOAP call + putRequest.setCannedAccess(request.getCannedAccess()); // -> if via a REST call + putRequest.setContentLength(originalObject.getContentLength()); + putRequest.setData(originalObject.getData()); + + S3PutObjectInlineResponse putResp = handleRequest(putRequest); + response.setResultCode( putResp.resultCode ); + response.setResultDescription( putResp.getResultDescription()); + response.setETag( putResp.getETag()); + response.setLastModified( putResp.getLastModified()); + response.setPutVersion( putResp.getVersion()); + return response; + } + + public S3CreateBucketResponse handleRequest(S3CreateBucketRequest request) + { + S3CreateBucketResponse response = new S3CreateBucketResponse(); + String cannedAccessPolicy = request.getCannedAccess(); + String bucketName = request.getBucketName(); + response.setBucketName( bucketName ); + + verifyBucketName( bucketName, false ); + + S3PolicyContext context = new S3PolicyContext( PolicyActions.CreateBucket, bucketName ); + context.setEvalParam( ConditionKeys.Acl, cannedAccessPolicy ); + if (PolicyAccess.DENY == verifyPolicy( context )) + throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" ); + + if (PersistContext.acquireNamedLock("bucket.creation", LOCK_ACQUIRING_TIMEOUT_SECONDS)) + { + OrderedPair shost_storagelocation_pair = null; + boolean success = false; + try { + SBucketDao bucketDao = new SBucketDao(); + SAclDao aclDao = new SAclDao(); + + if (bucketDao.getByName(request.getBucketName()) != null) + throw new ObjectAlreadyExistsException("Bucket already exists"); + + shost_storagelocation_pair = allocBucketStorageHost(request.getBucketName(), null); + + SBucket sbucket = new SBucket(); + sbucket.setName(request.getBucketName()); + sbucket.setCreateTime(DateHelper.currentGMTTime()); + sbucket.setOwnerCanonicalId( UserContext.current().getCanonicalUserId()); + sbucket.setShost(shost_storagelocation_pair.getFirst()); + shost_storagelocation_pair.getFirst().getBuckets().add(sbucket); + bucketDao.save(sbucket); + + S3AccessControlList acl = request.getAcl(); + + if ( null != cannedAccessPolicy ) + setCannedAccessControls( cannedAccessPolicy, "SBucket", sbucket.getId(), sbucket ); + else if (null != acl) + aclDao.save( "SBucket", sbucket.getId(), acl ); + else setSingleAcl( "SBucket", sbucket.getId(), SAcl.PERMISSION_FULL ); + + // explicitly commit the transaction + PersistContext.commitTransaction(); + success = true; + } + finally + { + if(!success && shost_storagelocation_pair != null) { + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(shost_storagelocation_pair.getFirst()); + bucketAdapter.deleteContainer(shost_storagelocation_pair.getSecond(), request.getBucketName()); + } + PersistContext.rollbackTransaction(false); + PersistContext.releaseNamedLock("bucket.creation"); + } + + } else { + throw new OutOfServiceException("Unable to acquire synchronization lock"); + } + + return response; + } + + /** + * Return a S3Response which represents the effect of an object being deleted from its bucket. + * Called from S3BucketAction when deleting an object. + */ + + public S3Response handleRequest( S3DeleteBucketRequest request ) + { + S3Response response = new S3Response(); + SBucketDao bucketDao = new SBucketDao(); + String bucketName = request.getBucketName(); + SBucket sbucket = bucketDao.getByName( bucketName ); + + if ( sbucket != null ) + { + S3PolicyContext context = new S3PolicyContext( PolicyActions.DeleteBucket, bucketName ); + switch( verifyPolicy( context )) + { + case ALLOW: + // The bucket policy can give users permission to delete a bucket whereas ACLs cannot + break; + + case DENY: + throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" ); + + case DEFAULT_DENY: + default: + // Irrespective of what the ACLs say, only the owner can delete a bucket + String client = UserContext.current().getCanonicalUserId(); + if (!client.equals( sbucket.getOwnerCanonicalId())) { + throw new PermissionDeniedException( "Access Denied - only the owner can delete a bucket" ); + } + break; + } + + + // Delete the file from its storage location + OrderedPair host_storagelocation_pair = getBucketStorageHost(sbucket); + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); + bucketAdapter.deleteContainer(host_storagelocation_pair.getSecond(), request.getBucketName()); + + // Cascade-deleting can delete related SObject/SObjectItem objects, but not SAcl, SMeta and policy objects. + // To delete SMeta & SAcl objects: + // (1)Get all the objects in the bucket, + // (2)then all the items in each object, + // (3) then all meta & acl data for each item + Set objectsInBucket = sbucket.getObjectsInBucket(); + Iterator it = objectsInBucket.iterator(); + while( it.hasNext()) + { + SObject oneObject = (SObject)it.next(); + Set itemsInObject = oneObject.getItems(); + Iterator is = itemsInObject.iterator(); + while( is.hasNext()) + { + SObjectItem oneItem = (SObjectItem)is.next(); + deleteMetaData( oneItem.getId()); + deleteObjectAcls( "SObjectItem", oneItem.getId()); + } + } + + // Delete all the policy state associated with the bucket + try { + ServiceProvider.getInstance().deleteBucketPolicy( bucketName ); + BucketPolicyDao policyDao = new BucketPolicyDao(); + policyDao.deletePolicy( bucketName ); + } + catch( Exception e ) { + logger.error("When deleting a bucket we must try to delete its policy: ", e); + } + + deleteBucketAcls( sbucket.getId()); + bucketDao.delete( sbucket ); + response.setResultCode(204); + response.setResultDescription("OK"); + } + else + { response.setResultCode(404); + response.setResultDescription("Bucket does not exist"); + } + return response; + } + + /** + * Return a S3ListBucketResponse which represents a list of up to 1000 objects contained ins the bucket. + * Called from S3BucketAction for GETting objects and for GETting object versions. + */ + + public S3ListBucketResponse listBucketContents(S3ListBucketRequest request, boolean includeVersions) + { + S3ListBucketResponse response = new S3ListBucketResponse(); + String bucketName = request.getBucketName(); + String prefix = request.getPrefix(); + if (prefix == null) prefix = StringHelper.EMPTY_STRING; + String marker = request.getMarker(); + if (marker == null) marker = StringHelper.EMPTY_STRING; + + String delimiter = request.getDelimiter(); + int maxKeys = request.getMaxKeys(); + if(maxKeys <= 0) maxKeys = 1000; + + SBucketDao bucketDao = new SBucketDao(); + SBucket sbucket = bucketDao.getByName(bucketName); + if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); + + PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket); + S3PolicyContext context = new S3PolicyContext( action, bucketName ); + context.setEvalParam( ConditionKeys.MaxKeys, new String( "" + maxKeys )); + context.setEvalParam( ConditionKeys.Prefix, prefix ); + context.setEvalParam( ConditionKeys.Delimiter, delimiter ); + verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ ); + + + // Wen execting the query, request one more item so that we know how to set isTruncated flag + SObjectDao sobjectDao = new SObjectDao(); + List l = null; + + if ( includeVersions ) + l = sobjectDao.listAllBucketObjects( sbucket, prefix, marker, maxKeys+1 ); + else l = sobjectDao.listBucketObjects( sbucket, prefix, marker, maxKeys+1 ); + + response.setBucketName(bucketName); + response.setMarker(marker); + response.setMaxKeys(maxKeys); + response.setPrefix(prefix); + response.setDelimiter(delimiter); + response.setTruncated(l.size() > maxKeys); + if(l.size() > maxKeys) { + response.setNextMarker(l.get(l.size() - 1).getNameKey()); + } + + // If needed - SOAP response does not support versioning + response.setContents( composeListBucketContentEntries(l, prefix, delimiter, maxKeys, includeVersions, request.getVersionIdMarker())); + response.setCommonPrefixes( composeListBucketPrefixEntries(l, prefix, delimiter, maxKeys)); + return response; + } + + /** + * Return a S3ListAllMyBucketResponse which represents a list of all buckets owned by the requester. + * Called from S3BucketAction for GETting all buckets. + * To check on bucket policies defined we have to (look for and) evaluate the policy on each + * bucket the user owns. + */ + public S3ListAllMyBucketsResponse handleRequest(S3ListAllMyBucketsRequest request) + { + S3ListAllMyBucketsResponse response = new S3ListAllMyBucketsResponse(); + SBucketDao bucketDao = new SBucketDao(); + + // "...you can only list buckets for which you are the owner." + List buckets = bucketDao.listBuckets(UserContext.current().getCanonicalUserId()); + S3CanonicalUser owner = new S3CanonicalUser(); + owner.setID(UserContext.current().getCanonicalUserId()); + owner.setDisplayName(""); + response.setOwner(owner); + + if (buckets != null) + { + S3ListAllMyBucketsEntry[] entries = new S3ListAllMyBucketsEntry[buckets.size()]; + int i = 0; + for(SBucket bucket : buckets) + { + String bucketName = bucket.getName(); + S3PolicyContext context = new S3PolicyContext( PolicyActions.ListAllMyBuckets, bucketName ); + verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_PASS ); + + entries[i] = new S3ListAllMyBucketsEntry(); + entries[i].setName(bucketName); + entries[i].setCreationDate(DateHelper.toCalendar(bucket.getCreateTime())); + i++; + } + response.setBuckets(entries); + } + return response; + } + + /** + * Return an S3Response representing the result of PUTTING the ACL of a given bucket. + * Called from S3BucketAction to PUT its ACL. + */ + + public S3Response handleRequest(S3SetBucketAccessControlPolicyRequest request) + { + S3Response response = new S3Response(); + SBucketDao bucketDao = new SBucketDao(); + String bucketName = request.getBucketName(); + SBucket sbucket = bucketDao.getByName(bucketName); + if(sbucket == null) { + response.setResultCode(404); + response.setResultDescription("Bucket does not exist"); + return response; + } + + S3PolicyContext context = new S3PolicyContext( PolicyActions.PutBucketAcl, bucketName ); + verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_WRITE_ACL ); + + SAclDao aclDao = new SAclDao(); + aclDao.save("SBucket", sbucket.getId(), request.getAcl()); + + response.setResultCode(200); + response.setResultDescription("OK"); + return response; + } + + + /** + * Return a S3AccessControlPolicy representing the ACL of a given bucket. + * Called from S3BucketAction to GET its ACL. + */ + + public S3AccessControlPolicy handleRequest(S3GetBucketAccessControlPolicyRequest request) + { + S3AccessControlPolicy policy = new S3AccessControlPolicy(); + SBucketDao bucketDao = new SBucketDao(); + String bucketName = request.getBucketName(); + SBucket sbucket = bucketDao.getByName( bucketName ); + if (sbucket == null) + throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); + + S3CanonicalUser owner = new S3CanonicalUser(); + owner.setID(sbucket.getOwnerCanonicalId()); + owner.setDisplayName(""); + policy.setOwner(owner); + + S3PolicyContext context = new S3PolicyContext( PolicyActions.GetBucketAcl, bucketName ); + verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ_ACL ); + + SAclDao aclDao = new SAclDao(); + List grants = aclDao.listGrants("SBucket", sbucket.getId()); + policy.setGrants(S3Grant.toGrants(grants)); + return policy; + } + + /** + * This method should be called if a multipart upload is aborted OR has completed successfully and + * the individual parts have to be cleaned up. + * Called from S3ObjectAction when executing at completion or when aborting multipart upload. + * @param bucketName + * @param uploadId + * @param verifyPermission - If false then do not check the user's permission to clean up the state + */ + public int freeUploadParts(String bucketName, int uploadId, boolean verifyPermission) + { + // -> we need to look up the final bucket to figure out which mount point to use to save the part in + SBucketDao bucketDao = new SBucketDao(); + SBucket bucket = bucketDao.getByName(bucketName); + if (bucket == null) { + logger.error( "initiateMultipartUpload failed since " + bucketName + " does not exist" ); + return 404; + } + + OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); + + try { + MultipartLoadDao uploadDao = new MultipartLoadDao(); + OrderedPair exists = uploadDao.multipartExits( uploadId ); + if (null == exists) { + logger.error( "initiateMultipartUpload failed since multipart upload" + uploadId + " does not exist" ); + return 404; + } + + // -> the multipart initiator or bucket owner can do this action by default + if (verifyPermission) + { + String initiator = uploadDao.getInitiator( uploadId ); + if (null == initiator || !initiator.equals( UserContext.current().getAccessKey())) + { + // -> write permission on a bucket allows a PutObject / DeleteObject action on any object in the bucket + S3PolicyContext context = new S3PolicyContext( PolicyActions.AbortMultipartUpload, bucketName ); + context.setKeyName( exists.getSecond()); + verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); + } + } + + // -> first get a list of all the uploaded files and delete one by one + S3MultipartPart[] parts = uploadDao.getParts( uploadId, 10000, 0 ); + for( int i=0; i < parts.length; i++ ) + { + bucketAdapter.deleteObject( host_storagelocation_pair.getSecond(), ServiceProvider.getInstance().getMultipartDir(), parts[i].getPath()); + } + + uploadDao.deleteUpload( uploadId ); + return 204; + + } + catch( PermissionDeniedException e ) { + logger.error("freeUploadParts failed due to [" + e.getMessage() + "]", e); + throw e; + } + catch (Exception e) { + logger.error("freeUploadParts failed due to [" + e.getMessage() + "]", e); + return 500; + } + } + + /** + * The initiator must have permission to write to the bucket in question in order to initiate + * a multipart upload. Also check to make sure the special folder used to store parts of + * a multipart exists for this bucket. + * Called from S3ObjectAction during many stages of multipart upload. + */ + public S3PutObjectInlineResponse initiateMultipartUpload(S3PutObjectInlineRequest request) + { + S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); + String bucketName = request.getBucketName(); + String nameKey = request.getKey(); + + // -> does the bucket exist and can we write to it? + SBucketDao bucketDao = new SBucketDao(); + SBucket bucket = bucketDao.getByName(bucketName); + if (bucket == null) { + logger.error( "initiateMultipartUpload failed since " + bucketName + " does not exist" ); + response.setResultCode(404); + } + + S3PolicyContext context = new S3PolicyContext( PolicyActions.PutObject, bucketName ); + context.setKeyName( nameKey ); + context.setEvalParam( ConditionKeys.Acl, request.getCannedAccess()); + verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); + + createUploadFolder( bucketName ); + + try { + MultipartLoadDao uploadDao = new MultipartLoadDao(); + int uploadId = uploadDao.initiateUpload( UserContext.current().getAccessKey(), bucketName, nameKey, request.getCannedAccess(), request.getMetaEntries()); + response.setUploadId( uploadId ); + response.setResultCode(200); + + } catch( Exception e ) { + logger.error("initiateMultipartUpload exception: ", e); + response.setResultCode(500); + } + + return response; + } + + /** + * Save the object fragment in a special (i.e., hidden) directory inside the same mount point as + * the bucket location that the final object will be stored in. + * Called from S3ObjectAction during many stages of multipart upload. + * @param request + * @param uploadId + * @param partNumber + * @return S3PutObjectInlineResponse + */ + public S3PutObjectInlineResponse saveUploadPart(S3PutObjectInlineRequest request, int uploadId, int partNumber) + { + S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); + String bucketName = request.getBucketName(); + + // -> we need to look up the final bucket to figure out which mount point to use to save the part in + SBucketDao bucketDao = new SBucketDao(); + SBucket bucket = bucketDao.getByName(bucketName); + if (bucket == null) { + logger.error( "saveUploadedPart failed since " + bucketName + " does not exist" ); + response.setResultCode(404); + } + S3PolicyContext context = new S3PolicyContext( PolicyActions.PutObject, bucketName ); + context.setKeyName( request.getKey()); + verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); + + OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); + String itemFileName = new String( uploadId + "-" + partNumber ); + InputStream is = null; + + try { + is = request.getDataInputStream(); + String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), ServiceProvider.getInstance().getMultipartDir(), itemFileName); + response.setETag(md5Checksum); + + MultipartLoadDao uploadDao = new MultipartLoadDao(); + uploadDao.savePart( uploadId, partNumber, md5Checksum, itemFileName, (int)request.getContentLength()); + response.setResultCode(200); + + } catch (IOException e) { + logger.error("UploadPart failed due to " + e.getMessage(), e); + response.setResultCode(500); + } catch (OutOfStorageException e) { + logger.error("UploadPart failed due to " + e.getMessage(), e); + response.setResultCode(500); + } catch (Exception e) { + logger.error("UploadPart failed due to " + e.getMessage(), e); + response.setResultCode(500); + } finally { + if(is != null) { + try { + is.close(); + } catch (IOException e) { + logger.error("UploadPart unable to close stream from data handler.", e); + } + } + } + + return response; + } + + /** + * Create the real object represented by all the parts of the multipart upload. + * Called from S3ObjectAction at completion of multipart upload. + * @param httpResp - Servlet response handle to return the headers of the response (including version header) + * @param request - Normal parameters needed to create a new object (including metadata) + * @param parts - List of files that make up the multipart + * @param outputStream - Response output stream + * N.B. - This method can be long-lasting + * We are required to keep the connection alive by returning whitespace characters back periodically. + */ + + public S3PutObjectInlineResponse concatentateMultipartUploads(HttpServletResponse httpResp, S3PutObjectInlineRequest request, S3MultipartPart[] parts, OutputStream outputStream) throws IOException + { + // [A] Set up and initial error checking + S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); + String bucketName = request.getBucketName(); + String key = request.getKey(); + S3MetaDataEntry[] meta = request.getMetaEntries(); + + SBucketDao bucketDao = new SBucketDao(); + SBucket bucket = bucketDao.getByName(bucketName); + if (bucket == null) { + logger.error( "completeMultipartUpload( failed since " + bucketName + " does not exist" ); + response.setResultCode(404); + } + + // [B] Now we need to create the final re-assembled object + // -> the allocObjectItem checks for the bucket policy PutObject permissions + OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, null, request.getCannedAccess()); + OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); + + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); + String itemFileName = object_objectitem_pair.getSecond().getStoredPath(); + + // -> Amazon defines that we must return a 200 response immediately to the client, but + // -> we don't know the version header until we hit here + httpResp.setStatus(200); + httpResp.setContentType("text/xml; charset=UTF-8"); + String version = object_objectitem_pair.getSecond().getVersion(); + if (null != version) httpResp.addHeader( "x-amz-version-id", version ); + httpResp.flushBuffer(); + + + // [C] Re-assemble the object from its uploaded file parts + try { + // explicit transaction control to avoid holding transaction during long file concatenation process + PersistContext.commitTransaction(); + + OrderedPair result = bucketAdapter. + concatentateObjects + ( host_storagelocation_pair.getSecond(), + bucket.getName(), + itemFileName, + ServiceProvider.getInstance().getMultipartDir(), + parts, + outputStream ); + response.setETag(result.getFirst()); + response.setLastModified(DateHelper.toCalendar( object_objectitem_pair.getSecond().getLastModifiedTime())); + + SObjectItemDao itemDao = new SObjectItemDao(); + SObjectItem item = itemDao.get( object_objectitem_pair.getSecond().getId()); + item.setMd5(result.getFirst()); + item.setStoredSize(result.getSecond().longValue()); + response.setResultCode(200); + + PersistContext.getSession().save(item); + } + catch (Exception e) { + logger.error("completeMultipartUpload failed due to " + e.getMessage(), e); + } + return response; + } + + /** + * Return a S3PutObjectInlineResponse which represents an object being created into a bucket + * Called from S3ObjectAction when PUTting or POTing an object. + */ + + public S3PutObjectInlineResponse handleRequest(S3PutObjectInlineRequest request) + { + S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); + String bucketName = request.getBucketName(); + String key = request.getKey(); + long contentLength = request.getContentLength(); + S3MetaDataEntry[] meta = request.getMetaEntries(); + S3AccessControlList acl = request.getAcl(); + + SBucketDao bucketDao = new SBucketDao(); + SBucket bucket = bucketDao.getByName(bucketName); + if (bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); + + + // Is the caller allowed to write the object? + // The allocObjectItem checks for the bucket policy PutObject permissions + OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, acl, request.getCannedAccess()); + OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); + + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); + String itemFileName = object_objectitem_pair.getSecond().getStoredPath(); + InputStream is = null; + + try { + // explicit transaction control to avoid holding transaction during file-copy process + PersistContext.commitTransaction(); + + is = request.getDataInputStream(); + String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), bucket.getName(), itemFileName); + response.setETag(md5Checksum); + response.setLastModified(DateHelper.toCalendar( object_objectitem_pair.getSecond().getLastModifiedTime())); + response.setVersion( object_objectitem_pair.getSecond().getVersion()); + + SObjectItemDao itemDao = new SObjectItemDao(); + SObjectItem item = itemDao.get( object_objectitem_pair.getSecond().getId()); + item.setMd5(md5Checksum); + item.setStoredSize(contentLength); + PersistContext.getSession().save(item); + + } catch (IOException e) { + logger.error("PutObjectInline failed due to " + e.getMessage(), e); + } catch (OutOfStorageException e) { + logger.error("PutObjectInline failed due to " + e.getMessage(), e); + } finally { + if(is != null) { + try { + is.close(); + } catch (IOException e) { + logger.error("PutObjectInline unable to close stream from data handler.", e); + } + } + } + + return response; + } + + /** + * Return a S3PutObjectResponse which represents an object being created into a bucket + * Called from S3RestServlet when processing a DIME request. + */ + + public S3PutObjectResponse handleRequest(S3PutObjectRequest request) + { + S3PutObjectResponse response = new S3PutObjectResponse(); + String bucketName = request.getBucketName(); + String key = request.getKey(); + long contentLength = request.getContentLength(); + S3MetaDataEntry[] meta = request.getMetaEntries(); + S3AccessControlList acl = request.getAcl(); + + SBucketDao bucketDao = new SBucketDao(); + SBucket bucket = bucketDao.getByName(bucketName); + if(bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); + + // Is the caller allowed to write the object? + // The allocObjectItem checks for the bucket policy PutObject permissions + OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, acl, null); + OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); + + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); + String itemFileName = object_objectitem_pair.getSecond().getStoredPath(); + InputStream is = null; + try { + // explicit transaction control to avoid holding transaction during file-copy process + PersistContext.commitTransaction(); + + is = request.getInputStream(); + String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), bucket.getName(), itemFileName); + response.setETag(md5Checksum); + response.setLastModified(DateHelper.toCalendar( object_objectitem_pair.getSecond().getLastModifiedTime())); + + SObjectItemDao itemDao = new SObjectItemDao(); + SObjectItem item = itemDao.get( object_objectitem_pair.getSecond().getId()); + item.setMd5(md5Checksum); + item.setStoredSize(contentLength); + PersistContext.getSession().save(item); + + } catch (OutOfStorageException e) { + logger.error("PutObject failed due to " + e.getMessage(), e); + } finally { + if(is != null) { + try { + is.close(); + } catch (IOException e) { + logger.error("Unable to close stream from data handler.", e); + } + } + } + + return response; + } + + /** + * The ACL of an object is set at the object version level. By default, PUT sets the ACL of the latest + * version of an object. To set the ACL of a different version, using the versionId subresource. + * Called from S3ObjectAction to PUT an object's ACL. + */ + + public S3Response handleRequest(S3SetObjectAccessControlPolicyRequest request) + { + S3PolicyContext context = null; + + // [A] First find the object in the bucket + S3Response response = new S3Response(); + SBucketDao bucketDao = new SBucketDao(); + String bucketName = request.getBucketName(); + SBucket sbucket = bucketDao.getByName( bucketName ); + if(sbucket == null) { + response.setResultCode(404); + response.setResultDescription("Bucket " + bucketName + "does not exist"); + return response; + } + + SObjectDao sobjectDao = new SObjectDao(); + String nameKey = request.getKey(); + SObject sobject = sobjectDao.getByNameKey( sbucket, nameKey ); + if(sobject == null) { + response.setResultCode(404); + response.setResultDescription("Object " + request.getKey() + " in bucket " + bucketName + " does not exist"); + return response; + } + + String deletionMark = sobject.getDeletionMark(); + if (null != deletionMark) { + response.setResultCode(404); + response.setResultDescription("Object " + request.getKey() + " has been deleted (1)"); + return response; + } + + + // [B] Versioning allow the client to ask for a specific version not just the latest + SObjectItem item = null; + int versioningStatus = sbucket.getVersioningStatus(); + String wantVersion = request.getVersion(); + if ( SBucket.VERSIONING_ENABLED == versioningStatus && null != wantVersion) + item = sobject.getVersion( wantVersion ); + else item = sobject.getLatestVersion(( SBucket.VERSIONING_ENABLED != versioningStatus )); + + if (item == null) { + response.setResultCode(404); + response.setResultDescription("Object " + request.getKey() + " has been deleted (2)"); + return response; + } + + if ( SBucket.VERSIONING_ENABLED == versioningStatus ) { + context = new S3PolicyContext( PolicyActions.PutObjectAclVersion, bucketName ); + context.setEvalParam( ConditionKeys.VersionId, wantVersion ); + response.setVersion( item.getVersion()); + } + else context = new S3PolicyContext( PolicyActions.PutObjectAcl, bucketName ); + context.setKeyName( nameKey ); + verifyAccess( context, "SObjectItem", item.getId(), SAcl.PERMISSION_WRITE_ACL ); + + // -> the acl always goes on the instance of the object + SAclDao aclDao = new SAclDao(); + aclDao.save("SObjectItem", item.getId(), request.getAcl()); + + response.setResultCode(200); + response.setResultDescription("OK"); + return response; + } + + /** + * By default, GET returns ACL information about the latest version of an object. To return ACL + * information about a different version, use the versionId subresource + * Called from S3ObjectAction to get an object's ACL. + */ + + public S3AccessControlPolicy handleRequest(S3GetObjectAccessControlPolicyRequest request) + { + S3PolicyContext context = null; + + // [A] Does the object exist that holds the ACL we are looking for? + S3AccessControlPolicy policy = new S3AccessControlPolicy(); + SBucketDao bucketDao = new SBucketDao(); + String bucketName = request.getBucketName(); + SBucket sbucket = bucketDao.getByName( bucketName ); + if (sbucket == null) + throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); + + SObjectDao sobjectDao = new SObjectDao(); + String nameKey = request.getKey(); + SObject sobject = sobjectDao.getByNameKey( sbucket, nameKey ); + if (sobject == null) + throw new NoSuchObjectException("Object " + request.getKey() + " does not exist"); + + String deletionMark = sobject.getDeletionMark(); + if (null != deletionMark) { + policy.setResultCode(404); + policy.setResultDescription("Object " + request.getKey() + " has been deleted (1)"); + return policy; + } + + + // [B] Versioning allow the client to ask for a specific version not just the latest + SObjectItem item = null; + int versioningStatus = sbucket.getVersioningStatus(); + String wantVersion = request.getVersion(); + if ( SBucket.VERSIONING_ENABLED == versioningStatus && null != wantVersion) + item = sobject.getVersion( wantVersion ); + else item = sobject.getLatestVersion(( SBucket.VERSIONING_ENABLED != versioningStatus )); + + if (item == null) { + policy.setResultCode(404); + policy.setResultDescription("Object " + request.getKey() + " has been deleted (2)"); + return policy; + } + + if ( SBucket.VERSIONING_ENABLED == versioningStatus ) { + context = new S3PolicyContext( PolicyActions.GetObjectVersionAcl, bucketName ); + context.setEvalParam( ConditionKeys.VersionId, wantVersion ); + policy.setVersion( item.getVersion()); + } + else context = new S3PolicyContext( PolicyActions.GetObjectAcl, bucketName ); + context.setKeyName( nameKey ); + verifyAccess( context, "SObjectItem", item.getId(), SAcl.PERMISSION_READ_ACL ); + + + // [C] ACLs are ALWAYS on an instance of the object + S3CanonicalUser owner = new S3CanonicalUser(); + owner.setID(sobject.getOwnerCanonicalId()); + owner.setDisplayName(""); + policy.setOwner(owner); + policy.setResultCode(200); + + SAclDao aclDao = new SAclDao(); + List grants = aclDao.listGrants( "SObjectItem", item.getId()); + policy.setGrants(S3Grant.toGrants(grants)); + return policy; + } + + /** + * Handle requests for GET object and HEAD "get object extended" + * Called from S3ObjectAction for GET and HEAD of an object. + */ + + public S3GetObjectResponse handleRequest(S3GetObjectRequest request) + { + S3GetObjectResponse response = new S3GetObjectResponse(); + S3PolicyContext context = null; + boolean ifRange = false; + long bytesStart = request.getByteRangeStart(); + long bytesEnd = request.getByteRangeEnd(); + int resultCode = 200; + + // [A] Verify that the bucket and the object exist + SBucketDao bucketDao = new SBucketDao(); + String bucketName = request.getBucketName(); + SBucket sbucket = bucketDao.getByName(bucketName); + if (sbucket == null) { + response.setResultCode(404); + response.setResultDescription("Bucket " + request.getBucketName() + " does not exist"); + return response; + } + + SObjectDao objectDao = new SObjectDao(); + String nameKey = request.getKey(); + SObject sobject = objectDao.getByNameKey( sbucket, nameKey ); + if (sobject == null) { + response.setResultCode(404); + response.setResultDescription("Object " + request.getKey() + " does not exist in bucket " + request.getBucketName()); + return response; + } + + String deletionMark = sobject.getDeletionMark(); + if (null != deletionMark) { + response.setDeleteMarker( deletionMark ); + response.setResultCode(404); + response.setResultDescription("Object " + request.getKey() + " has been deleted (1)"); + return response; + } + + + // [B] Versioning allow the client to ask for a specific version not just the latest + SObjectItem item = null; + int versioningStatus = sbucket.getVersioningStatus(); + String wantVersion = request.getVersion(); + if ( SBucket.VERSIONING_ENABLED == versioningStatus && null != wantVersion) + item = sobject.getVersion( wantVersion ); + else item = sobject.getLatestVersion(( SBucket.VERSIONING_ENABLED != versioningStatus )); + + if (item == null) { + response.setResultCode(404); + response.setResultDescription("Object " + request.getKey() + " has been deleted (2)"); + return response; + } + + if ( SBucket.VERSIONING_ENABLED == versioningStatus ) { + context = new S3PolicyContext( PolicyActions.GetObjectVersion, bucketName ); + context.setEvalParam( ConditionKeys.VersionId, wantVersion ); + } + else context = new S3PolicyContext( PolicyActions.GetObject, bucketName ); + context.setKeyName( nameKey ); + verifyAccess( context, "SObjectItem", item.getId(), SAcl.PERMISSION_READ ); + + + // [C] Handle all the IFModifiedSince ... conditions, and access privileges + // -> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.27 (HTTP If-Range header) + if (request.isReturnCompleteObjectOnConditionFailure() && (0 <= bytesStart && 0 <= bytesEnd)) ifRange = true; + + resultCode = conditionPassed( request.getConditions(), item.getLastModifiedTime(), item.getMd5(), ifRange ); + if ( -1 == resultCode ) { + // -> If-Range implementation, we have to return the entire object + resultCode = 200; + bytesStart = -1; + bytesEnd = -1; + } + else if (200 != resultCode) { + response.setResultCode( resultCode ); + response.setResultDescription( "Precondition Failed" ); + return response; + } + + + // [D] Return the contents of the object inline + // -> extract the meta data that corresponds the specific versioned item + SMetaDao metaDao = new SMetaDao(); + List itemMetaData = metaDao.getByTarget( "SObjectItem", item.getId()); + if (null != itemMetaData) + { + int i = 0; + S3MetaDataEntry[] metaEntries = new S3MetaDataEntry[ itemMetaData.size() ]; + ListIterator it = itemMetaData.listIterator(); + while( it.hasNext()) { + SMeta oneTag = (SMeta)it.next(); + S3MetaDataEntry oneEntry = new S3MetaDataEntry(); + oneEntry.setName( oneTag.getName()); + oneEntry.setValue( oneTag.getValue()); + metaEntries[i++] = oneEntry; + } + response.setMetaEntries( metaEntries ); + } + + // -> support a single byte range + if ( 0 <= bytesStart && 0 <= bytesEnd ) { + response.setContentLength( bytesEnd - bytesStart ); + resultCode = 206; + } + else response.setContentLength( item.getStoredSize()); + + if(request.isReturnData()) + { + response.setETag(item.getMd5()); + response.setLastModified(DateHelper.toCalendar( item.getLastModifiedTime())); + response.setVersion( item.getVersion()); + if (request.isInlineData()) + { + OrderedPair tupleSHostInfo = getBucketStorageHost(sbucket); + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(tupleSHostInfo.getFirst()); + + if ( 0 <= bytesStart && 0 <= bytesEnd ) + response.setData(bucketAdapter.loadObjectRange(tupleSHostInfo.getSecond(), + request.getBucketName(), item.getStoredPath(), bytesStart, bytesEnd )); + else response.setData(bucketAdapter.loadObject(tupleSHostInfo.getSecond(), request.getBucketName(), item.getStoredPath())); + } + } + + response.setResultCode( resultCode ); + response.setResultDescription("OK"); + return response; + } + + /** + * Handle object deletion requests, both versioning and non-versioning requirements. + * Called from S3ObjectAction for deletion. + */ + public S3Response handleRequest(S3DeleteObjectRequest request) + { + // Verify that the bucket and object exist + S3Response response = new S3Response(); + SBucketDao bucketDao = new SBucketDao(); + String bucketName = request.getBucketName(); + SBucket sbucket = bucketDao.getByName( bucketName ); + if (sbucket == null) { + response.setResultCode(404); + response.setResultDescription("Bucket dosen't existsBucket " + bucketName + " does not exist"); + return response; + } + + SObjectDao objectDao = new SObjectDao(); + String nameKey = request.getKey(); + SObject sobject = objectDao.getByNameKey( sbucket, nameKey ); + if (sobject == null) { + response.setResultCode(404); + response.setResultDescription("Not FoundNo object with key " + nameKey + " exists in bucket " + bucketName+""); + return response; + } + + + // Discover whether versioning is enabled. If so versioning requires the setting of a deletion marker. + String storedPath = null; + SObjectItem item = null; + int versioningStatus = sbucket.getVersioningStatus(); + if ( SBucket.VERSIONING_ENABLED == versioningStatus ) + { + String wantVersion = request.getVersion(); + S3PolicyContext context = new S3PolicyContext( PolicyActions.DeleteObjectVersion, bucketName ); + context.setKeyName( nameKey ); + context.setEvalParam( ConditionKeys.VersionId, wantVersion ); + verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_WRITE ); + + if (null == wantVersion) { + // If versioning is on and no versionId is given then we just write a deletion marker + sobject.setDeletionMark( UUID.randomUUID().toString()); + objectDao.update( sobject ); + response.setResultDescription("true"+ sobject.getDeletionMark() +""); + } + else { + // Otherwise remove the deletion marker if this has been set + String deletionMarker = sobject.getDeletionMark(); + if (null != deletionMarker && wantVersion.equalsIgnoreCase( deletionMarker )) { + sobject.setDeletionMark( null ); + objectDao.update( sobject ); + response.setResultDescription("" + wantVersion +""); + response.setResultDescription("true"+ sobject.getDeletionMark() +""); + response.setResultCode(204); + return response; + } + + // If versioning is on and the versionId is given (non-null) then delete the object matching that version + if ( null == (item = sobject.getVersion( wantVersion ))) { + response.setResultCode(404); + return response; + } + else { + // Providing versionId is non-null, then just delete the one item that matches the versionId from the database + storedPath = item.getStoredPath(); + sobject.deleteItem( item.getId()); + objectDao.update( sobject ); + response.setResultDescription("" + wantVersion +""); + } + } + } + else + { // If versioning is off then we do delete the null object + S3PolicyContext context = new S3PolicyContext( PolicyActions.DeleteObject, bucketName ); + context.setKeyName( nameKey ); + verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_WRITE ); + + if ( null == (item = sobject.getLatestVersion( true ))) { + response.setResultCode(404); + response.setResultDescription("AccessDeniedAccess Denied"); + return response; + } + else { + // If there is no item with a null version then we are done + if (null == item.getVersion()) { + // Otherwiswe remove the entire object + // Cascade-deleting can delete related SObject/SObjectItem objects, but not SAcl and SMeta objects. + storedPath = item.getStoredPath(); + deleteMetaData( item.getId()); + deleteObjectAcls( "SObjectItem", item.getId()); + objectDao.delete( sobject ); + } + } + } + + // Delete the file holding the object + if (null != storedPath) + { + OrderedPair host_storagelocation_pair = getBucketStorageHost( sbucket ); + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter( host_storagelocation_pair.getFirst()); + bucketAdapter.deleteObject( host_storagelocation_pair.getSecond(), bucketName, storedPath ); + } + + response.setResultCode(204); + return response; + } + + + private void deleteMetaData( long itemId ) { + SMetaDao metaDao = new SMetaDao(); + List itemMetaData = metaDao.getByTarget( "SObjectItem", itemId ); + if (null != itemMetaData) + { + ListIterator it = itemMetaData.listIterator(); + while( it.hasNext()) { + SMeta oneTag = (SMeta)it.next(); + metaDao.delete( oneTag ); + } + } + } + + private void deleteObjectAcls( String target, long itemId ) { + SAclDao aclDao = new SAclDao(); + List itemAclData = aclDao.listGrants( target, itemId ); + if (null != itemAclData) + { + ListIterator it = itemAclData.listIterator(); + while( it.hasNext()) { + SAcl oneTag = (SAcl)it.next(); + aclDao.delete( oneTag ); + } + } + } + + private void deleteBucketAcls( long bucketId ) { + SAclDao aclDao = new SAclDao(); + List bucketAclData = aclDao.listGrants( "SBucket", bucketId ); + if (null != bucketAclData) + { + ListIterator it = bucketAclData.listIterator(); + while( it.hasNext()) { + SAcl oneTag = (SAcl)it.next(); + aclDao.delete( oneTag ); + } + } + } + + private S3ListBucketPrefixEntry[] composeListBucketPrefixEntries(List l, String prefix, String delimiter, int maxKeys) + { + List entries = new ArrayList(); + int count = 0; + + for(SObject sobject : l) + { + if(delimiter != null && !delimiter.isEmpty()) + { + String subName = StringHelper.substringInBetween(sobject.getNameKey(), prefix, delimiter); + if(subName != null) + { + S3ListBucketPrefixEntry entry = new S3ListBucketPrefixEntry(); + if ( prefix != null && prefix.length() > 0) + entry.setPrefix(prefix + delimiter + subName); + else entry.setPrefix(subName); + } + } + count++; + if(count >= maxKeys) break; + } + + if(entries.size() > 0) return entries.toArray(new S3ListBucketPrefixEntry[0]); + return null; + } + + /** + * The 'versionIdMarker' parameter only makes sense if enableVersion is true. + * versionIdMarker is the starting point to return information back. So for example if an + * object has versions 1,2,3,4,5 and the versionIdMarker is '3', then 3,4,5 will be returned + * by this function. If the versionIdMarker is null then all versions are returned. + * + * TODO - how does the versionIdMarker work when there is a deletion marker in the object? + */ + private S3ListBucketObjectEntry[] composeListBucketContentEntries(List l, String prefix, String delimiter, int maxKeys, boolean enableVersion, String versionIdMarker) + { + List entries = new ArrayList(); + SObjectItem latest = null; + boolean hitIdMarker = false; + int count = 0; + + for( SObject sobject : l ) + { + if (delimiter != null && !delimiter.isEmpty()) + { + if (StringHelper.substringInBetween(sobject.getNameKey(), prefix, delimiter) != null) + continue; + } + + if (enableVersion) + { + hitIdMarker = (null == versionIdMarker ? true : false); + + // This supports GET REST calls with /?versions + String deletionMarker = sobject.getDeletionMark(); + if ( null != deletionMarker ) + { + // TODO we should also save the timestamp when something is deleted + S3ListBucketObjectEntry entry = new S3ListBucketObjectEntry(); + entry.setKey(sobject.getNameKey()); + entry.setVersion( deletionMarker ); + entry.setIsLatest( true ); + entry.setIsDeletionMarker( true ); + entry.setLastModified( Calendar.getInstance( TimeZone.getTimeZone("GMT") )); + entry.setOwnerCanonicalId(sobject.getOwnerCanonicalId()); + entry.setOwnerDisplayName(""); + entries.add( entry ); + latest = null; + } + else latest = sobject.getLatestVersion( false ); + + Iterator it = sobject.getItems().iterator(); + while( it.hasNext()) + { + SObjectItem item = (SObjectItem)it.next(); + + if ( !hitIdMarker ) + { + if (item.getVersion().equalsIgnoreCase( versionIdMarker )) { + hitIdMarker = true; + entries.add( toListEntry( sobject, item, latest )); + } + } + else entries.add( toListEntry( sobject, item, latest )); + } + } + else + { // -> if there are multiple versions of an object then just return its last version + Iterator it = sobject.getItems().iterator(); + SObjectItem lastestItem = null; + int maxVersion = 0; + int version = 0; + while(it.hasNext()) + { + SObjectItem item = (SObjectItem)it.next(); + String versionStr = item.getVersion(); + + if ( null != versionStr ) + version = Integer.parseInt(item.getVersion()); + else lastestItem = item; + + // -> if the bucket has versions turned on + if (version > maxVersion) { + maxVersion = version; + lastestItem = item; + } + } + if (lastestItem != null) { + entries.add( toListEntry( sobject, lastestItem, null )); + } + } + + count++; + if(count >= maxKeys) break; + } + + if ( entries.size() > 0 ) + return entries.toArray(new S3ListBucketObjectEntry[0]); + else return null; + } + + private static S3ListBucketObjectEntry toListEntry( SObject sobject, SObjectItem item, SObjectItem latest ) + { + S3ListBucketObjectEntry entry = new S3ListBucketObjectEntry(); + entry.setKey(sobject.getNameKey()); + entry.setVersion( item.getVersion()); + entry.setETag( "\"" + item.getMd5() + "\"" ); + entry.setSize(item.getStoredSize()); + entry.setStorageClass( "STANDARD" ); + entry.setLastModified(DateHelper.toCalendar(item.getLastModifiedTime())); + entry.setOwnerCanonicalId(sobject.getOwnerCanonicalId()); + entry.setOwnerDisplayName(""); + + if (null != latest && item == latest) entry.setIsLatest( true ); + return entry; + } + + private OrderedPair getBucketStorageHost(SBucket bucket) + { + MHostMountDao mountDao = new MHostMountDao(); + + SHost shost = bucket.getShost(); + if(shost.getHostType() == SHost.STORAGE_HOST_TYPE_LOCAL) { + return new OrderedPair(shost, shost.getExportRoot()); + } + + MHostMount mount = mountDao.getHostMount(ServiceProvider.getInstance().getManagementHostId(), shost.getId()); + if(mount != null) { + return new OrderedPair(shost, mount.getMountPath()); + } + + // need to redirect request to other node + throw new HostNotMountedException("Storage host " + shost.getHost() + " is not locally mounted"); + } + + /** + * Locate the folder to hold upload parts at the same mount point as the upload's final bucket + * location. Create the upload folder dynamically. + * + * @param bucketName + */ + private void createUploadFolder(String bucketName) + { + if (PersistContext.acquireNamedLock("bucket.creation", LOCK_ACQUIRING_TIMEOUT_SECONDS)) + { + try { + allocBucketStorageHost(bucketName, ServiceProvider.getInstance().getMultipartDir()); + } + finally { + PersistContext.releaseNamedLock("bucket.creation"); + } + } + } + + /** + * The overrideName is used to create a hidden storage bucket (folder) in the same location + * as the given bucketName. This can be used to create a folder for parts of a multipart + * upload for the associated bucket. + * + * @param bucketName + * @param overrideName + * @return + */ + private OrderedPair allocBucketStorageHost(String bucketName, String overrideName) + { + MHostDao mhostDao = new MHostDao(); + SHostDao shostDao = new SHostDao(); + + MHost mhost = mhostDao.get(ServiceProvider.getInstance().getManagementHostId()); + if(mhost == null) + throw new OutOfServiceException("Temporarily out of service"); + + if(mhost.getMounts().size() > 0) { + Random random = new Random(); + MHostMount[] mounts = (MHostMount[])mhost.getMounts().toArray(); + MHostMount mount = mounts[random.nextInt(mounts.length)]; + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(mount.getShost()); + bucketAdapter.createContainer(mount.getMountPath(), (null != overrideName ? overrideName : bucketName)); + return new OrderedPair(mount.getShost(), mount.getMountPath()); + } + + // To make things simple, only allow one local mounted storage root TODO - Change in the future + String localStorageRoot = ServiceProvider.getInstance().getStartupProperties().getProperty("storage.root"); + if(localStorageRoot != null) { + SHost localSHost = shostDao.getLocalStorageHost(mhost.getId(), localStorageRoot); + if(localSHost == null) + throw new InternalErrorException("storage.root is configured but not initialized"); + + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(localSHost); + bucketAdapter.createContainer(localSHost.getExportRoot(),(null != overrideName ? overrideName : bucketName)); + return new OrderedPair(localSHost, localStorageRoot); + } + + throw new OutOfStorageException("No storage host is available"); + } + + public S3BucketAdapter getStorageHostBucketAdapter(SHost shost) + { + S3BucketAdapter adapter = bucketAdapters.get(shost.getHostType()); + if(adapter == null) + throw new InternalErrorException("Bucket adapter is not installed for host type: " + shost.getHostType()); + + return adapter; + } + + /** + * If acl is set then the cannedAccessPolicy parameter should be null and is ignored. + * The cannedAccessPolicy parameter is for REST Put requests only where a simple set of ACLs can be + * created with a single header value. Note that we do not currently support "anonymous" un-authenticated + * access in our implementation. + * + * @throws IOException + */ + @SuppressWarnings("deprecation") + public OrderedPair allocObjectItem(SBucket bucket, String nameKey, S3MetaDataEntry[] meta, S3AccessControlList acl, String cannedAccessPolicy) + { + SObjectDao objectDao = new SObjectDao(); + SObjectItemDao objectItemDao = new SObjectItemDao(); + SMetaDao metaDao = new SMetaDao(); + SAclDao aclDao = new SAclDao(); + SObjectItem item = null; + int versionSeq = 1; + int versioningStatus = bucket.getVersioningStatus(); + + Session session = PersistContext.getSession(); + + // [A] To write into a bucket the user must have write permission to that bucket + S3PolicyContext context = new S3PolicyContext( PolicyActions.PutObject, bucket.getName()); + context.setKeyName( nameKey ); + context.setEvalParam( ConditionKeys.Acl, cannedAccessPolicy); + + verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); // TODO - check this validates plain POSTs + + // [B] If versioning is off them we over write a null object item + SObject object = objectDao.getByNameKey(bucket, nameKey); + if ( object != null ) + { + // -> if versioning is on create new object items + if ( SBucket.VERSIONING_ENABLED == versioningStatus ) + { + session.lock(object, LockMode.UPGRADE); + versionSeq = object.getNextSequence(); + object.setNextSequence(versionSeq + 1); + session.save(object); + + item = new SObjectItem(); + item.setTheObject(object); + object.getItems().add(item); + item.setVersion(String.valueOf(versionSeq)); + Date ts = DateHelper.currentGMTTime(); + item.setCreateTime(ts); + item.setLastAccessTime(ts); + item.setLastModifiedTime(ts); + session.save(item); + } + else + { // -> find an object item with a null version, can be null + // if bucket started out with versioning enabled and was then suspended + item = objectItemDao.getByObjectIdNullVersion( object.getId()); + if (item == null) + { + item = new SObjectItem(); + item.setTheObject(object); + object.getItems().add(item); + Date ts = DateHelper.currentGMTTime(); + item.setCreateTime(ts); + item.setLastAccessTime(ts); + item.setLastModifiedTime(ts); + session.save(item); + } + } + } + else + { // -> there is no object nor an object item + object = new SObject(); + object.setBucket(bucket); + object.setNameKey(nameKey); + object.setNextSequence(2); + object.setCreateTime(DateHelper.currentGMTTime()); + object.setOwnerCanonicalId(UserContext.current().getCanonicalUserId()); + session.save(object); + + item = new SObjectItem(); + item.setTheObject(object); + object.getItems().add(item); + if (SBucket.VERSIONING_ENABLED == versioningStatus) item.setVersion(String.valueOf(versionSeq)); + Date ts = DateHelper.currentGMTTime(); + item.setCreateTime(ts); + item.setLastAccessTime(ts); + item.setLastModifiedTime(ts); + session.save(item); + } + + + // [C] We will use the item DB id as the file name, MD5/contentLength will be stored later + String suffix = null; + int dotPos = nameKey.lastIndexOf('.'); + if (dotPos >= 0) suffix = nameKey.substring(dotPos); + if ( suffix != null ) + item.setStoredPath(String.valueOf(item.getId()) + suffix); + else item.setStoredPath(String.valueOf(item.getId())); + + metaDao.save("SObjectItem", item.getId(), meta); + + + // [D] Are we setting an ACL along with the object + // -> the ACL is ALWAYS set on a particular instance of the object (i.e., a version) + if ( null != cannedAccessPolicy ) + { + setCannedAccessControls( cannedAccessPolicy, "SObjectItem", item.getId(), bucket ); + } + else if (null == acl || 0 == acl.size()) + { + // -> this is termed the "private" or default ACL, "Owner gets FULL_CONTROL" + setSingleAcl( "SObjectItem", item.getId(), SAcl.PERMISSION_FULL ); + } + else if (null != acl) { + aclDao.save( "SObjectItem", item.getId(), acl ); + } + + session.update(item); + return new OrderedPair(object, item); + } + + + /** + * Access controls that are specified via the "x-amz-acl:" headers in REST requests. + * Note that canned policies can be set when the object's contents are set + */ + public void setCannedAccessControls( String cannedAccessPolicy, String target, long objectId, SBucket bucket ) + { + // Find the permission and symbol for the principal corresponding to the requested cannedAccessPolicy + Triple permission_permission_symbol_triple = + SAcl.getCannedAccessControls(cannedAccessPolicy, target, bucket.getOwnerCanonicalId()); + if ( null == permission_permission_symbol_triple.getThird() ) + setSingleAcl(target, objectId, permission_permission_symbol_triple.getFirst()); + else + { setDefaultAcls( target, + objectId, + permission_permission_symbol_triple.getFirst(), // permission according to ownership of object + permission_permission_symbol_triple.getSecond(), // permission according to ownership of bucket + permission_permission_symbol_triple.getThird() ); // "symbol" to indicate principal or otherwise name of owner + + } + } + + + private void setSingleAcl( String target, long targetId, int permission ) + { + SAclDao aclDao = new SAclDao(); + S3AccessControlList defaultAcl = new S3AccessControlList(); + + // -> if an annoymous request, then do not rewrite the ACL + String userId = UserContext.current().getCanonicalUserId(); + if (0 < userId.length()) + { + S3Grant defaultGrant = new S3Grant(); + defaultGrant.setGrantee(SAcl.GRANTEE_USER); + defaultGrant.setCanonicalUserID( userId ); + defaultGrant.setPermission( permission ); + defaultAcl.addGrant( defaultGrant ); + aclDao.save( target, targetId, defaultAcl ); + } + } + + + /** + * The Cloud Stack API Access key is used for for the Canonical User Id everywhere (buckets and objects). + * + * @param owner - this can be the Cloud Access Key for a bucket owner or one of the + * following special symbols: + * (a) '*' - any principal authenticated user (i.e., any user with a registered Cloud Access Key) + * (b) 'A' - any anonymous principal (i.e., S3 request without an Authorization header) + */ + private void setDefaultAcls( String target, long objectId, int permission1, int permission2, String owner ) + { + SAclDao aclDao = new SAclDao(); + S3AccessControlList defaultAcl = new S3AccessControlList(); + + // -> object owner + S3Grant defaultGrant = new S3Grant(); + defaultGrant.setGrantee(SAcl.GRANTEE_USER); + defaultGrant.setCanonicalUserID( UserContext.current().getCanonicalUserId()); + defaultGrant.setPermission( permission1 ); + defaultAcl.addGrant( defaultGrant ); + + // -> bucket owner + defaultGrant = new S3Grant(); + defaultGrant.setGrantee(SAcl.GRANTEE_USER); + defaultGrant.setCanonicalUserID( owner ); + defaultGrant.setPermission( permission2 ); + defaultAcl.addGrant( defaultGrant ); + aclDao.save( target, objectId, defaultAcl ); + } + + public static PolicyAccess verifyPolicy( S3PolicyContext context ) + { + S3BucketPolicy policy = null; + + // Ordinarily a REST request will pass in an S3PolicyContext for a given bucket by this stage. The HttpServletRequest object + // should be held in the UserContext ready for extraction of the S3BucketPolicy. + // If there is an error in obtaining the request object or in loading the policy then log the failure and return a S3PolicyContext + // which indicates DEFAULT_DENY. Where there is no failure, the policy returned should be specific to the Canonical User ID of the requester. + + try { + // -> in SOAP the HttpServletRequest object is hidden and not passed around + if (null != context) { + context.setHttp( UserContext.current().getHttp()); + policy = loadPolicy( context ); + } + + if ( null != policy ) + return policy.eval(context, UserContext.current().getCanonicalUserId()); + else return PolicyAccess.DEFAULT_DENY; + } + catch( Exception e ) { + logger.error("verifyAccess - loadPolicy failed, bucket: " + context.getBucketName() + " policy ignored", e); + return PolicyAccess.DEFAULT_DENY; + } + } + + /** + * To determine access to a bucket or an object in a bucket evaluate first a define + * bucket policy and then any defined ACLs. + * + * @param context - all data needed for bucket policies + * @param target - used for ACL evaluation, object identifier + * @param targetId - used for ACL evaluation + * @param requestedPermission - ACL type access requested + * + * @throws ParseException, SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException + */ + public static void verifyAccess( S3PolicyContext context, String target, long targetId, int requestedPermission ) + { + switch( verifyPolicy( context ) ) { + case ALLOW: // overrides ACLs (?) + return; + + case DENY: + throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" ); + + case DEFAULT_DENY: + default: + accessAllowed( target, targetId, requestedPermission ); + break; + } + } + + /** + * This method verifies that the accessing client has the requested + * permission on the object/bucket/Acl represented by the tuple: + * + * For cases where an ACL is meant for any authenticated user we place a "*" for the + * Canonical User Id. N.B. - "*" is not a legal Cloud (Bridge) Access key. + * + * For cases where an ACL is meant for any anonymous user (or 'AllUsers') we place a "A" for the + * Canonical User Id. N.B. - "A" is not a legal Cloud (Bridge) Access key. + */ + public static void accessAllowed( String target, long targetId, int requestedPermission ) + { + if (SAcl.PERMISSION_PASS == requestedPermission) return; + + SAclDao aclDao = new SAclDao(); + + // If an annoymous request, then canonicalUserId is an empty string + String userId = UserContext.current().getCanonicalUserId(); + if ( 0 == userId.length()) + { + // Is an anonymous principal ACL set for this ? + if (hasPermission( aclDao.listGrants( target, targetId, "A" ), requestedPermission )) return; + } + else + { + if (hasPermission( aclDao.listGrants( target, targetId, userId ), requestedPermission )) return; + // Or alternatively is there is any principal authenticated ACL set for this ? + if (hasPermission( aclDao.listGrants( target, targetId, "*" ), requestedPermission )) return; + } + // No privileges implies that no access is allowed in the case of an anonymous user + throw new PermissionDeniedException( "Access Denied - ACLs do not give user the required permission" ); + } + + /** + * This method assumes that the bucket has been tested to make sure it exists before + * it is called. + * + * @param context + * @return S3BucketPolicy + * @throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, ParseException + */ + public static S3BucketPolicy loadPolicy( S3PolicyContext context ) + throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException, ParseException + { + OrderedPair result = ServiceProvider.getInstance().getBucketPolicy( context.getBucketName()); + S3BucketPolicy policy = result.getFirst(); + if ( null == policy ) + { + // -> do we have to load it from the database (any other value means there is no policy)? + if (-1 == result.getSecond().intValue()) + { + BucketPolicyDao policyDao = new BucketPolicyDao(); + String policyInJson = policyDao.getPolicy( context.getBucketName()); + // -> place in cache that no policy exists in the database + if (null == policyInJson) { + ServiceProvider.getInstance().setBucketPolicy(context.getBucketName(), null); + return null; + } + + PolicyParser parser = new PolicyParser(); + policy = parser.parse( policyInJson, context.getBucketName()); + if (null != policy) + ServiceProvider.getInstance().setBucketPolicy(context.getBucketName(), policy); + } + } + return policy; + } + + public static void verifyBucketName( String bucketName, boolean useDNSGuidelines ) throws InvalidBucketName + { + // [A] To comply with Amazon S3 basic requirements, bucket names must meet the following conditions + // -> must be between 3 and 255 characters long + int size = bucketName.length(); + if (3 > size || size > 255) + throw new InvalidBucketName( bucketName + " is not between 3 and 255 characters long" ); + + // -> must start with a number or letter + if (!Character.isLetterOrDigit( bucketName.charAt( 0 ))) + throw new InvalidBucketName( bucketName + " does not start with a number or letter" ); + + // -> can contain lowercase letters, numbers, periods (.), underscores (_), and dashes (-) + // -> the bucket name can also contain uppercase letters but it is not recommended + for( int i=0; i < bucketName.length(); i++ ) + { + char next = bucketName.charAt(i); + if (Character.isLetter( next )) continue; + else if (Character.isDigit( next )) continue; + else if ('.' == next) continue; + else if ('_' == next) continue; + else if ('-' == next) continue; + else throw new InvalidBucketName( bucketName + " contains the invalid character: " + next ); + } + + // -> must not be formatted as an IP address (e.g., 192.168.5.4) + String[] parts = bucketName.split( "\\." ); + if (4 == parts.length) + { + try { + int first = Integer.parseInt( parts[0] ); + int second = Integer.parseInt( parts[1] ); + int third = Integer.parseInt( parts[2] ); + int fourth = Integer.parseInt( parts[3] ); + throw new InvalidBucketName( bucketName + " is formatted as an IP address" ); + } + catch( NumberFormatException e ) + {throw new InvalidBucketName( bucketName);} + } + + + // [B] To conform with DNS requirements, Amazon recommends following these additional guidelines when creating buckets + // -> bucket names should be between 3 and 63 characters long + if (useDNSGuidelines) + { + // -> bucket names should be between 3 and 63 characters long + if (3 > size || size > 63) + throw new InvalidBucketName( "DNS requiremens, bucket name: " + bucketName + " is not between 3 and 63 characters long" ); + + // -> bucket names should not contain underscores (_) + int pos = bucketName.indexOf( '_' ); + if (-1 != pos) + throw new InvalidBucketName( "DNS requiremens, bucket name: " + bucketName + " should not contain underscores" ); + + // -> bucket names should not end with a dash + if (bucketName.endsWith( "-" )) + throw new InvalidBucketName( "DNS requiremens, bucket name: " + bucketName + " should not end with a dash" ); + + // -> bucket names cannot contain two, adjacent periods + pos = bucketName.indexOf( ".." ); + if (-1 != pos) + throw new InvalidBucketName( "DNS requiremens, bucket name: " + bucketName + " should not contain \"..\"" ); + + // -> bucket names cannot contain dashes next to periods (e.g., "my-.bucket.com" and "my.-bucket" are invalid) + if (-1 != bucketName.indexOf( "-." ) || -1 != bucketName.indexOf( ".-" )) + throw new InvalidBucketName( "DNS requiremens, bucket name: " + bucketName + " should not contain \".-\" or \"-.\"" ); + } + } + + private static boolean hasPermission( List privileges, int requestedPermission ) + { + ListIterator it = privileges.listIterator(); + while( it.hasNext()) + { + // True providing the requested permission is contained in one or the granted rights for this user. False otherwise. + SAcl rights = (SAcl)it.next(); + int permission = rights.getPermission(); + if (requestedPermission == (permission & requestedPermission)) return true; + } + return false; + } + + /** + * ifRange is true and ifUnmodifiedSince or IfMatch fails then we return the entire object (indicated by + * returning a -1 as the function result. + * + * @param ifCond - conditional get defined by these tests + * @param lastModified - value used on ifModifiedSince or ifUnmodifiedSince + * @param ETag - value used on ifMatch and ifNoneMatch + * @param ifRange - using an if-Range HTTP functionality + * @return -1 means return the entire object with an HTTP 200 (not a subrange) + */ + private int conditionPassed( S3ConditionalHeaders ifCond, Date lastModified, String ETag, boolean ifRange ) + { + if (null == ifCond) return 200; + + if (0 > ifCond.ifModifiedSince( lastModified )) + return 304; + + if (0 > ifCond.ifUnmodifiedSince( lastModified )) + return (ifRange ? -1 : 412); + + if (0 > ifCond.ifMatchEtag( ETag )) + return (ifRange ? -1 : 412); + + if (0 > ifCond.ifNoneMatchEtag( ETag )) + return 412; + + return 200; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3GetBucketAccessControlPolicyRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3GetBucketAccessControlPolicyRequest.java index 927fae3426c..cf5a55b7191 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3GetBucketAccessControlPolicyRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3GetBucketAccessControlPolicyRequest.java @@ -1,35 +1,51 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3GetBucketAccessControlPolicyRequest extends S3Request { - protected String bucketName; - - public S3GetBucketAccessControlPolicyRequest() { - super(); - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3GetBucketAccessControlPolicyRequest extends S3Request { + protected String bucketName; + + public S3GetBucketAccessControlPolicyRequest() { + super(); + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectAccessControlPolicyRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectAccessControlPolicyRequest.java index 3caecb0b05a..c3df8739ea9 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectAccessControlPolicyRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectAccessControlPolicyRequest.java @@ -1,53 +1,69 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3GetObjectAccessControlPolicyRequest extends S3Request { - protected String bucketName; - protected String key; - protected String version; - - public S3GetObjectAccessControlPolicyRequest() { - super(); - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3GetObjectAccessControlPolicyRequest extends S3Request { + protected String bucketName; + protected String key; + protected String version; + + public S3GetObjectAccessControlPolicyRequest() { + super(); + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectRequest.java index e0ac987f656..a889078a8bb 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectRequest.java @@ -1,118 +1,134 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3GetObjectRequest extends S3Request { - private String bucketName; - private String key; - private String version; - private boolean returnMetadata; - private boolean returnData; - private boolean inlineData; - private long byteRangeStart = -1; - private long byteRangeEnd = -1; - private boolean returnCompleteObjectOnConditionFailure; - private S3ConditionalHeaders conds; - - public S3GetObjectRequest() { - super(); - version = null; - returnCompleteObjectOnConditionFailure = false; - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public boolean isReturnMetadata() { - return returnMetadata; - } - - public void setReturnMetadata(boolean returnMetadata) { - this.returnMetadata = returnMetadata; - } - - public boolean isReturnData() { - return returnData; - } - - public void setReturnData(boolean returnData) { - this.returnData = returnData; - } - - public boolean isInlineData() { - return inlineData; - } - - public void setInlineData(boolean inlineData) { - this.inlineData = inlineData; - } - - public long getByteRangeStart() { - return byteRangeStart; - } - - public void setByteRangeStart(long byteRangeStart) { - this.byteRangeStart = byteRangeStart; - } - - public long getByteRangeEnd() { - return byteRangeEnd; - } - - public void setByteRangeEnd(long byteRangeEnd) { - this.byteRangeEnd = byteRangeEnd; - } - - public boolean isReturnCompleteObjectOnConditionFailure() { - return returnCompleteObjectOnConditionFailure; - } - - public void setReturnCompleteObjectOnConditionFailure(boolean returnCompleteObjectOnConditionFailure) { - this.returnCompleteObjectOnConditionFailure = returnCompleteObjectOnConditionFailure; - } - - public void setConditions(S3ConditionalHeaders conds) { - this.conds = conds; - } - - public S3ConditionalHeaders getConditions() { - return conds; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3GetObjectRequest extends S3Request { + private String bucketName; + private String key; + private String version; + private boolean returnMetadata; + private boolean returnData; + private boolean inlineData; + private long byteRangeStart = -1; + private long byteRangeEnd = -1; + private boolean returnCompleteObjectOnConditionFailure; + private S3ConditionalHeaders conds; + + public S3GetObjectRequest() { + super(); + version = null; + returnCompleteObjectOnConditionFailure = false; + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public boolean isReturnMetadata() { + return returnMetadata; + } + + public void setReturnMetadata(boolean returnMetadata) { + this.returnMetadata = returnMetadata; + } + + public boolean isReturnData() { + return returnData; + } + + public void setReturnData(boolean returnData) { + this.returnData = returnData; + } + + public boolean isInlineData() { + return inlineData; + } + + public void setInlineData(boolean inlineData) { + this.inlineData = inlineData; + } + + public long getByteRangeStart() { + return byteRangeStart; + } + + public void setByteRangeStart(long byteRangeStart) { + this.byteRangeStart = byteRangeStart; + } + + public long getByteRangeEnd() { + return byteRangeEnd; + } + + public void setByteRangeEnd(long byteRangeEnd) { + this.byteRangeEnd = byteRangeEnd; + } + + public boolean isReturnCompleteObjectOnConditionFailure() { + return returnCompleteObjectOnConditionFailure; + } + + public void setReturnCompleteObjectOnConditionFailure(boolean returnCompleteObjectOnConditionFailure) { + this.returnCompleteObjectOnConditionFailure = returnCompleteObjectOnConditionFailure; + } + + public void setConditions(S3ConditionalHeaders conds) { + this.conds = conds; + } + + public S3ConditionalHeaders getConditions() { + return conds; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectResponse.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectResponse.java index 99f6755bbdd..25f6d99860e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3GetObjectResponse.java @@ -1,95 +1,111 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.util.Calendar; - -import javax.activation.DataHandler; - -/** - * @author Kelven Yang - */ -public class S3GetObjectResponse extends S3Response { - protected String ETag; - protected Calendar lastModified; - protected DataHandler data; - protected S3MetaDataEntry[] metaEntries; - protected long contentLength; - protected String deleteMarker; - protected String version; - - public S3GetObjectResponse() { - super(); - deleteMarker = null; - } - - public String getETag() { - return ETag; - } - - public void setETag(String eTag) { - ETag = eTag; - } - - public String getDeleteMarker() { - return this.deleteMarker; - } - - public void setDeleteMarker(String deleteMarker) { - this.deleteMarker = deleteMarker; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public Calendar getLastModified() { - return lastModified; - } - - public void setLastModified(Calendar lastModified) { - this.lastModified = lastModified; - } - - public DataHandler getData() { - return data; - } - - public void setData(DataHandler data) { - this.data = data; - } - - public S3MetaDataEntry[] getMetaEntries() { - return metaEntries; - } - - public void setMetaEntries(S3MetaDataEntry[] metaEntries) { - this.metaEntries = metaEntries; - } - - public long getContentLength() { - return contentLength; - } - - public void setContentLength(long contentLength) { - this.contentLength = contentLength; - } -} - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.util.Calendar; + +import javax.activation.DataHandler; + +/** + * @author Kelven Yang + */ +public class S3GetObjectResponse extends S3Response { + protected String ETag; + protected Calendar lastModified; + protected DataHandler data; + protected S3MetaDataEntry[] metaEntries; + protected long contentLength; + protected String deleteMarker; + protected String version; + + public S3GetObjectResponse() { + super(); + deleteMarker = null; + } + + public String getETag() { + return ETag; + } + + public void setETag(String eTag) { + ETag = eTag; + } + + public String getDeleteMarker() { + return this.deleteMarker; + } + + public void setDeleteMarker(String deleteMarker) { + this.deleteMarker = deleteMarker; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public Calendar getLastModified() { + return lastModified; + } + + public void setLastModified(Calendar lastModified) { + this.lastModified = lastModified; + } + + public DataHandler getData() { + return data; + } + + public void setData(DataHandler data) { + this.data = data; + } + + public S3MetaDataEntry[] getMetaEntries() { + return metaEntries; + } + + public void setMetaEntries(S3MetaDataEntry[] metaEntries) { + this.metaEntries = metaEntries; + } + + public long getContentLength() { + return contentLength; + } + + public void setContentLength(long contentLength) { + this.contentLength = contentLength; + } +} + diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3Grant.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3Grant.java index 683df23c87e..265586f0ef6 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3Grant.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3Grant.java @@ -1,84 +1,100 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.util.List; - -import com.cloud.bridge.model.SAcl; -import com.cloud.bridge.model.SBucket; -import com.cloud.bridge.service.exception.UnsupportedException; - -/** - * @author Kelven Yang, John Zucker - * Each relation holds - * a grantee - which is one of SAcl.GRANTEE_USER, SAcl.GRANTEE_ALLUSERS, SAcl.GRANTEE_AUTHENTICATED - * a permission - which is one of SAcl.PERMISSION_PASS, SAcl.PERMISSION_NONE, SAcl.PERMISSION_READ, - * SAcl.PERMISSION_WRITE, SAcl.PERMISSION_READ_ACL, SAcl.PERMISSION_WRITE_ACL, SAcl.PERMISSION_FULL - * canonicalUserID - */ -public class S3Grant { - private int grantee; // SAcl.GRANTEE_USER etc - private int permission; // SAcl.PERMISSION_READ etc - private String canonicalUserID; - - public S3Grant() { - } - - public int getGrantee() { - return grantee; - } - - public void setGrantee(int grantee) { - this.grantee = grantee; - } - - public int getPermission() { - return permission; - } - - public void setPermission(int permission) { - this.permission = permission; - } - - public String getCanonicalUserID() { - return canonicalUserID; - } - - public void setCanonicalUserID(String canonicalUserID) { - this.canonicalUserID = canonicalUserID; - } - - /* Return an array of S3Grants holding the permissions of grantees by grantee type and their canonicalUserIds. - * Used by S3 engine to get ACL policy requests for buckets and objects. - */ - public static S3Grant[] toGrants(List grants) { - if(grants != null) - { - S3Grant[] entries = new S3Grant[grants.size()]; - int i = 0; - for(SAcl acl: grants) { - entries[i] = new S3Grant(); - entries[i].setGrantee(acl.getGranteeType()); - entries[i].setCanonicalUserID(acl.getGranteeCanonicalId()); - entries[i].setPermission(acl.getPermission()); - i++; - } - return entries; - } - return null; - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.util.List; + +import com.cloud.bridge.model.SAcl; +import com.cloud.bridge.model.SBucket; +import com.cloud.bridge.service.exception.UnsupportedException; + +/** + * @author Kelven Yang, John Zucker + * Each relation holds + * a grantee - which is one of SAcl.GRANTEE_USER, SAcl.GRANTEE_ALLUSERS, SAcl.GRANTEE_AUTHENTICATED + * a permission - which is one of SAcl.PERMISSION_PASS, SAcl.PERMISSION_NONE, SAcl.PERMISSION_READ, + * SAcl.PERMISSION_WRITE, SAcl.PERMISSION_READ_ACL, SAcl.PERMISSION_WRITE_ACL, SAcl.PERMISSION_FULL + * canonicalUserID + */ +public class S3Grant { + private int grantee; // SAcl.GRANTEE_USER etc + private int permission; // SAcl.PERMISSION_READ etc + private String canonicalUserID; + + public S3Grant() { + } + + public int getGrantee() { + return grantee; + } + + public void setGrantee(int grantee) { + this.grantee = grantee; + } + + public int getPermission() { + return permission; + } + + public void setPermission(int permission) { + this.permission = permission; + } + + public String getCanonicalUserID() { + return canonicalUserID; + } + + public void setCanonicalUserID(String canonicalUserID) { + this.canonicalUserID = canonicalUserID; + } + + /* Return an array of S3Grants holding the permissions of grantees by grantee type and their canonicalUserIds. + * Used by S3 engine to get ACL policy requests for buckets and objects. + */ + public static S3Grant[] toGrants(List grants) { + if(grants != null) + { + S3Grant[] entries = new S3Grant[grants.size()]; + int i = 0; + for(SAcl acl: grants) { + entries[i] = new S3Grant(); + entries[i].setGrantee(acl.getGranteeType()); + entries[i].setCanonicalUserID(acl.getGranteeCanonicalId()); + entries[i].setPermission(acl.getPermission()); + i++; + } + return entries; + } + return null; + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3HostCallingFormat.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3HostCallingFormat.java index d5ea1542036..d8c31613b0e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3HostCallingFormat.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3HostCallingFormat.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.core.s3; import java.net.MalformedURLException; diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsEntry.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsEntry.java index 2899dc587f8..01743e5123e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsEntry.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsEntry.java @@ -1,58 +1,74 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.util.Calendar; -import java.util.TimeZone; - -/** - * @author Kelven Yang - */ -public class S3ListAllMyBucketsEntry { - private String name; - private Calendar creationDate; - - public S3ListAllMyBucketsEntry() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Calendar getCreationDate() { - - // cal.setTimeZone(TimeZone.getTimeZone("Z")); - // java.util.Date d = cal.getTime(); - - // java.util.Date d = creationDate.getTime(); - // com.cloud.bridge.util.ISO8601SimpleDateTimeFormat sdf = new com.cloud.bridge.util.ISO8601SimpleDateTimeFormat(); - // sdf.format(d); - // java.lang.StringBuffer b = com.cloud.bridge.util.ISO8601SimpleDateTimeFormat.format(d); return b; - - return creationDate; - - - - } - - public void setCreationDate(Calendar creationDate) { - this.creationDate = creationDate; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.util.Calendar; +import java.util.TimeZone; + +/** + * @author Kelven Yang + */ +public class S3ListAllMyBucketsEntry { + private String name; + private Calendar creationDate; + + public S3ListAllMyBucketsEntry() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Calendar getCreationDate() { + + // cal.setTimeZone(TimeZone.getTimeZone("Z")); + // java.util.Date d = cal.getTime(); + + // java.util.Date d = creationDate.getTime(); + // com.cloud.bridge.util.ISO8601SimpleDateTimeFormat sdf = new com.cloud.bridge.util.ISO8601SimpleDateTimeFormat(); + // sdf.format(d); + // java.lang.StringBuffer b = com.cloud.bridge.util.ISO8601SimpleDateTimeFormat.format(d); return b; + + return creationDate; + + + + } + + public void setCreationDate(Calendar creationDate) { + this.creationDate = creationDate; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsRequest.java index 3e73a3cce18..4c6d661b281 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsRequest.java @@ -1,25 +1,41 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3ListAllMyBucketsRequest extends S3Request { - public S3ListAllMyBucketsRequest() { - super(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3ListAllMyBucketsRequest extends S3Request { + public S3ListAllMyBucketsRequest() { + super(); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsResponse.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsResponse.java index a39e32b8705..30a2f1f2138 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListAllMyBucketsResponse.java @@ -1,46 +1,62 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3ListAllMyBucketsResponse extends S3Response { - - private S3CanonicalUser owner; - private S3ListAllMyBucketsEntry[] buckets; - - public S3ListAllMyBucketsResponse() { - super(); - } - - public S3CanonicalUser getOwner() { - return owner; - } - - public void setOwner(S3CanonicalUser owner) { - this.owner = owner; - } - - public S3ListAllMyBucketsEntry[] getBuckets() { - return buckets; - } - - public void setBuckets(S3ListAllMyBucketsEntry[] buckets) { - this.buckets = buckets; - } -} - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3ListAllMyBucketsResponse extends S3Response { + + private S3CanonicalUser owner; + private S3ListAllMyBucketsEntry[] buckets; + + public S3ListAllMyBucketsResponse() { + super(); + } + + public S3CanonicalUser getOwner() { + return owner; + } + + public void setOwner(S3CanonicalUser owner) { + this.owner = owner; + } + + public S3ListAllMyBucketsEntry[] getBuckets() { + return buckets; + } + + public void setBuckets(S3ListAllMyBucketsEntry[] buckets) { + this.buckets = buckets; + } +} + diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketObjectEntry.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketObjectEntry.java index 972206c680e..cf14662194a 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketObjectEntry.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketObjectEntry.java @@ -1,141 +1,157 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.util.Calendar; - -import com.cloud.bridge.util.XElement; - -/** - * @author Kelven Yang - */ -public class S3ListBucketObjectEntry { - - @XElement(name="Key") - protected String key; - - protected String version; - protected boolean isLatest; - protected boolean isDeletionMarker; - - @XElement(name="LastModified") - protected Calendar lastModified; - - @XElement(name="ETag") - protected String ETag; - - @XElement(name="Size") - protected long size; - - @XElement(name="Owner") - protected S3CanonicalUser owner = new S3CanonicalUser(); - - @XElement(name="StorageClass") - protected String storageClass; - - public S3ListBucketObjectEntry() { - isLatest = false; - isDeletionMarker = false; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public boolean getIsLatest() { - return isLatest; - } - - public void setIsLatest(boolean isLatest) { - this.isLatest = isLatest; - } - - public boolean getIsDeletionMarker() { - return isDeletionMarker; - } - - public void setIsDeletionMarker(boolean isDeletionMarker) { - this.isDeletionMarker = isDeletionMarker; - } - - public String getETag() { - return ETag; - } - - public void setETag(String eTag) { - ETag = eTag; - } - - public long getSize() { - return size; - } - - public void setSize(long size) { - this.size = size; - } - - public Calendar getLastModified() { - return lastModified; - } - - public void setLastModified(Calendar lastModified) { - this.lastModified = lastModified; - } - - public String getOwnerCanonicalId() { - return owner.getID(); - } - - public void setOwnerCanonicalId(String ownerCanonicalId) { - owner.setID(ownerCanonicalId); - } - - public String getOwnerDisplayName() { - return owner.getDisplayName(); - } - - public void setOwnerDisplayName(String ownerDisplayName) { - owner.setDisplayName(ownerDisplayName); - } - - public S3CanonicalUser getOwner() { - return owner; - } - - public void setOwner(S3CanonicalUser owner) { - this.owner = owner; - } - - public String getStorageClass() { - return storageClass; - } - - public void setStorageClass(String storageClass) { - this.storageClass = storageClass; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.util.Calendar; + +import com.cloud.bridge.util.XElement; + +/** + * @author Kelven Yang + */ +public class S3ListBucketObjectEntry { + + @XElement(name="Key") + protected String key; + + protected String version; + protected boolean isLatest; + protected boolean isDeletionMarker; + + @XElement(name="LastModified") + protected Calendar lastModified; + + @XElement(name="ETag") + protected String ETag; + + @XElement(name="Size") + protected long size; + + @XElement(name="Owner") + protected S3CanonicalUser owner = new S3CanonicalUser(); + + @XElement(name="StorageClass") + protected String storageClass; + + public S3ListBucketObjectEntry() { + isLatest = false; + isDeletionMarker = false; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public boolean getIsLatest() { + return isLatest; + } + + public void setIsLatest(boolean isLatest) { + this.isLatest = isLatest; + } + + public boolean getIsDeletionMarker() { + return isDeletionMarker; + } + + public void setIsDeletionMarker(boolean isDeletionMarker) { + this.isDeletionMarker = isDeletionMarker; + } + + public String getETag() { + return ETag; + } + + public void setETag(String eTag) { + ETag = eTag; + } + + public long getSize() { + return size; + } + + public void setSize(long size) { + this.size = size; + } + + public Calendar getLastModified() { + return lastModified; + } + + public void setLastModified(Calendar lastModified) { + this.lastModified = lastModified; + } + + public String getOwnerCanonicalId() { + return owner.getID(); + } + + public void setOwnerCanonicalId(String ownerCanonicalId) { + owner.setID(ownerCanonicalId); + } + + public String getOwnerDisplayName() { + return owner.getDisplayName(); + } + + public void setOwnerDisplayName(String ownerDisplayName) { + owner.setDisplayName(ownerDisplayName); + } + + public S3CanonicalUser getOwner() { + return owner; + } + + public void setOwner(S3CanonicalUser owner) { + this.owner = owner; + } + + public String getStorageClass() { + return storageClass; + } + + public void setStorageClass(String storageClass) { + this.storageClass = storageClass; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketPrefixEntry.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketPrefixEntry.java index 6c8d76e653e..97189c9939d 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketPrefixEntry.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketPrefixEntry.java @@ -1,39 +1,55 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import com.cloud.bridge.util.XElement; - -/** - * @author Kelven Yang - */ -public class S3ListBucketPrefixEntry { - - @XElement(name="Prefix") - protected String prefix; - - public S3ListBucketPrefixEntry() { - } - - public String getPrefix() { - return prefix; - } - - public void setPrefix(String prefix) { - this.prefix = prefix; - } -} - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import com.cloud.bridge.util.XElement; + +/** + * @author Kelven Yang + */ +public class S3ListBucketPrefixEntry { + + @XElement(name="Prefix") + protected String prefix; + + public S3ListBucketPrefixEntry() { + } + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } +} + diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketRequest.java index 53e8da8f5d9..d91d559c85e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketRequest.java @@ -1,80 +1,96 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3ListBucketRequest extends S3Request { - protected String bucketName; - protected String prefix; - protected String marker; - protected String delimiter; - protected String versionIdMarker; - protected int maxKeys; - - public S3ListBucketRequest() { - super(); - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public String getPrefix() { - return prefix; - } - - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - public String getMarker() { - return marker; - } - - public void setMarker(String marker) { - this.marker = marker; - } - - public String getDelimiter() { - return delimiter; - } - - public void setDelimiter(String delimiter) { - this.delimiter = delimiter; - } - - public String getVersionIdMarker() { - return versionIdMarker; - } - - public void setVersionIdMarker(String versionIdMarker) { - this.versionIdMarker = versionIdMarker; - } - - public int getMaxKeys() { - return maxKeys; - } - - public void setMaxKeys(int maxKeys) { - this.maxKeys = maxKeys; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3ListBucketRequest extends S3Request { + protected String bucketName; + protected String prefix; + protected String marker; + protected String delimiter; + protected String versionIdMarker; + protected int maxKeys; + + public S3ListBucketRequest() { + super(); + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public String getMarker() { + return marker; + } + + public void setMarker(String marker) { + this.marker = marker; + } + + public String getDelimiter() { + return delimiter; + } + + public void setDelimiter(String delimiter) { + this.delimiter = delimiter; + } + + public String getVersionIdMarker() { + return versionIdMarker; + } + + public void setVersionIdMarker(String versionIdMarker) { + this.versionIdMarker = versionIdMarker; + } + + public int getMaxKeys() { + return maxKeys; + } + + public void setMaxKeys(int maxKeys) { + this.maxKeys = maxKeys; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketResponse.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketResponse.java index e277b12faff..3f312ec404f 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3ListBucketResponse.java @@ -1,124 +1,140 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import com.cloud.bridge.util.XElement; - -/** - * @author Kelven Yang - */ -public class S3ListBucketResponse extends S3Response { - - @XElement(name="Name") - protected String bucketName; - - @XElement(name="Prefix") - protected String prefix; - - @XElement(name="Marker") - protected String marker; - - @XElement(name="MaxKeys") - protected int maxKeys; - - @XElement(name="IsTruncated") - protected boolean isTruncated; - - protected String delimiter; - protected String nextMarker; - - @XElement(name="ContentsList", item="Contents", itemClass="com.cloud.gate.service.core.s3.S3ListBucketObjectEntry") - protected S3ListBucketObjectEntry[] contents; - - @XElement(name="CommonPrefixesList", item="CommonPrefixes", itemClass="com.cloud.gate.service.core.s3.S3ListBucketPrefixEntry") - protected S3ListBucketPrefixEntry[] commonPrefixes; - - public S3ListBucketResponse() { - super(); - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public String getMarker() { - return marker; - } - - public void setMarker(String marker) { - this.marker = marker; - } - - public String getPrefix() { - return prefix; - } - - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - public String getDelimiter() { - return delimiter; - } - - public void setDelimiter(String delimiter) { - this.delimiter = delimiter; - } - - public int getMaxKeys() { - return maxKeys; - } - - public void setMaxKeys(int maxKeys) { - this.maxKeys = maxKeys; - } - - public boolean isTruncated() { - return isTruncated; - } - - public void setTruncated(boolean isTruncated) { - this.isTruncated = isTruncated; - } - - public String getNextMarker() { - return nextMarker; - } - - public void setNextMarker(String nextMarker) { - this.nextMarker = nextMarker; - } - - public S3ListBucketPrefixEntry[] getCommonPrefixes() { - return commonPrefixes; - } - - public void setCommonPrefixes(S3ListBucketPrefixEntry[] commonPrefixes) { - this.commonPrefixes = commonPrefixes; - } - - public S3ListBucketObjectEntry[] getContents() { - return contents; - } - - public void setContents(S3ListBucketObjectEntry[] contents) { - this.contents = contents; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import com.cloud.bridge.util.XElement; + +/** + * @author Kelven Yang + */ +public class S3ListBucketResponse extends S3Response { + + @XElement(name="Name") + protected String bucketName; + + @XElement(name="Prefix") + protected String prefix; + + @XElement(name="Marker") + protected String marker; + + @XElement(name="MaxKeys") + protected int maxKeys; + + @XElement(name="IsTruncated") + protected boolean isTruncated; + + protected String delimiter; + protected String nextMarker; + + @XElement(name="ContentsList", item="Contents", itemClass="com.cloud.gate.service.core.s3.S3ListBucketObjectEntry") + protected S3ListBucketObjectEntry[] contents; + + @XElement(name="CommonPrefixesList", item="CommonPrefixes", itemClass="com.cloud.gate.service.core.s3.S3ListBucketPrefixEntry") + protected S3ListBucketPrefixEntry[] commonPrefixes; + + public S3ListBucketResponse() { + super(); + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getMarker() { + return marker; + } + + public void setMarker(String marker) { + this.marker = marker; + } + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public String getDelimiter() { + return delimiter; + } + + public void setDelimiter(String delimiter) { + this.delimiter = delimiter; + } + + public int getMaxKeys() { + return maxKeys; + } + + public void setMaxKeys(int maxKeys) { + this.maxKeys = maxKeys; + } + + public boolean isTruncated() { + return isTruncated; + } + + public void setTruncated(boolean isTruncated) { + this.isTruncated = isTruncated; + } + + public String getNextMarker() { + return nextMarker; + } + + public void setNextMarker(String nextMarker) { + this.nextMarker = nextMarker; + } + + public S3ListBucketPrefixEntry[] getCommonPrefixes() { + return commonPrefixes; + } + + public void setCommonPrefixes(S3ListBucketPrefixEntry[] commonPrefixes) { + this.commonPrefixes = commonPrefixes; + } + + public S3ListBucketObjectEntry[] getContents() { + return contents; + } + + public void setContents(S3ListBucketObjectEntry[] contents) { + this.contents = contents; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3MetaDataEntry.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3MetaDataEntry.java index bf797eb099d..da11747652f 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3MetaDataEntry.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3MetaDataEntry.java @@ -1,43 +1,59 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven - */ -public class S3MetaDataEntry { - private String name; - private String value; - - public S3MetaDataEntry() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven + */ +public class S3MetaDataEntry { + private String name; + private String value; + + public S3MetaDataEntry() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartPart.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartPart.java index 0d4bc59d59b..73ab2a769ee 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartPart.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartPart.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartUpload.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartUpload.java index 355f9ed07a1..bc566cd761e 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartUpload.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3MultipartUpload.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyAction.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyAction.java index 33daadeb017..4a4d5d7c88b 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyAction.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyAction.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyArnCondition.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyArnCondition.java index 0d678c01955..5e2226c338d 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyArnCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyArnCondition.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyBoolCondition.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyBoolCondition.java index 1f71099e68e..cb63b3caea3 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyBoolCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyBoolCondition.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyCondition.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyCondition.java index 4af142feb70..38a6a868508 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyCondition.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyConditionBlock.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyConditionBlock.java index 032485e2c6d..6ab8f794a6b 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyConditionBlock.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyConditionBlock.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyContext.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyContext.java index 17cfa64a291..c63d0c09a52 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyContext.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyContext.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyDateCondition.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyDateCondition.java index e5a6936279b..a48e12b3655 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyDateCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyDateCondition.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyIPAddressCondition.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyIPAddressCondition.java index 1ae521de930..1c31715756a 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyIPAddressCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyIPAddressCondition.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyNumericCondition.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyNumericCondition.java index 9e399cf5741..33d05d6b9f3 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyNumericCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyNumericCondition.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyPrincipal.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyPrincipal.java index ad5a11616ad..52702899127 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyPrincipal.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyPrincipal.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStatement.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStatement.java index 76ad99245ca..5532566c4aa 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStatement.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStatement.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStringCondition.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStringCondition.java index 389283f98f5..6950c18692c 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStringCondition.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PolicyStringCondition.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectInlineRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectInlineRequest.java index b37655cabd7..46f0ec525d7 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectInlineRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectInlineRequest.java @@ -1,111 +1,127 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - -import javax.activation.DataHandler; - -/** - * @author Kelven Yang, John Zucker - */ -public class S3PutObjectInlineRequest extends S3Request { - protected String bucketName; - protected String key; - protected long contentLength; - protected S3MetaDataEntry[] metaEntries; - protected S3AccessControlList acl; - protected String cannedAccessPolicy; // Canned ACLs are public-read, public-read-write, private, authenticated-read or log-delivery-write - protected DataHandler data; - protected String dataAsString; - - public S3PutObjectInlineRequest() { - super(); - data = null; - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public long getContentLength() { - return contentLength; - } - - public void setContentLength(long contentLength) { - this.contentLength = contentLength; - } - - public S3MetaDataEntry[] getMetaEntries() { - return metaEntries; - } - - public void setMetaEntries(S3MetaDataEntry[] metaEntries) { - this.metaEntries = metaEntries; - } - - public S3AccessControlList getAcl() { - return acl; - } - - public void setAcl(S3AccessControlList acl) { - this.acl = acl; - } - - public String getCannedAccess() { - return cannedAccessPolicy; - } - - public void setCannedAccess(String cannedAccessPolicy) { - this.cannedAccessPolicy = cannedAccessPolicy; - } - - public DataHandler getData() { - return data; - } - - public void setData(DataHandler data) { - this.data = data; - } - - public void setDataAsString( String data ) { - this.dataAsString = data; - } - - public InputStream getDataInputStream() throws IOException - { - if ( null == data ) - { - ByteArrayInputStream bs = new ByteArrayInputStream( dataAsString.getBytes()); - return bs; - } - else return data.getInputStream(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +import javax.activation.DataHandler; + +/** + * @author Kelven Yang, John Zucker + */ +public class S3PutObjectInlineRequest extends S3Request { + protected String bucketName; + protected String key; + protected long contentLength; + protected S3MetaDataEntry[] metaEntries; + protected S3AccessControlList acl; + protected String cannedAccessPolicy; // Canned ACLs are public-read, public-read-write, private, authenticated-read or log-delivery-write + protected DataHandler data; + protected String dataAsString; + + public S3PutObjectInlineRequest() { + super(); + data = null; + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public long getContentLength() { + return contentLength; + } + + public void setContentLength(long contentLength) { + this.contentLength = contentLength; + } + + public S3MetaDataEntry[] getMetaEntries() { + return metaEntries; + } + + public void setMetaEntries(S3MetaDataEntry[] metaEntries) { + this.metaEntries = metaEntries; + } + + public S3AccessControlList getAcl() { + return acl; + } + + public void setAcl(S3AccessControlList acl) { + this.acl = acl; + } + + public String getCannedAccess() { + return cannedAccessPolicy; + } + + public void setCannedAccess(String cannedAccessPolicy) { + this.cannedAccessPolicy = cannedAccessPolicy; + } + + public DataHandler getData() { + return data; + } + + public void setData(DataHandler data) { + this.data = data; + } + + public void setDataAsString( String data ) { + this.dataAsString = data; + } + + public InputStream getDataInputStream() throws IOException + { + if ( null == data ) + { + ByteArrayInputStream bs = new ByteArrayInputStream( dataAsString.getBytes()); + return bs; + } + else return data.getInputStream(); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectInlineResponse.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectInlineResponse.java index 4b4df562664..c376d8a6a7d 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectInlineResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectInlineResponse.java @@ -1,67 +1,83 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.util.Calendar; - -/** - * @author Kelven Yang, John Zucker - */ -public class S3PutObjectInlineResponse extends S3Response { - protected String ETag; - protected Calendar lastModified; - protected String version; - protected int uploadId; - - public S3PutObjectInlineResponse() { - super(); - uploadId = -1; - } - - // add ETag header computed as Base64 MD5 whenever object is uploaded or updated - // the Base64 is represented in lowercase - public String getETag() { - return ETag; - } - - public void setETag(String eTag) { - this.ETag = eTag; - } - - public Calendar getLastModified() { - return lastModified; - } - - public void setLastModified(Calendar lastModified) { - this.lastModified = lastModified; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public int getUploadId() { - return uploadId; - } - - public void setUploadId(int uploadId) { - this.uploadId = uploadId; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.util.Calendar; + +/** + * @author Kelven Yang, John Zucker + */ +public class S3PutObjectInlineResponse extends S3Response { + protected String ETag; + protected Calendar lastModified; + protected String version; + protected int uploadId; + + public S3PutObjectInlineResponse() { + super(); + uploadId = -1; + } + + // add ETag header computed as Base64 MD5 whenever object is uploaded or updated + // the Base64 is represented in lowercase + public String getETag() { + return ETag; + } + + public void setETag(String eTag) { + this.ETag = eTag; + } + + public Calendar getLastModified() { + return lastModified; + } + + public void setLastModified(Calendar lastModified) { + this.lastModified = lastModified; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public int getUploadId() { + return uploadId; + } + + public void setUploadId(int uploadId) { + this.uploadId = uploadId; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectRequest.java index ec0d6decc2f..d2e82b8e289 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectRequest.java @@ -1,109 +1,125 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.io.InputStream; - -/** - * @author Kelven Yang - */ -public class S3PutObjectRequest extends S3Request { - protected String bucketName; - protected String key; - protected String rawTimestamp; // -> original is needed for authentication - protected String storageClass; - protected String credential; - protected long contentLength; - protected S3MetaDataEntry[] metaEntries; - protected S3AccessControlList acl; - protected InputStream data; - - public S3PutObjectRequest() { - super(); - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public long getContentLength() { - return contentLength; - } - - public void setContentLength(long contentLength) { - this.contentLength = contentLength; - } - - public S3MetaDataEntry[] getMetaEntries() { - return metaEntries; - } - - public void setMetaEntries(S3MetaDataEntry[] metaEntries) { - this.metaEntries = metaEntries; - } - - public S3AccessControlList getAcl() { - return acl; - } - - public void setAcl(S3AccessControlList acl) { - this.acl = acl; - } - - public InputStream getInputStream() { - return data; - } - - public void setData(InputStream is) { - this.data = is; - } - - public String getStorageClass() { - return storageClass; - } - - public void setStorageClass(String storageClass) { - this.storageClass = storageClass; - } - - public String getCredential() { - return credential; - } - - public void setCredential(String credential) { - this.credential = credential; - } - - public String getRawTimestamp() { - return rawTimestamp; - } - - public void setRawTimestamp(String rawTimestamp) { - this.rawTimestamp = rawTimestamp; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.io.InputStream; + +/** + * @author Kelven Yang + */ +public class S3PutObjectRequest extends S3Request { + protected String bucketName; + protected String key; + protected String rawTimestamp; // -> original is needed for authentication + protected String storageClass; + protected String credential; + protected long contentLength; + protected S3MetaDataEntry[] metaEntries; + protected S3AccessControlList acl; + protected InputStream data; + + public S3PutObjectRequest() { + super(); + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public long getContentLength() { + return contentLength; + } + + public void setContentLength(long contentLength) { + this.contentLength = contentLength; + } + + public S3MetaDataEntry[] getMetaEntries() { + return metaEntries; + } + + public void setMetaEntries(S3MetaDataEntry[] metaEntries) { + this.metaEntries = metaEntries; + } + + public S3AccessControlList getAcl() { + return acl; + } + + public void setAcl(S3AccessControlList acl) { + this.acl = acl; + } + + public InputStream getInputStream() { + return data; + } + + public void setData(InputStream is) { + this.data = is; + } + + public String getStorageClass() { + return storageClass; + } + + public void setStorageClass(String storageClass) { + this.storageClass = storageClass; + } + + public String getCredential() { + return credential; + } + + public void setCredential(String credential) { + this.credential = credential; + } + + public String getRawTimestamp() { + return rawTimestamp; + } + + public void setRawTimestamp(String rawTimestamp) { + this.rawTimestamp = rawTimestamp; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectResponse.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectResponse.java index 3a61e2b4e4e..bc6899c8563 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectResponse.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3PutObjectResponse.java @@ -1,46 +1,62 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.util.Calendar; - -/** - * @author Kelven Yang - */ -public class S3PutObjectResponse extends S3Response { - protected String ETag; - protected Calendar lastModified; - - public S3PutObjectResponse() { - super(); - } - - public String getETag() { - return ETag; - } - - public void setETag(String eTag) { - this.ETag = eTag; - } - - public Calendar getLastModified() { - return lastModified; - } - - public void setLastModified(Calendar lastModified) { - this.lastModified = lastModified; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.util.Calendar; + +/** + * @author Kelven Yang + */ +public class S3PutObjectResponse extends S3Response { + protected String ETag; + protected Calendar lastModified; + + public S3PutObjectResponse() { + super(); + } + + public String getETag() { + return ETag; + } + + public void setETag(String eTag) { + this.ETag = eTag; + } + + public Calendar getLastModified() { + return lastModified; + } + + public void setLastModified(Calendar lastModified) { + this.lastModified = lastModified; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3Request.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3Request.java index 65b9b32ebfe..a1ecb5c2346 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3Request.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3Request.java @@ -1,54 +1,70 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -import java.util.Calendar; - -/** - * @author Kelven - */ -public class S3Request { - protected String accessKey; - protected String signature; - protected Calendar requestTimestamp; - - public S3Request() { - } - - public String getAccessKey() { - return accessKey; - } - - public void setAccessKey(String accessKey) { - this.accessKey = accessKey; - } - - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - public Calendar getRequestTimestamp() { - return requestTimestamp; - } - - public void setRequestTimestamp(Calendar requestTimestamp) { - this.requestTimestamp = requestTimestamp; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +import java.util.Calendar; + +/** + * @author Kelven + */ +public class S3Request { + protected String accessKey; + protected String signature; + protected Calendar requestTimestamp; + + public S3Request() { + } + + public String getAccessKey() { + return accessKey; + } + + public void setAccessKey(String accessKey) { + this.accessKey = accessKey; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public Calendar getRequestTimestamp() { + return requestTimestamp; + } + + public void setRequestTimestamp(Calendar requestTimestamp) { + this.requestTimestamp = requestTimestamp; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3Response.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3Response.java index 14a8917ceda..fe6b0af689a 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3Response.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3Response.java @@ -1,57 +1,73 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3Response { - protected int resultCode; - protected String version; - protected String resultDescription; - - public S3Response() { - } - - public S3Response(int code, String description) { - resultCode = code; - resultDescription = description; - } - - public int getResultCode() { - return resultCode; - } - - public void setResultCode(int code) { - resultCode = code; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getResultDescription() { - return resultDescription; - } - - public void setResultDescription(String description) { - resultDescription = description; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3Response { + protected int resultCode; + protected String version; + protected String resultDescription; + + public S3Response() { + } + + public S3Response(int code, String description) { + resultCode = code; + resultDescription = description; + } + + public int getResultCode() { + return resultCode; + } + + public void setResultCode(int code) { + resultCode = code; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getResultDescription() { + return resultDescription; + } + + public void setResultDescription(String description) { + resultDescription = description; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3SetBucketAccessControlPolicyRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3SetBucketAccessControlPolicyRequest.java index 1b10ca45400..0dbe47f5c68 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3SetBucketAccessControlPolicyRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3SetBucketAccessControlPolicyRequest.java @@ -1,44 +1,60 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3SetBucketAccessControlPolicyRequest extends S3Request { - protected String bucketName; - protected S3AccessControlList acl; - - public S3SetBucketAccessControlPolicyRequest() { - super(); - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public S3AccessControlList getAcl() { - return acl; - } - - public void setAcl(S3AccessControlList acl) { - this.acl = acl; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3SetBucketAccessControlPolicyRequest extends S3Request { + protected String bucketName; + protected S3AccessControlList acl; + + public S3SetBucketAccessControlPolicyRequest() { + super(); + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public S3AccessControlList getAcl() { + return acl; + } + + public void setAcl(S3AccessControlList acl) { + this.acl = acl; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3SetObjectAccessControlPolicyRequest.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3SetObjectAccessControlPolicyRequest.java index dea47c80138..4fafdaa601b 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3SetObjectAccessControlPolicyRequest.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3SetObjectAccessControlPolicyRequest.java @@ -1,62 +1,78 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.core.s3; - -/** - * @author Kelven Yang - */ -public class S3SetObjectAccessControlPolicyRequest extends S3Request { - protected String bucketName; - protected String key; - protected String version; - protected S3AccessControlList acl; - - public S3SetObjectAccessControlPolicyRequest() { - super(); - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public S3AccessControlList getAcl() { - return acl; - } - - public void setAcl(S3AccessControlList acl) { - this.acl = acl; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.core.s3; + +/** + * @author Kelven Yang + */ +public class S3SetObjectAccessControlPolicyRequest extends S3Request { + protected String bucketName; + protected String key; + protected String version; + protected S3AccessControlList acl; + + public S3SetObjectAccessControlPolicyRequest() { + super(); + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public S3AccessControlList getAcl() { + return acl; + } + + public void setAcl(S3AccessControlList acl) { + this.acl = acl; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/ConfigurationException.java b/awsapi/src/com/cloud/bridge/service/exception/ConfigurationException.java index b6b39d6c42b..74dc3445172 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/ConfigurationException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/ConfigurationException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven Yang - */ -public class ConfigurationException extends RuntimeException { - private static final long serialVersionUID = 6810626920539827556L; - - public ConfigurationException() { - } - - public ConfigurationException(String message) { - super(message); - } - - public ConfigurationException(Throwable e) { - super(e); - } - - public ConfigurationException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven Yang + */ +public class ConfigurationException extends RuntimeException { + private static final long serialVersionUID = 6810626920539827556L; + + public ConfigurationException() { + } + + public ConfigurationException(String message) { + super(message); + } + + public ConfigurationException(Throwable e) { + super(e); + } + + public ConfigurationException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/EC2ServiceException.java b/awsapi/src/com/cloud/bridge/service/exception/EC2ServiceException.java index 8b26d61d40c..b7578b85931 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/EC2ServiceException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/EC2ServiceException.java @@ -1,151 +1,167 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -import javax.xml.namespace.QName; - -import org.apache.axis2.AxisFault; - -public class EC2ServiceException extends RuntimeException { - private static final long serialVersionUID = 8857313467757867680L; - - // ServerError & ClientError are correct as of schema version 2010-08-31 - - public static enum ServerError { - InsufficientAddressCapacity("Server.InsufficientAddressCapacity", 500), - InsufficientInstanceCapacity("Server.InsufficientInstanceCapacity", 500), - InsufficientReservedInstanceCapacity("Server.InsufficientReservedInstanceCapacity", 500), - InternalError("Server.InternalError", 500), - Unavailable("Server.Unavailable", 501); - - private String errorString; - private int httpErrorCode; - - private ServerError(String errorString, int errorCode) { - this.errorString = errorString; - this.httpErrorCode = errorCode; - } - - public String getErrorString() { return errorString; } - public int getHttpErrorCode() {return httpErrorCode; } - } - - public static enum ClientError { - AddressLimitExceeded("Client.AddressLimitExceeded", 400), - AttachmentLimitExceeded("Client.AttachmentLimitExceeded", 400), - AuthFailure("Client.AuthFailure", 400), - Blocked("Client.Blocked", 400), - FilterLimitExceeded("Client.FilterLimitExceeded", 400), - IdempotentParameterMismatch("Client.IdempotentParameterMismatch", 400), - IncorrectState("Client.IncorrectState", 400), - InstanceLimitExceeded("Client.InstanceLimitExceeded", 400), - InsufficientInstanceCapacity("Client.InsufficientInstanceCapacity", 400), - InsufficientReservedInstancesCapacity("Client.InsufficientReservedInstancesCapacity", 400), - InvalidAMIAttributeItemValue("Client.InvalidAMIAttributeItemValue", 400), - InvalidAMIID_Malformed("Client.InvalidAMIID.Malformed", 400), - InvalidAMIID_NotFound("Client.InvalidAMIID.NotFound", 400), - InvalidAMIID_Unavailable("Client.InvalidAMIID.Unavailable", 400), - InvalidAttachment_NotFound("Client.InvalidAttachment.NotFound", 400), - InvalidDevice_InUse("Client.InvalidDevice.InUse", 400), - InvalidGroup_Duplicate("Client.InvalidGroup.Duplicate", 400), - InvalidGroup_InUse("Client.InvalidGroup.InUse", 400), - InvalidGroup_NotFound("Client.InvalidGroup.NotFound", 400), - InvalidGroup_Reserved("Client.InvalidGroup.Reserved", 400), - InvalidInstanceID_Malformed("Client.InvalidInstanceID.Malformed", 400), - InvalidInstanceID_NotFound("Client.InvalidInstanceID.NotFound", 400), - InvalidIPAddress_InUse("Client.InvalidIPAddress.InUse", 400), - InvalidKeyPair_Duplicate("Client.InvalidKeyPair.Duplicate", 400), - InvalidKeyPair_Format("Client.InvalidKeyPair.Format", 400), - InvalidKeyPair_NotFound("Client.InvalidKeyPair.NotFound", 400), - InvalidManifest("Client.InvalidManifest", 400), - InvalidParameterCombination("Client.InvalidParameterCombination", 400), - InvalidParameterValue("Client.InvalidParameterValue", 400), - InvalidPermission_Duplicate("Client.InvalidPermission.Duplicate", 400), - InvalidPermission_Malformed("Client.InvalidPermission.Malformed", 400), - InvalidReservationID_Malformed("Client.InvalidReservationID.Malformed", 400), - InvalidReservationID_NotFound("Client.InvalidReservationID.NotFound", 400), - InvalidSnapshotID_Malformed("Client.InvalidSnapshotID.Malformed", 400), - InvalidSnapshot_NotFound("Client.InvalidSnapshot.NotFound", 400), - InvalidUserID_Malformed("Client.InvalidUserID.Malformed", 400), - InvalidReservedInstancesId("Client.InvalidReservedInstancesId", 400), - InvalidReservedInstancesOfferingId("Client.InvalidReservedInstancesOfferingId", 400), - InvalidVolumeID_Duplicate("Client.InvalidVolumeID.Duplicate", 400), - InvalidVolumeID_Malformed("Client.InvalidVolumeID.Malformed", 400), - InvalidVolume_NotFound("Client.InvalidVolume.NotFound", 400), - InvalidVolumeID_ZoneMismatch("Client.InvalidVolumeID.ZoneMismatch", 400), - InvalidZone_NotFound("Client.InvalidZone.NotFound", 400), - NonEBSInstance("Client.NonEBSInstance", 400), - PendingVerification("Client.PendingVerification", 400), - PendingSnapshotLimitExceeded("Client.PendingSnapshotLimitExceeded", 400), - ReservedInstancesLimitExceeded("Client.ReservedInstancesLimitExceeded", 400), - SnapshotLimitExceeded("Client.SnapshotLimitExceeded", 400), - UnknownParameter("Client.UnknownParameter", 400), - Unsupported("Client.Unsupported", 400), - VolumeLimitExceeded("Client.VolumeLimitExceeded", 400); - - private String errorString; - private int httpErrorCode; - - private ClientError(String errorString, int errorCode) { - this.errorString = errorString; - this.httpErrorCode = errorCode; - } - - public String getErrorString() { return errorString; } - public int getHttpErrorCode() {return httpErrorCode; } - } - - private int httpErrorCode = 0; - - public EC2ServiceException() { - } - - public EC2ServiceException(String message) { - super(message); - } - - public EC2ServiceException(Throwable e) { - super(e); - } - - public EC2ServiceException(String message, Throwable e) { - super(message, e); - } - - public EC2ServiceException(String message, int errorCode) { - super(message, new AxisFault(message, new QName("Error"))); - this.httpErrorCode = errorCode; - } - - public EC2ServiceException(String message, Throwable e, int errorCode) { - super(message, e); - this.httpErrorCode = errorCode; - } - - public EC2ServiceException(ServerError errorCode, String message) { - super(message, new AxisFault(message, new QName(errorCode.getErrorString()))); - this.httpErrorCode = errorCode.getHttpErrorCode(); - } - - public EC2ServiceException(ClientError errorCode, String message) { - super(message, new AxisFault(message, new QName(errorCode.getErrorString()))); - this.httpErrorCode = errorCode.getHttpErrorCode(); - } - - public int getErrorCode() { - return this.httpErrorCode; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +import javax.xml.namespace.QName; + +import org.apache.axis2.AxisFault; + +public class EC2ServiceException extends RuntimeException { + private static final long serialVersionUID = 8857313467757867680L; + + // ServerError & ClientError are correct as of schema version 2010-08-31 + + public static enum ServerError { + InsufficientAddressCapacity("Server.InsufficientAddressCapacity", 500), + InsufficientInstanceCapacity("Server.InsufficientInstanceCapacity", 500), + InsufficientReservedInstanceCapacity("Server.InsufficientReservedInstanceCapacity", 500), + InternalError("Server.InternalError", 500), + Unavailable("Server.Unavailable", 501); + + private String errorString; + private int httpErrorCode; + + private ServerError(String errorString, int errorCode) { + this.errorString = errorString; + this.httpErrorCode = errorCode; + } + + public String getErrorString() { return errorString; } + public int getHttpErrorCode() {return httpErrorCode; } + } + + public static enum ClientError { + AddressLimitExceeded("Client.AddressLimitExceeded", 400), + AttachmentLimitExceeded("Client.AttachmentLimitExceeded", 400), + AuthFailure("Client.AuthFailure", 400), + Blocked("Client.Blocked", 400), + FilterLimitExceeded("Client.FilterLimitExceeded", 400), + IdempotentParameterMismatch("Client.IdempotentParameterMismatch", 400), + IncorrectState("Client.IncorrectState", 400), + InstanceLimitExceeded("Client.InstanceLimitExceeded", 400), + InsufficientInstanceCapacity("Client.InsufficientInstanceCapacity", 400), + InsufficientReservedInstancesCapacity("Client.InsufficientReservedInstancesCapacity", 400), + InvalidAMIAttributeItemValue("Client.InvalidAMIAttributeItemValue", 400), + InvalidAMIID_Malformed("Client.InvalidAMIID.Malformed", 400), + InvalidAMIID_NotFound("Client.InvalidAMIID.NotFound", 400), + InvalidAMIID_Unavailable("Client.InvalidAMIID.Unavailable", 400), + InvalidAttachment_NotFound("Client.InvalidAttachment.NotFound", 400), + InvalidDevice_InUse("Client.InvalidDevice.InUse", 400), + InvalidGroup_Duplicate("Client.InvalidGroup.Duplicate", 400), + InvalidGroup_InUse("Client.InvalidGroup.InUse", 400), + InvalidGroup_NotFound("Client.InvalidGroup.NotFound", 400), + InvalidGroup_Reserved("Client.InvalidGroup.Reserved", 400), + InvalidInstanceID_Malformed("Client.InvalidInstanceID.Malformed", 400), + InvalidInstanceID_NotFound("Client.InvalidInstanceID.NotFound", 400), + InvalidIPAddress_InUse("Client.InvalidIPAddress.InUse", 400), + InvalidKeyPair_Duplicate("Client.InvalidKeyPair.Duplicate", 400), + InvalidKeyPair_Format("Client.InvalidKeyPair.Format", 400), + InvalidKeyPair_NotFound("Client.InvalidKeyPair.NotFound", 400), + InvalidManifest("Client.InvalidManifest", 400), + InvalidParameterCombination("Client.InvalidParameterCombination", 400), + InvalidParameterValue("Client.InvalidParameterValue", 400), + InvalidPermission_Duplicate("Client.InvalidPermission.Duplicate", 400), + InvalidPermission_Malformed("Client.InvalidPermission.Malformed", 400), + InvalidReservationID_Malformed("Client.InvalidReservationID.Malformed", 400), + InvalidReservationID_NotFound("Client.InvalidReservationID.NotFound", 400), + InvalidSnapshotID_Malformed("Client.InvalidSnapshotID.Malformed", 400), + InvalidSnapshot_NotFound("Client.InvalidSnapshot.NotFound", 400), + InvalidUserID_Malformed("Client.InvalidUserID.Malformed", 400), + InvalidReservedInstancesId("Client.InvalidReservedInstancesId", 400), + InvalidReservedInstancesOfferingId("Client.InvalidReservedInstancesOfferingId", 400), + InvalidVolumeID_Duplicate("Client.InvalidVolumeID.Duplicate", 400), + InvalidVolumeID_Malformed("Client.InvalidVolumeID.Malformed", 400), + InvalidVolume_NotFound("Client.InvalidVolume.NotFound", 400), + InvalidVolumeID_ZoneMismatch("Client.InvalidVolumeID.ZoneMismatch", 400), + InvalidZone_NotFound("Client.InvalidZone.NotFound", 400), + NonEBSInstance("Client.NonEBSInstance", 400), + PendingVerification("Client.PendingVerification", 400), + PendingSnapshotLimitExceeded("Client.PendingSnapshotLimitExceeded", 400), + ReservedInstancesLimitExceeded("Client.ReservedInstancesLimitExceeded", 400), + SnapshotLimitExceeded("Client.SnapshotLimitExceeded", 400), + UnknownParameter("Client.UnknownParameter", 400), + Unsupported("Client.Unsupported", 400), + VolumeLimitExceeded("Client.VolumeLimitExceeded", 400); + + private String errorString; + private int httpErrorCode; + + private ClientError(String errorString, int errorCode) { + this.errorString = errorString; + this.httpErrorCode = errorCode; + } + + public String getErrorString() { return errorString; } + public int getHttpErrorCode() {return httpErrorCode; } + } + + private int httpErrorCode = 0; + + public EC2ServiceException() { + } + + public EC2ServiceException(String message) { + super(message); + } + + public EC2ServiceException(Throwable e) { + super(e); + } + + public EC2ServiceException(String message, Throwable e) { + super(message, e); + } + + public EC2ServiceException(String message, int errorCode) { + super(message, new AxisFault(message, new QName("Error"))); + this.httpErrorCode = errorCode; + } + + public EC2ServiceException(String message, Throwable e, int errorCode) { + super(message, e); + this.httpErrorCode = errorCode; + } + + public EC2ServiceException(ServerError errorCode, String message) { + super(message, new AxisFault(message, new QName(errorCode.getErrorString()))); + this.httpErrorCode = errorCode.getHttpErrorCode(); + } + + public EC2ServiceException(ClientError errorCode, String message) { + super(message, new AxisFault(message, new QName(errorCode.getErrorString()))); + this.httpErrorCode = errorCode.getHttpErrorCode(); + } + + public int getErrorCode() { + return this.httpErrorCode; + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/FileNotExistException.java b/awsapi/src/com/cloud/bridge/service/exception/FileNotExistException.java index ea820586323..6bdf79e73a5 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/FileNotExistException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/FileNotExistException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven Yang - */ -public class FileNotExistException extends RuntimeException { - private static final long serialVersionUID = 5512751425783765269L; - - public FileNotExistException() { - } - - public FileNotExistException(String message) { - super(message); - } - - public FileNotExistException(Throwable e) { - super(e); - } - - public FileNotExistException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven Yang + */ +public class FileNotExistException extends RuntimeException { + private static final long serialVersionUID = 5512751425783765269L; + + public FileNotExistException() { + } + + public FileNotExistException(String message) { + super(message); + } + + public FileNotExistException(Throwable e) { + super(e); + } + + public FileNotExistException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/HostNotMountedException.java b/awsapi/src/com/cloud/bridge/service/exception/HostNotMountedException.java index 2d9548ac62f..af69b43857c 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/HostNotMountedException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/HostNotMountedException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven Yang - */ -public class HostNotMountedException extends RuntimeException { - private static final long serialVersionUID = 1798153102422117938L; - - public HostNotMountedException() { - } - - public HostNotMountedException(String message) { - super(message); - } - - public HostNotMountedException(Throwable e) { - super(e); - } - - public HostNotMountedException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven Yang + */ +public class HostNotMountedException extends RuntimeException { + private static final long serialVersionUID = 1798153102422117938L; + + public HostNotMountedException() { + } + + public HostNotMountedException(String message) { + super(message); + } + + public HostNotMountedException(Throwable e) { + super(e); + } + + public HostNotMountedException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/InternalErrorException.java b/awsapi/src/com/cloud/bridge/service/exception/InternalErrorException.java index 63cf752fea9..f025ce79200 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/InternalErrorException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/InternalErrorException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven Yang - */ -public class InternalErrorException extends RuntimeException { - private static final long serialVersionUID = 2996134346433756736L; - - public InternalErrorException() { - } - - public InternalErrorException(String message) { - super(message); - } - - public InternalErrorException(Throwable e) { - super(e); - } - - public InternalErrorException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven Yang + */ +public class InternalErrorException extends RuntimeException { + private static final long serialVersionUID = 2996134346433756736L; + + public InternalErrorException() { + } + + public InternalErrorException(String message) { + super(message); + } + + public InternalErrorException(Throwable e) { + super(e); + } + + public InternalErrorException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/InvalidBucketName.java b/awsapi/src/com/cloud/bridge/service/exception/InvalidBucketName.java index 5fc8523a73f..889730a86bc 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/InvalidBucketName.java +++ b/awsapi/src/com/cloud/bridge/service/exception/InvalidBucketName.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.bridge.service.exception; public class InvalidBucketName extends RuntimeException { diff --git a/awsapi/src/com/cloud/bridge/service/exception/InvalidRequestContentException.java b/awsapi/src/com/cloud/bridge/service/exception/InvalidRequestContentException.java index 0421187466b..f80ceb7cd57 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/InvalidRequestContentException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/InvalidRequestContentException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven Yang - */ -public class InvalidRequestContentException extends RuntimeException { - private static final long serialVersionUID = -3047694313765739359L; - - public InvalidRequestContentException() { - } - - public InvalidRequestContentException(String message) { - super(message); - } - - public InvalidRequestContentException(Throwable e) { - super(e); - } - - public InvalidRequestContentException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven Yang + */ +public class InvalidRequestContentException extends RuntimeException { + private static final long serialVersionUID = -3047694313765739359L; + + public InvalidRequestContentException() { + } + + public InvalidRequestContentException(String message) { + super(message); + } + + public InvalidRequestContentException(Throwable e) { + super(e); + } + + public InvalidRequestContentException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/NetworkIOException.java b/awsapi/src/com/cloud/bridge/service/exception/NetworkIOException.java index 92a6e66fb13..27d0cf8780b 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/NetworkIOException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/NetworkIOException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven Yang - */ -public class NetworkIOException extends RuntimeException { - private static final long serialVersionUID = 1797775871115398024L; - - public NetworkIOException() { - } - - public NetworkIOException(String message) { - super(message); - } - - public NetworkIOException(Throwable e) { - super(e); - } - - public NetworkIOException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven Yang + */ +public class NetworkIOException extends RuntimeException { + private static final long serialVersionUID = 1797775871115398024L; + + public NetworkIOException() { + } + + public NetworkIOException(String message) { + super(message); + } + + public NetworkIOException(Throwable e) { + super(e); + } + + public NetworkIOException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/NoSuchObjectException.java b/awsapi/src/com/cloud/bridge/service/exception/NoSuchObjectException.java index 41533ea7805..50ba8200d08 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/NoSuchObjectException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/NoSuchObjectException.java @@ -1,39 +1,55 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven Yang - */ -public class NoSuchObjectException extends RuntimeException { - - private static final long serialVersionUID = -5727022800215753259L; - - public NoSuchObjectException() { - } - - public NoSuchObjectException(String message) { - super(message); - } - - public NoSuchObjectException(Throwable e) { - super(e); - } - - public NoSuchObjectException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven Yang + */ +public class NoSuchObjectException extends RuntimeException { + + private static final long serialVersionUID = -5727022800215753259L; + + public NoSuchObjectException() { + } + + public NoSuchObjectException(String message) { + super(message); + } + + public NoSuchObjectException(Throwable e) { + super(e); + } + + public NoSuchObjectException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/ObjectAlreadyExistsException.java b/awsapi/src/com/cloud/bridge/service/exception/ObjectAlreadyExistsException.java index 74d1dd4c272..f469de83510 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/ObjectAlreadyExistsException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/ObjectAlreadyExistsException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven - */ -public class ObjectAlreadyExistsException extends RuntimeException { - private static final long serialVersionUID = 2705708093384620824L; - - public ObjectAlreadyExistsException() { - } - - public ObjectAlreadyExistsException(String message) { - super(message); - } - - public ObjectAlreadyExistsException(Throwable e) { - super(e); - } - - public ObjectAlreadyExistsException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven + */ +public class ObjectAlreadyExistsException extends RuntimeException { + private static final long serialVersionUID = 2705708093384620824L; + + public ObjectAlreadyExistsException() { + } + + public ObjectAlreadyExistsException(String message) { + super(message); + } + + public ObjectAlreadyExistsException(Throwable e) { + super(e); + } + + public ObjectAlreadyExistsException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/OutOfServiceException.java b/awsapi/src/com/cloud/bridge/service/exception/OutOfServiceException.java index 15d89b336ae..1d103d2971c 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/OutOfServiceException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/OutOfServiceException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven - */ -public class OutOfServiceException extends RuntimeException { - private static final long serialVersionUID = 8457313467757867680L; - - public OutOfServiceException() { - } - - public OutOfServiceException(String message) { - super(message); - } - - public OutOfServiceException(Throwable e) { - super(e); - } - - public OutOfServiceException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven + */ +public class OutOfServiceException extends RuntimeException { + private static final long serialVersionUID = 8457313467757867680L; + + public OutOfServiceException() { + } + + public OutOfServiceException(String message) { + super(message); + } + + public OutOfServiceException(Throwable e) { + super(e); + } + + public OutOfServiceException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/OutOfStorageException.java b/awsapi/src/com/cloud/bridge/service/exception/OutOfStorageException.java index 8799a1c5f8d..d1fe0d8e4b1 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/OutOfStorageException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/OutOfStorageException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven Yang - */ -public class OutOfStorageException extends RuntimeException { - private static final long serialVersionUID = -2236697888220815218L; - - public OutOfStorageException() { - } - - public OutOfStorageException(String message) { - super(message); - } - - public OutOfStorageException(Throwable e) { - super(e); - } - - public OutOfStorageException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven Yang + */ +public class OutOfStorageException extends RuntimeException { + private static final long serialVersionUID = -2236697888220815218L; + + public OutOfStorageException() { + } + + public OutOfStorageException(String message) { + super(message); + } + + public OutOfStorageException(Throwable e) { + super(e); + } + + public OutOfStorageException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/PermissionDeniedException.java b/awsapi/src/com/cloud/bridge/service/exception/PermissionDeniedException.java index dece2651fd6..21e42148851 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/PermissionDeniedException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/PermissionDeniedException.java @@ -1,38 +1,54 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.service.exception; - -/** - * @author Kelven Yang - */ -public class PermissionDeniedException extends RuntimeException { - private static final long serialVersionUID = -5816172859594116468L; - - public PermissionDeniedException() { - } - - public PermissionDeniedException(String message) { - super(message); - } - - public PermissionDeniedException(Throwable e) { - super(e); - } - - public PermissionDeniedException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.service.exception; + +/** + * @author Kelven Yang + */ +public class PermissionDeniedException extends RuntimeException { + private static final long serialVersionUID = -5816172859594116468L; + + public PermissionDeniedException() { + } + + public PermissionDeniedException(String message) { + super(message); + } + + public PermissionDeniedException(Throwable e) { + super(e); + } + + public PermissionDeniedException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/service/exception/UnsupportedException.java b/awsapi/src/com/cloud/bridge/service/exception/UnsupportedException.java index 955a5be1c1f..36cec0e6cdc 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/UnsupportedException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/UnsupportedException.java @@ -1,20 +1,36 @@ -package com.cloud.bridge.service.exception; - -public class UnsupportedException extends RuntimeException { - private static final long serialVersionUID = 8857313467347867680L; - - public UnsupportedException() { - } - - public UnsupportedException(String message) { - super(message); - } - - public UnsupportedException(Throwable e) { - super(e); - } - - public UnsupportedException(String message, Throwable e) { - super(message, e); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.bridge.service.exception; + +public class UnsupportedException extends RuntimeException { + private static final long serialVersionUID = 8857313467347867680L; + + public UnsupportedException() { + } + + public UnsupportedException(String message) { + super(message); + } + + public UnsupportedException(Throwable e) { + super(e); + } + + public UnsupportedException(String message, Throwable e) { + super(message, e); + } +} diff --git a/awsapi/src/com/cloud/bridge/tool/CloudS3CmdTool.java b/awsapi/src/com/cloud/bridge/tool/CloudS3CmdTool.java index 85f770412fd..f7e1b202a3c 100644 --- a/awsapi/src/com/cloud/bridge/tool/CloudS3CmdTool.java +++ b/awsapi/src/com/cloud/bridge/tool/CloudS3CmdTool.java @@ -1,325 +1,341 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.tool; - -import java.io.File; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Calendar; -import java.util.HashMap; -import java.util.Map; - -import javax.activation.DataHandler; - -import org.apache.axis2.AxisFault; -import org.apache.log4j.xml.DOMConfigurator; - -import com.amazon.s3.client.AmazonS3Stub; -import com.amazon.s3.client.AmazonS3Stub.CreateBucket; -import com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse; -import com.amazon.s3.client.AmazonS3Stub.DeleteBucket; -import com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse; -import com.amazon.s3.client.AmazonS3Stub.DeleteObject; -import com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse; -import com.amazon.s3.client.AmazonS3Stub.ListBucket; -import com.amazon.s3.client.AmazonS3Stub.ListBucketResponse; -import com.amazon.s3.client.AmazonS3Stub.ListBucketResult; -import com.amazon.s3.client.AmazonS3Stub.ListEntry; -import com.amazon.s3.client.AmazonS3Stub.PrefixEntry; -import com.amazon.s3.client.AmazonS3Stub.PutObjectInline; -import com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse; -import com.amazon.s3.client.AmazonS3Stub.Status; - -/** - * @author Kelven Yang - */ -public class CloudS3CmdTool { - private String serviceUrl; - - private AmazonS3Stub serviceStub; - - private static void configLog4j() { - URL configUrl = System.class.getResource("/conf/log4j-cloud-bridge.xml"); - if(configUrl == null) - configUrl = ClassLoader.getSystemResource("log4j-cloud-bridge.xml"); - - if(configUrl == null) - configUrl = ClassLoader.getSystemResource("conf/log4j-cloud-bridge.xml"); - - if(configUrl != null) { - try { - System.out.println("Configure log4j using " + configUrl.toURI().toString()); - } catch (URISyntaxException e1) { - e1.printStackTrace(); - } - - try { - File file = new File(configUrl.toURI()); - - System.out.println("Log4j configuration from : " + file.getAbsolutePath()); - DOMConfigurator.configureAndWatch(file.getAbsolutePath(), 10000); - } catch (URISyntaxException e) { - System.out.println("Unable to convert log4j configuration Url to URI"); - } - } else { - System.out.println("Configure log4j with default properties"); - } - } - - private static Map getNamedParameters(String[] args) { - Map params = new HashMap(); - for(int i = 1; i < args.length; i++) { - if(args[i].charAt(0) == '-') { - String[] tokens = args[i].substring(1).split("="); - if(tokens.length == 2) { - params.put(tokens[0], tokens[1]); - } - } - } - - return params; - } - - private static boolean validateNamedParameters(Map params, String... keys) { - for(String key : keys) { - if(params.get(key) == null || params.get(key).isEmpty()) - return false; - } - return true; - } - - public static void main(String[] args) { - configLog4j(); - (new CloudS3CmdTool()).run(args); - } - - private void run(String[] args) { - Map env = System.getenv(); - for (String envName : env.keySet()) { - if(envName.equals("CLOUD_SERVICE_URL")) - serviceUrl = env.get(envName); - } - - if(serviceUrl == null) { - System.out.println("Please set CLOUD_SERVICE_URL environment variable"); - System.exit(0); - } - - if(args.length < 1) { - System.out.println("Please specify a command to run"); - System.exit(0); - } - - try { - serviceStub = new AmazonS3Stub(serviceUrl); - } catch (AxisFault e) { - System.out.println("Unable to initialize service stub"); - e.printStackTrace(); - System.exit(0); - } - - // command dispatch - if(args[0].equals("bucket-create")) { - createBucket(args); - } else if(args[0].equals("bucket-delete")) { - deleteBucket(args); - } else if(args[0].equals("bucket-list")) { - listBucket(args); - } else if(args[0].equals("object-put-inline")) { - putObjectInline(args); - } else if(args[0].equals("object-delete")) { - deleteObject(args); - } - } - - private void createBucket(String[] args) { - if(args.length < 2) { - System.out.println("Usage: bucket-create "); - System.exit(0); - } - - try { - CreateBucket bucket = new CreateBucket(); - bucket.setBucket(args[1]); - bucket.setAWSAccessKeyId( "TODO1" ); - bucket.setSignature("TODO2"); - bucket.setTimestamp(Calendar.getInstance()); - - CreateBucketResponse response = serviceStub.createBucket(bucket); - System.out.println("Bucket " + response.getCreateBucketReturn().getBucketName() + " has been created successfully"); - } catch(Exception e) { - System.out.println("Failed to execute bucket-create due to " + e.getMessage()); - } - } - - private void deleteBucket(String[] args) { - if(args.length < 2) { - System.out.println("Usage: bucket-delete "); - System.exit(0); - } - - try { - DeleteBucket request = new DeleteBucket(); - request.setBucket(args[1]); - request.setSignature("TODO"); - request.setTimestamp(Calendar.getInstance()); - - DeleteBucketResponse response = serviceStub.deleteBucket(request); - Status status = response.getDeleteBucketResponse(); - if(status.getCode() == 200) { - System.out.println("Bucket " + args[1] + " has been deleted successfully"); - } else { - System.out.println("Unable to delete bucket " + args[1] + " - " + status.getDescription()); - } - } catch(Exception e) { - System.out.println("Failed to execute bucket-delete due to " + e.getMessage()); - } - } - - private void listBucket(String[] args) { - if(args.length < 2) { - System.out.println("Usage: bucket-list -prefix= -delimiter= -marker= -max= "); - System.exit(0); - } - - try { - ListBucket request = new ListBucket(); - Map params = getNamedParameters(args); - - request.setBucket(args[args.length - 1]); - request.setCredential("TODO"); - if(params.get("prefix") != null) - request.setPrefix(params.get("prefix")); - if(params.get("delimiter") != null) - request.setDelimiter(params.get("delimiter")); - if(params.get("marker") != null) - request.setMarker(params.get("marker")); - if(params.get("max") != null) { - try { - int maxKeys = Integer.parseInt(params.get("max")); - request.setMaxKeys(maxKeys); - } catch(Exception e){ - System.out.println("-max parameter should be a numeric value"); - } - } - request.setAWSAccessKeyId("TODO"); - request.setCredential("TODO"); - request.setSignature("TODO"); - request.setTimestamp(Calendar.getInstance()); - - ListBucketResponse response = serviceStub.listBucket(request); - ListBucketResult result = response.getListBucketResponse(); - System.out.println("\tContent of Bucket " + result.getName()); - System.out.println("\tListing with prefix: " + result.getPrefix() + ", delimiter: " - + result.getDelimiter() + ", marker: " + result.getMarker() + ", max: " + result.getMaxKeys()); - - ListEntry[] entries = result.getContents(); - if(entries != null) { - for(int i = 0; i < entries.length; i++) { - ListEntry entry = entries[i]; - System.out.print("\t"); - System.out.print(entry.getSize()); - System.out.print("\t"); - System.out.print(entry.getKey()); - System.out.print("\t"); - System.out.print(entry.getETag()); - System.out.print("\n"); - } - } - - PrefixEntry[] prefixEntries = result.getCommonPrefixes(); - if(prefixEntries != null) { - System.out.print("\n\n"); - - for(int i = 0; i < prefixEntries.length; i++) { - System.out.print("\t\t"); - System.out.print(prefixEntries[i].getPrefix()); - System.out.print("\n"); - } - } - } catch(Exception e) { - System.out.println("Failed to execute bucket-list due to " + e.getMessage()); - } - } - - private void putObjectInline(String[] args) { - if(args.length < 4) { - System.out.println("Usage: object-put-inline -bucket= -name= "); - System.exit(0); - } - - Map params = getNamedParameters(args); - if(!validateNamedParameters(params, "bucket", "name")) { - System.out.println("Usage: object-put-inline -bucket= -name= "); - System.exit(0); - } - - File file = new File(args[args.length -1]); - if(!file.exists()) { - System.out.println("Unable to find file " + args[args.length -1]); - System.exit(0); - } - - try { - PutObjectInline request = new PutObjectInline(); - request.setBucket(params.get("bucket")); - request.setKey(params.get("name")); - request.setContentLength(file.length()); - request.setAWSAccessKeyId("TODO"); - request.setCredential("TODO"); - request.setSignature("TODO"); - request.setTimestamp(Calendar.getInstance()); - request.setData(new DataHandler(file.toURL())); - - PutObjectInlineResponse response = serviceStub.putObjectInline(request); - System.out.println("Object has been posted successfully. ETag: " + response.getPutObjectInlineResponse().getETag()); - } catch(Exception e) { - System.out.println("Failed to execute object-put-inline due to " + e.getMessage()); - } - } - - private void deleteObject(String[] args) { - if(args.length < 3) { - System.out.println("Usage: object-delete -bucket= -name="); - System.exit(0); - } - - Map params = getNamedParameters(args); - if(!validateNamedParameters(params, "bucket", "name")) { - System.out.println("Usage: object-delete -bucket= -name="); - System.exit(0); - } - - try { - DeleteObject request = new DeleteObject(); - request.setAWSAccessKeyId("TODO"); - request.setBucket(params.get("bucket")); - request.setKey(params.get("name")); - request.setSignature("TODO"); - request.setCredential("TODO"); - request.setTimestamp(Calendar.getInstance()); - - DeleteObjectResponse response = serviceStub.deleteObject(request); - if(response.getDeleteObjectResponse().getCode() == 200) - System.out.println("Object " + params.get("name") + " has been deleted successfully"); - else - System.out.println("Object " + params.get("name") + " can not be deleted. Error: " - + response.getDeleteObjectResponse().getCode()); - } catch(Exception e) { - System.out.println("Failed to execute object-delete due to " + e.getMessage()); - } - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.tool; + +import java.io.File; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Map; + +import javax.activation.DataHandler; + +import org.apache.axis2.AxisFault; +import org.apache.log4j.xml.DOMConfigurator; + +import com.amazon.s3.client.AmazonS3Stub; +import com.amazon.s3.client.AmazonS3Stub.CreateBucket; +import com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse; +import com.amazon.s3.client.AmazonS3Stub.DeleteBucket; +import com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse; +import com.amazon.s3.client.AmazonS3Stub.DeleteObject; +import com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse; +import com.amazon.s3.client.AmazonS3Stub.ListBucket; +import com.amazon.s3.client.AmazonS3Stub.ListBucketResponse; +import com.amazon.s3.client.AmazonS3Stub.ListBucketResult; +import com.amazon.s3.client.AmazonS3Stub.ListEntry; +import com.amazon.s3.client.AmazonS3Stub.PrefixEntry; +import com.amazon.s3.client.AmazonS3Stub.PutObjectInline; +import com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse; +import com.amazon.s3.client.AmazonS3Stub.Status; + +/** + * @author Kelven Yang + */ +public class CloudS3CmdTool { + private String serviceUrl; + + private AmazonS3Stub serviceStub; + + private static void configLog4j() { + URL configUrl = System.class.getResource("/conf/log4j-cloud-bridge.xml"); + if(configUrl == null) + configUrl = ClassLoader.getSystemResource("log4j-cloud-bridge.xml"); + + if(configUrl == null) + configUrl = ClassLoader.getSystemResource("conf/log4j-cloud-bridge.xml"); + + if(configUrl != null) { + try { + System.out.println("Configure log4j using " + configUrl.toURI().toString()); + } catch (URISyntaxException e1) { + e1.printStackTrace(); + } + + try { + File file = new File(configUrl.toURI()); + + System.out.println("Log4j configuration from : " + file.getAbsolutePath()); + DOMConfigurator.configureAndWatch(file.getAbsolutePath(), 10000); + } catch (URISyntaxException e) { + System.out.println("Unable to convert log4j configuration Url to URI"); + } + } else { + System.out.println("Configure log4j with default properties"); + } + } + + private static Map getNamedParameters(String[] args) { + Map params = new HashMap(); + for(int i = 1; i < args.length; i++) { + if(args[i].charAt(0) == '-') { + String[] tokens = args[i].substring(1).split("="); + if(tokens.length == 2) { + params.put(tokens[0], tokens[1]); + } + } + } + + return params; + } + + private static boolean validateNamedParameters(Map params, String... keys) { + for(String key : keys) { + if(params.get(key) == null || params.get(key).isEmpty()) + return false; + } + return true; + } + + public static void main(String[] args) { + configLog4j(); + (new CloudS3CmdTool()).run(args); + } + + private void run(String[] args) { + Map env = System.getenv(); + for (String envName : env.keySet()) { + if(envName.equals("CLOUD_SERVICE_URL")) + serviceUrl = env.get(envName); + } + + if(serviceUrl == null) { + System.out.println("Please set CLOUD_SERVICE_URL environment variable"); + System.exit(0); + } + + if(args.length < 1) { + System.out.println("Please specify a command to run"); + System.exit(0); + } + + try { + serviceStub = new AmazonS3Stub(serviceUrl); + } catch (AxisFault e) { + System.out.println("Unable to initialize service stub"); + e.printStackTrace(); + System.exit(0); + } + + // command dispatch + if(args[0].equals("bucket-create")) { + createBucket(args); + } else if(args[0].equals("bucket-delete")) { + deleteBucket(args); + } else if(args[0].equals("bucket-list")) { + listBucket(args); + } else if(args[0].equals("object-put-inline")) { + putObjectInline(args); + } else if(args[0].equals("object-delete")) { + deleteObject(args); + } + } + + private void createBucket(String[] args) { + if(args.length < 2) { + System.out.println("Usage: bucket-create "); + System.exit(0); + } + + try { + CreateBucket bucket = new CreateBucket(); + bucket.setBucket(args[1]); + bucket.setAWSAccessKeyId( "TODO1" ); + bucket.setSignature("TODO2"); + bucket.setTimestamp(Calendar.getInstance()); + + CreateBucketResponse response = serviceStub.createBucket(bucket); + System.out.println("Bucket " + response.getCreateBucketReturn().getBucketName() + " has been created successfully"); + } catch(Exception e) { + System.out.println("Failed to execute bucket-create due to " + e.getMessage()); + } + } + + private void deleteBucket(String[] args) { + if(args.length < 2) { + System.out.println("Usage: bucket-delete "); + System.exit(0); + } + + try { + DeleteBucket request = new DeleteBucket(); + request.setBucket(args[1]); + request.setSignature("TODO"); + request.setTimestamp(Calendar.getInstance()); + + DeleteBucketResponse response = serviceStub.deleteBucket(request); + Status status = response.getDeleteBucketResponse(); + if(status.getCode() == 200) { + System.out.println("Bucket " + args[1] + " has been deleted successfully"); + } else { + System.out.println("Unable to delete bucket " + args[1] + " - " + status.getDescription()); + } + } catch(Exception e) { + System.out.println("Failed to execute bucket-delete due to " + e.getMessage()); + } + } + + private void listBucket(String[] args) { + if(args.length < 2) { + System.out.println("Usage: bucket-list -prefix= -delimiter= -marker= -max= "); + System.exit(0); + } + + try { + ListBucket request = new ListBucket(); + Map params = getNamedParameters(args); + + request.setBucket(args[args.length - 1]); + request.setCredential("TODO"); + if(params.get("prefix") != null) + request.setPrefix(params.get("prefix")); + if(params.get("delimiter") != null) + request.setDelimiter(params.get("delimiter")); + if(params.get("marker") != null) + request.setMarker(params.get("marker")); + if(params.get("max") != null) { + try { + int maxKeys = Integer.parseInt(params.get("max")); + request.setMaxKeys(maxKeys); + } catch(Exception e){ + System.out.println("-max parameter should be a numeric value"); + } + } + request.setAWSAccessKeyId("TODO"); + request.setCredential("TODO"); + request.setSignature("TODO"); + request.setTimestamp(Calendar.getInstance()); + + ListBucketResponse response = serviceStub.listBucket(request); + ListBucketResult result = response.getListBucketResponse(); + System.out.println("\tContent of Bucket " + result.getName()); + System.out.println("\tListing with prefix: " + result.getPrefix() + ", delimiter: " + + result.getDelimiter() + ", marker: " + result.getMarker() + ", max: " + result.getMaxKeys()); + + ListEntry[] entries = result.getContents(); + if(entries != null) { + for(int i = 0; i < entries.length; i++) { + ListEntry entry = entries[i]; + System.out.print("\t"); + System.out.print(entry.getSize()); + System.out.print("\t"); + System.out.print(entry.getKey()); + System.out.print("\t"); + System.out.print(entry.getETag()); + System.out.print("\n"); + } + } + + PrefixEntry[] prefixEntries = result.getCommonPrefixes(); + if(prefixEntries != null) { + System.out.print("\n\n"); + + for(int i = 0; i < prefixEntries.length; i++) { + System.out.print("\t\t"); + System.out.print(prefixEntries[i].getPrefix()); + System.out.print("\n"); + } + } + } catch(Exception e) { + System.out.println("Failed to execute bucket-list due to " + e.getMessage()); + } + } + + private void putObjectInline(String[] args) { + if(args.length < 4) { + System.out.println("Usage: object-put-inline -bucket= -name= "); + System.exit(0); + } + + Map params = getNamedParameters(args); + if(!validateNamedParameters(params, "bucket", "name")) { + System.out.println("Usage: object-put-inline -bucket= -name= "); + System.exit(0); + } + + File file = new File(args[args.length -1]); + if(!file.exists()) { + System.out.println("Unable to find file " + args[args.length -1]); + System.exit(0); + } + + try { + PutObjectInline request = new PutObjectInline(); + request.setBucket(params.get("bucket")); + request.setKey(params.get("name")); + request.setContentLength(file.length()); + request.setAWSAccessKeyId("TODO"); + request.setCredential("TODO"); + request.setSignature("TODO"); + request.setTimestamp(Calendar.getInstance()); + request.setData(new DataHandler(file.toURL())); + + PutObjectInlineResponse response = serviceStub.putObjectInline(request); + System.out.println("Object has been posted successfully. ETag: " + response.getPutObjectInlineResponse().getETag()); + } catch(Exception e) { + System.out.println("Failed to execute object-put-inline due to " + e.getMessage()); + } + } + + private void deleteObject(String[] args) { + if(args.length < 3) { + System.out.println("Usage: object-delete -bucket= -name="); + System.exit(0); + } + + Map params = getNamedParameters(args); + if(!validateNamedParameters(params, "bucket", "name")) { + System.out.println("Usage: object-delete -bucket= -name="); + System.exit(0); + } + + try { + DeleteObject request = new DeleteObject(); + request.setAWSAccessKeyId("TODO"); + request.setBucket(params.get("bucket")); + request.setKey(params.get("name")); + request.setSignature("TODO"); + request.setCredential("TODO"); + request.setTimestamp(Calendar.getInstance()); + + DeleteObjectResponse response = serviceStub.deleteObject(request); + if(response.getDeleteObjectResponse().getCode() == 200) + System.out.println("Object " + params.get("name") + " has been deleted successfully"); + else + System.out.println("Object " + params.get("name") + " can not be deleted. Error: " + + response.getDeleteObjectResponse().getCode()); + } catch(Exception e) { + System.out.println("Failed to execute object-delete due to " + e.getMessage()); + } + } +} diff --git a/awsapi/src/com/cloud/bridge/util/AuthenticationUtils.java b/awsapi/src/com/cloud/bridge/util/AuthenticationUtils.java index 4765a0812f5..3e0fee3fb67 100644 --- a/awsapi/src/com/cloud/bridge/util/AuthenticationUtils.java +++ b/awsapi/src/com/cloud/bridge/util/AuthenticationUtils.java @@ -1,46 +1,62 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import org.apache.log4j.Logger; - -import java.security.cert.Certificate; -import java.security.cert.X509Certificate; -import javax.security.auth.x500.X500Principal; -import java.math.BigInteger; - - -public class AuthenticationUtils { - protected final static Logger logger = Logger.getLogger(AuthenticationUtils.class); - - public AuthenticationUtils() { - } - - /** - * The combination of the Issuer and the serial number of a X509 certificate - * must be globally unique. The Issuer can be described by its Distinguished Name (DN). - * The uniqueId is constructed by appending a ", serial=" onto the end of the Issuer's - * DN (thus keeping the DN format). - * - * @param cert - */ - public static String X509CertUniqueId( Certificate cert ) { - X509Certificate userCert = (X509Certificate)cert; - X500Principal issuer = userCert.getIssuerX500Principal(); - BigInteger serialNumber = userCert.getSerialNumber(); - return new String( issuer.toString() + ", serial=" + serialNumber ); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import org.apache.log4j.Logger; + +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; +import javax.security.auth.x500.X500Principal; +import java.math.BigInteger; + + +public class AuthenticationUtils { + protected final static Logger logger = Logger.getLogger(AuthenticationUtils.class); + + public AuthenticationUtils() { + } + + /** + * The combination of the Issuer and the serial number of a X509 certificate + * must be globally unique. The Issuer can be described by its Distinguished Name (DN). + * The uniqueId is constructed by appending a ", serial=" onto the end of the Issuer's + * DN (thus keeping the DN format). + * + * @param cert + */ + public static String X509CertUniqueId( Certificate cert ) { + X509Certificate userCert = (X509Certificate)cert; + X500Principal issuer = userCert.getIssuerX500Principal(); + BigInteger serialNumber = userCert.getSerialNumber(); + return new String( issuer.toString() + ", serial=" + serialNumber ); + } +} diff --git a/awsapi/src/com/cloud/bridge/util/CalendarDateParam.java b/awsapi/src/com/cloud/bridge/util/CalendarDateParam.java index 36a09b8f6fd..5edc8ca8133 100644 --- a/awsapi/src/com/cloud/bridge/util/CalendarDateParam.java +++ b/awsapi/src/com/cloud/bridge/util/CalendarDateParam.java @@ -1,34 +1,50 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.util.Calendar; - -/** - * @author Kelven Yang - */ -public class CalendarDateParam { - private Calendar dateValue; - - public CalendarDateParam(Calendar dateValue) { - this.dateValue = dateValue; - } - - public Calendar dateValue() { - return dateValue; - } -} - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.util.Calendar; + +/** + * @author Kelven Yang + */ +public class CalendarDateParam { + private Calendar dateValue; + + public CalendarDateParam(Calendar dateValue) { + this.dateValue = dateValue; + } + + public Calendar dateValue() { + return dateValue; + } +} + diff --git a/awsapi/src/com/cloud/bridge/util/CloudSessionFactory.java b/awsapi/src/com/cloud/bridge/util/CloudSessionFactory.java index a689900ea3d..7b85836b530 100644 --- a/awsapi/src/com/cloud/bridge/util/CloudSessionFactory.java +++ b/awsapi/src/com/cloud/bridge/util/CloudSessionFactory.java @@ -1,108 +1,124 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Properties; - -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.cfg.Configuration; -import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; -import org.jasypt.properties.EncryptableProperties; -import org.apache.log4j.Logger; - -/** - * @author Kelven Yang - */ -public class CloudSessionFactory { - private static CloudSessionFactory instance; - public static final Logger logger = Logger.getLogger(CloudSessionFactory.class); - - private SessionFactory factory; - - private CloudSessionFactory() { - Configuration cfg = new Configuration(); - File file = ConfigurationHelper.findConfigurationFile("hibernate.cfg.xml"); - - File propertiesFile = ConfigurationHelper.findConfigurationFile("db.properties"); - Properties dbProp = null; - String dbName = null; - String dbHost = null; - String dbUser = null; - String dbPassword = null; - String dbPort = null; - - if (null != propertiesFile) { - - if(EncryptionSecretKeyCheckerUtil.useEncryption()){ - StandardPBEStringEncryptor encryptor = EncryptionSecretKeyCheckerUtil.getEncryptor(); - dbProp = new EncryptableProperties(encryptor); - } else { - dbProp = new Properties(); - } - - try { - dbProp.load( new FileInputStream( propertiesFile )); - } catch (FileNotFoundException e) { - logger.warn("Unable to open properties file: " + propertiesFile.getAbsolutePath(), e); - } catch (IOException e) { - logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e); - } - } - - - // - // we are packaging hibernate mapping files along with the class files, - // make sure class loader use the same class path when initializing hibernate mapping. - // This is important when we are deploying and testing at different environment (Tomcat/JUnit test runner) - // - if(file != null && dbProp != null){ - Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); - cfg.configure(file); - - dbHost = dbProp.getProperty( "db.cloud.host" ); - dbName = dbProp.getProperty( "db.awsapi.name" ); - dbUser = dbProp.getProperty( "db.cloud.username" ); - dbPassword = dbProp.getProperty( "db.cloud.password" ); - dbPort = dbProp.getProperty( "db.cloud.port" ); - - cfg.setProperty("hibernate.connection.url", "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName); - cfg.setProperty("hibernate.connection.username", dbUser); - cfg.setProperty("hibernate.connection.password", dbPassword); - - - factory = cfg.buildSessionFactory(); - }else{ - logger.warn("Unable to open load db configuration"); - throw new RuntimeException("nable to open load db configuration"); - } - } - - public synchronized static CloudSessionFactory getInstance() { - if(instance == null) { - instance = new CloudSessionFactory(); - } - return instance; - } - - public Session openSession() { - return factory.openSession(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Properties; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.cfg.Configuration; +import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; +import org.jasypt.properties.EncryptableProperties; +import org.apache.log4j.Logger; + +/** + * @author Kelven Yang + */ +public class CloudSessionFactory { + private static CloudSessionFactory instance; + public static final Logger logger = Logger.getLogger(CloudSessionFactory.class); + + private SessionFactory factory; + + private CloudSessionFactory() { + Configuration cfg = new Configuration(); + File file = ConfigurationHelper.findConfigurationFile("hibernate.cfg.xml"); + + File propertiesFile = ConfigurationHelper.findConfigurationFile("db.properties"); + Properties dbProp = null; + String dbName = null; + String dbHost = null; + String dbUser = null; + String dbPassword = null; + String dbPort = null; + + if (null != propertiesFile) { + + if(EncryptionSecretKeyCheckerUtil.useEncryption()){ + StandardPBEStringEncryptor encryptor = EncryptionSecretKeyCheckerUtil.getEncryptor(); + dbProp = new EncryptableProperties(encryptor); + } else { + dbProp = new Properties(); + } + + try { + dbProp.load( new FileInputStream( propertiesFile )); + } catch (FileNotFoundException e) { + logger.warn("Unable to open properties file: " + propertiesFile.getAbsolutePath(), e); + } catch (IOException e) { + logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e); + } + } + + + // + // we are packaging hibernate mapping files along with the class files, + // make sure class loader use the same class path when initializing hibernate mapping. + // This is important when we are deploying and testing at different environment (Tomcat/JUnit test runner) + // + if(file != null && dbProp != null){ + Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); + cfg.configure(file); + + dbHost = dbProp.getProperty( "db.cloud.host" ); + dbName = dbProp.getProperty( "db.awsapi.name" ); + dbUser = dbProp.getProperty( "db.cloud.username" ); + dbPassword = dbProp.getProperty( "db.cloud.password" ); + dbPort = dbProp.getProperty( "db.cloud.port" ); + + cfg.setProperty("hibernate.connection.url", "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName); + cfg.setProperty("hibernate.connection.username", dbUser); + cfg.setProperty("hibernate.connection.password", dbPassword); + + + factory = cfg.buildSessionFactory(); + }else{ + logger.warn("Unable to open load db configuration"); + throw new RuntimeException("nable to open load db configuration"); + } + } + + public synchronized static CloudSessionFactory getInstance() { + if(instance == null) { + instance = new CloudSessionFactory(); + } + return instance; + } + + public Session openSession() { + return factory.openSession(); + } +} diff --git a/awsapi/src/com/cloud/bridge/util/CloudStackSessionFactory.java b/awsapi/src/com/cloud/bridge/util/CloudStackSessionFactory.java index 13f8fedbf2d..457881854c2 100644 --- a/awsapi/src/com/cloud/bridge/util/CloudStackSessionFactory.java +++ b/awsapi/src/com/cloud/bridge/util/CloudStackSessionFactory.java @@ -1,109 +1,125 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Properties; - -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.cfg.Configuration; -import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; -import org.jasypt.properties.EncryptableProperties; -import org.apache.log4j.Logger; - - -/** - * @author Kelven Yang - */ -public class CloudStackSessionFactory { - private static CloudStackSessionFactory instance; - public static final Logger logger = Logger.getLogger(CloudStackSessionFactory.class); - - private SessionFactory factory; - - private CloudStackSessionFactory() { - Configuration cfg = new Configuration(); - File file = ConfigurationHelper.findConfigurationFile("CloudStack.cfg.xml"); - - File propertiesFile = ConfigurationHelper.findConfigurationFile("db.properties"); - Properties dbProp = null; - String dbName = null; - String dbHost = null; - String dbUser = null; - String dbPassword = null; - String dbPort = null; - - if (null != propertiesFile) { - - if(EncryptionSecretKeyCheckerUtil.useEncryption()){ - StandardPBEStringEncryptor encryptor = EncryptionSecretKeyCheckerUtil.getEncryptor(); - dbProp = new EncryptableProperties(encryptor); - } else { - dbProp = new Properties(); - } - - try { - dbProp.load( new FileInputStream( propertiesFile )); - } catch (FileNotFoundException e) { - logger.warn("Unable to open properties file: " + propertiesFile.getAbsolutePath(), e); - } catch (IOException e) { - logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e); - } - } - - - // - // we are packaging hibernate mapping files along with the class files, - // make sure class loader use the same class path when initializing hibernate mapping. - // This is important when we are deploying and testing at different environment (Tomcat/JUnit test runner) - // - if(file != null && dbProp != null){ - Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); - cfg.configure(file); - - dbHost = dbProp.getProperty( "db.cloud.host" ); - dbName = dbProp.getProperty( "db.cloud.name" ); - dbUser = dbProp.getProperty( "db.cloud.username" ); - dbPassword = dbProp.getProperty( "db.cloud.password" ); - dbPort = dbProp.getProperty( "db.cloud.port" ); - - cfg.setProperty("hibernate.connection.url", "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName); - cfg.setProperty("hibernate.connection.username", dbUser); - cfg.setProperty("hibernate.connection.password", dbPassword); - - - factory = cfg.buildSessionFactory(); - }else{ - logger.warn("Unable to open load db configuration"); - throw new RuntimeException("nable to open load db configuration"); - } - } - - public synchronized static CloudStackSessionFactory getInstance() { - if(instance == null) { - instance = new CloudStackSessionFactory(); - } - return instance; - } - - public Session openSession() { - return factory.openSession(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Properties; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.cfg.Configuration; +import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; +import org.jasypt.properties.EncryptableProperties; +import org.apache.log4j.Logger; + + +/** + * @author Kelven Yang + */ +public class CloudStackSessionFactory { + private static CloudStackSessionFactory instance; + public static final Logger logger = Logger.getLogger(CloudStackSessionFactory.class); + + private SessionFactory factory; + + private CloudStackSessionFactory() { + Configuration cfg = new Configuration(); + File file = ConfigurationHelper.findConfigurationFile("CloudStack.cfg.xml"); + + File propertiesFile = ConfigurationHelper.findConfigurationFile("db.properties"); + Properties dbProp = null; + String dbName = null; + String dbHost = null; + String dbUser = null; + String dbPassword = null; + String dbPort = null; + + if (null != propertiesFile) { + + if(EncryptionSecretKeyCheckerUtil.useEncryption()){ + StandardPBEStringEncryptor encryptor = EncryptionSecretKeyCheckerUtil.getEncryptor(); + dbProp = new EncryptableProperties(encryptor); + } else { + dbProp = new Properties(); + } + + try { + dbProp.load( new FileInputStream( propertiesFile )); + } catch (FileNotFoundException e) { + logger.warn("Unable to open properties file: " + propertiesFile.getAbsolutePath(), e); + } catch (IOException e) { + logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e); + } + } + + + // + // we are packaging hibernate mapping files along with the class files, + // make sure class loader use the same class path when initializing hibernate mapping. + // This is important when we are deploying and testing at different environment (Tomcat/JUnit test runner) + // + if(file != null && dbProp != null){ + Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); + cfg.configure(file); + + dbHost = dbProp.getProperty( "db.cloud.host" ); + dbName = dbProp.getProperty( "db.cloud.name" ); + dbUser = dbProp.getProperty( "db.cloud.username" ); + dbPassword = dbProp.getProperty( "db.cloud.password" ); + dbPort = dbProp.getProperty( "db.cloud.port" ); + + cfg.setProperty("hibernate.connection.url", "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName); + cfg.setProperty("hibernate.connection.username", dbUser); + cfg.setProperty("hibernate.connection.password", dbPassword); + + + factory = cfg.buildSessionFactory(); + }else{ + logger.warn("Unable to open load db configuration"); + throw new RuntimeException("nable to open load db configuration"); + } + } + + public synchronized static CloudStackSessionFactory getInstance() { + if(instance == null) { + instance = new CloudStackSessionFactory(); + } + return instance; + } + + public Session openSession() { + return factory.openSession(); + } +} diff --git a/awsapi/src/com/cloud/bridge/util/ConfigurationHelper.java b/awsapi/src/com/cloud/bridge/util/ConfigurationHelper.java index bccf6bf0d87..b31437ee902 100644 --- a/awsapi/src/com/cloud/bridge/util/ConfigurationHelper.java +++ b/awsapi/src/com/cloud/bridge/util/ConfigurationHelper.java @@ -1,104 +1,120 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.File; -import java.net.URL; - -import javax.servlet.ServletContext; - -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.transport.http.HTTPConstants; - - -/** - h* @author Kelven Yang - */ -public class ConfigurationHelper { - - private static String configPath; - - public static void preConfigureConfigPathFromServletContext(ServletContext context){ - String servletConficPath = context.getRealPath("/"); - preSetConfigPath(servletConficPath + File.separator + "WEB-INF" + File.separator + "classes"); - } - - public static void preSetConfigPath(String path){ - configPath=path; - } - - public static File findConfigurationFile(String name) { - - if(configPath!=null){ - File file = new File(configPath + File.separator + name); - if (file.exists()) { - return file; - } - } - ServletContext context = getServletContext(); - if(context!=null){ - String newPath = context.getRealPath("/"); - File file = new File(newPath + File.separator + "WEB-INF" + File.separator + "classes" + File.separator + name); - if (file.exists()) { - return file; - } - - } - String newPath = "conf" + (name.startsWith(File.separator) ? "" : "/") + name; - URL url = ClassLoader.getSystemResource(newPath); - if (url != null) { - return new File(url.getFile()); - } - - // if running under Tomcat - newPath = System.getenv("CATALINA_BASE"); - - if (newPath == null) { - newPath = System.getProperty("catalina.base"); - } - - if (newPath == null) { - newPath = System.getenv("CATALINA_HOME"); - } - - if (newPath == null) { - return null; - } - - File file = new File(newPath + File.separator + "conf" + File.separator + name); - if (file.exists()) { - return file; - } - return file; - } - - public static ServletContext getServletContext() - { - try{ - MessageContext mc = MessageContext.getCurrentMessageContext(); - if(mc!=null){ - return (ServletContext) mc.getProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT); - } - } - catch(Exception e){ - e.printStackTrace(); - } - return null; - } - - - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.File; +import java.net.URL; + +import javax.servlet.ServletContext; + +import org.apache.axis2.context.MessageContext; +import org.apache.axis2.transport.http.HTTPConstants; + + +/** + h* @author Kelven Yang + */ +public class ConfigurationHelper { + + private static String configPath; + + public static void preConfigureConfigPathFromServletContext(ServletContext context){ + String servletConficPath = context.getRealPath("/"); + preSetConfigPath(servletConficPath + File.separator + "WEB-INF" + File.separator + "classes"); + } + + public static void preSetConfigPath(String path){ + configPath=path; + } + + public static File findConfigurationFile(String name) { + + if(configPath!=null){ + File file = new File(configPath + File.separator + name); + if (file.exists()) { + return file; + } + } + ServletContext context = getServletContext(); + if(context!=null){ + String newPath = context.getRealPath("/"); + File file = new File(newPath + File.separator + "WEB-INF" + File.separator + "classes" + File.separator + name); + if (file.exists()) { + return file; + } + + } + String newPath = "conf" + (name.startsWith(File.separator) ? "" : "/") + name; + URL url = ClassLoader.getSystemResource(newPath); + if (url != null) { + return new File(url.getFile()); + } + + // if running under Tomcat + newPath = System.getenv("CATALINA_BASE"); + + if (newPath == null) { + newPath = System.getProperty("catalina.base"); + } + + if (newPath == null) { + newPath = System.getenv("CATALINA_HOME"); + } + + if (newPath == null) { + return null; + } + + File file = new File(newPath + File.separator + "conf" + File.separator + name); + if (file.exists()) { + return file; + } + return file; + } + + public static ServletContext getServletContext() + { + try{ + MessageContext mc = MessageContext.getCurrentMessageContext(); + if(mc!=null){ + return (ServletContext) mc.getProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT); + } + } + catch(Exception e){ + e.printStackTrace(); + } + return null; + } + + + +} diff --git a/awsapi/src/com/cloud/bridge/util/Converter.java b/awsapi/src/com/cloud/bridge/util/Converter.java index 6261e8cf472..1687af4ca6a 100644 --- a/awsapi/src/com/cloud/bridge/util/Converter.java +++ b/awsapi/src/com/cloud/bridge/util/Converter.java @@ -1,68 +1,84 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -/** - * @author Kelven Yang - */ -public class Converter { - public static boolean toBool(String value, boolean defaultValue) { - if(value != null && !value.isEmpty()) { - return Boolean.parseBoolean(value); - } - return defaultValue; - } - - public static short toShort(String value, short defaultValue) { - if(value != null && !value.isEmpty()) { - return Short.parseShort(value); - } - - return defaultValue; - } - - public static int toInt(String value, int defaultValue) { - if(value != null && !value.isEmpty()) { - return Integer.parseInt(value); - } - - return defaultValue; - } - - public static long toLong(String value, long defaultValue) { - if(value != null && !value.isEmpty()) { - return Long.parseLong(value); - } - - return defaultValue; - } - - public static float toFloat(String value, float defaultValue) { - if(value != null && !value.isEmpty()) { - return Float.parseFloat(value); - } - - return defaultValue; - } - - public static double toDouble(String value, double defaultValue) { - if(value != null && !value.isEmpty()) { - return Double.parseDouble(value); - } - - return defaultValue; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +/** + * @author Kelven Yang + */ +public class Converter { + public static boolean toBool(String value, boolean defaultValue) { + if(value != null && !value.isEmpty()) { + return Boolean.parseBoolean(value); + } + return defaultValue; + } + + public static short toShort(String value, short defaultValue) { + if(value != null && !value.isEmpty()) { + return Short.parseShort(value); + } + + return defaultValue; + } + + public static int toInt(String value, int defaultValue) { + if(value != null && !value.isEmpty()) { + return Integer.parseInt(value); + } + + return defaultValue; + } + + public static long toLong(String value, long defaultValue) { + if(value != null && !value.isEmpty()) { + return Long.parseLong(value); + } + + return defaultValue; + } + + public static float toFloat(String value, float defaultValue) { + if(value != null && !value.isEmpty()) { + return Float.parseFloat(value); + } + + return defaultValue; + } + + public static double toDouble(String value, double defaultValue) { + if(value != null && !value.isEmpty()) { + return Double.parseDouble(value); + } + + return defaultValue; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/CryptoHelper.java b/awsapi/src/com/cloud/bridge/util/CryptoHelper.java index 5cd7b8fcbb0..bf54a28509a 100644 --- a/awsapi/src/com/cloud/bridge/util/CryptoHelper.java +++ b/awsapi/src/com/cloud/bridge/util/CryptoHelper.java @@ -1,22 +1,38 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -/** - * @author Kelven Yang - */ -public class CryptoHelper { -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +/** + * @author Kelven Yang + */ +public class CryptoHelper { +} diff --git a/awsapi/src/com/cloud/bridge/util/DatabindingConverterUtil.java b/awsapi/src/com/cloud/bridge/util/DatabindingConverterUtil.java index 3deb4b3c475..a6cfd6fa420 100644 --- a/awsapi/src/com/cloud/bridge/util/DatabindingConverterUtil.java +++ b/awsapi/src/com/cloud/bridge/util/DatabindingConverterUtil.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/util/DateHelper.java b/awsapi/src/com/cloud/bridge/util/DateHelper.java index b86181540b3..561ffd6c2e9 100644 --- a/awsapi/src/com/cloud/bridge/util/DateHelper.java +++ b/awsapi/src/com/cloud/bridge/util/DateHelper.java @@ -1,96 +1,112 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; - -/** - * @author Kelven Yang - */ -public class DateHelper { - public static final TimeZone GMT_TIMEZONE = TimeZone.getTimeZone("GMT"); - public static final String YYYYMMDD_FORMAT = "yyyyMMddHHmmss"; - - public static Date currentGMTTime() { - return new Date(); - } - - public static SimpleDateFormat getGMTDateFormat(String format) { - SimpleDateFormat df = new SimpleDateFormat(format); - df.setTimeZone(TimeZone.getTimeZone("GMT")); - return df; - } - - public static Date parseDateString(TimeZone tz, String dateString) { - return parseDateString(tz, dateString, "yyyy-MM-dd HH:mm:ss"); - } - - public static Date parseISO8601DateString(String dateString) throws ParseException { - // -> SimpleDateFormat uses GMT[-+]hh:mm for the TZ so first we need to - // convert the string with this value - SimpleDateFormat df = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssz" ); - - //this is zero time so we need to add that TZ indicator for - if ( dateString.endsWith( "Z" )) { - dateString = dateString.substring( 0, dateString.length() - 1) + "GMT-00:00"; - } - else - { // -> -0700 is valid but we need to change it to -07:00 for SimpleDateFormat - dateString = dateString.replaceFirst( "-(\\d\\d)(\\d\\d)", "-$1:$2" ); - - int inset = 6; - String s0 = dateString.substring( 0, dateString.length() - inset ); - String s1 = dateString.substring( dateString.length() - inset, dateString.length() ); - dateString = s0 + "GMT" + s1; - } - - //System.out.println( "parseDate: [" + dateString + "]" ); - return df.parse( dateString ); - } - - public static Date parseDateString(TimeZone tz, String dateString, String formatString) { - DateFormat df = new SimpleDateFormat(formatString); - df.setTimeZone(tz); - - try { - return df.parse(dateString); - } catch (ParseException e) { - throw new IllegalArgumentException(e); - } - } - - public static String getDateDisplayString(TimeZone tz, Date time) { - return getDateDisplayString(tz, time, "yyyy-MM-dd HH:mm:ss"); - } - - public static String getDateDisplayString(TimeZone tz, Date time, String formatString) { - DateFormat df = new SimpleDateFormat(formatString); - df.setTimeZone(tz); - - return df.format(time); - } - - public static Calendar toCalendar(Date dt) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(dt); - return calendar; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; + +/** + * @author Kelven Yang + */ +public class DateHelper { + public static final TimeZone GMT_TIMEZONE = TimeZone.getTimeZone("GMT"); + public static final String YYYYMMDD_FORMAT = "yyyyMMddHHmmss"; + + public static Date currentGMTTime() { + return new Date(); + } + + public static SimpleDateFormat getGMTDateFormat(String format) { + SimpleDateFormat df = new SimpleDateFormat(format); + df.setTimeZone(TimeZone.getTimeZone("GMT")); + return df; + } + + public static Date parseDateString(TimeZone tz, String dateString) { + return parseDateString(tz, dateString, "yyyy-MM-dd HH:mm:ss"); + } + + public static Date parseISO8601DateString(String dateString) throws ParseException { + // -> SimpleDateFormat uses GMT[-+]hh:mm for the TZ so first we need to + // convert the string with this value + SimpleDateFormat df = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssz" ); + + //this is zero time so we need to add that TZ indicator for + if ( dateString.endsWith( "Z" )) { + dateString = dateString.substring( 0, dateString.length() - 1) + "GMT-00:00"; + } + else + { // -> -0700 is valid but we need to change it to -07:00 for SimpleDateFormat + dateString = dateString.replaceFirst( "-(\\d\\d)(\\d\\d)", "-$1:$2" ); + + int inset = 6; + String s0 = dateString.substring( 0, dateString.length() - inset ); + String s1 = dateString.substring( dateString.length() - inset, dateString.length() ); + dateString = s0 + "GMT" + s1; + } + + //System.out.println( "parseDate: [" + dateString + "]" ); + return df.parse( dateString ); + } + + public static Date parseDateString(TimeZone tz, String dateString, String formatString) { + DateFormat df = new SimpleDateFormat(formatString); + df.setTimeZone(tz); + + try { + return df.parse(dateString); + } catch (ParseException e) { + throw new IllegalArgumentException(e); + } + } + + public static String getDateDisplayString(TimeZone tz, Date time) { + return getDateDisplayString(tz, time, "yyyy-MM-dd HH:mm:ss"); + } + + public static String getDateDisplayString(TimeZone tz, Date time, String formatString) { + DateFormat df = new SimpleDateFormat(formatString); + df.setTimeZone(tz); + + return df.format(time); + } + + public static Calendar toCalendar(Date dt) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(dt); + return calendar; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/EC2RestAuth.java b/awsapi/src/com/cloud/bridge/util/EC2RestAuth.java index db8c490c341..e9154124a65 100644 --- a/awsapi/src/com/cloud/bridge/util/EC2RestAuth.java +++ b/awsapi/src/com/cloud/bridge/util/EC2RestAuth.java @@ -1,273 +1,289 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.security.SignatureException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Collection; -import java.util.Iterator; -import java.util.TreeMap; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; - -import org.apache.commons.codec.binary.Base64; -import org.apache.log4j.Logger; - - -public class EC2RestAuth { - protected final static Logger logger = Logger.getLogger(RestAuth.class); - - // TreeMap: used to Sort the UTF-8 query string components by parameter name with natural byte ordering - protected TreeMap queryParts = null; // used to generate a CanonicalizedQueryString - protected String canonicalizedQueryString = null; - protected String hostHeader = null; - protected String httpRequestURI = null; - - public EC2RestAuth() { - // these must be lexicographically sorted - queryParts = new TreeMap(); - } - - public static Calendar parseDateString( String created ) { - DateFormat formatter = null; - Calendar cal = Calendar.getInstance(); - - // -> for some unknown reason SimpleDateFormat does not properly handle the 'Z' timezone - if (created.endsWith( "Z" )) created = created.replace( "Z", "+0000" ); - - try { - formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssz" ); - cal.setTime( formatter.parse( created )); - return cal; - } catch( Exception e ) {} - - try { - formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" ); - cal.setTime( formatter.parse( created )); - return cal; - } catch( Exception e ) {} - - - // -> the time zone is GMT if not defined - try { - formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss" ); - cal.setTime( formatter.parse( created )); - - created = created + "+0000"; - formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" ); - cal.setTime( formatter.parse( created )); - return cal; - } catch( Exception e ) {} - - - // -> including millseconds? - try { - formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.Sz" ); - cal.setTime( formatter.parse( created )); - return cal; - } catch( Exception e ) {} - - try { - formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SZ" ); - cal.setTime( formatter.parse( created )); - return cal; - } catch( Exception e ) {} - - - // -> the CloudStack API used to return this format for some calls - try { - formatter = new SimpleDateFormat( "EEE MMM dd HH:mm:ss z yyyy" ); - cal.setTime( formatter.parse( created )); - return cal; - } catch( Exception e ) {} - - return null; - } - - /** - * Assuming that a port number is to be included. - * - * @param header - contents of the "Host:" header, skipping the 'Host:' preamble. - */ - public void setHostHeader( String hostHeader ) { - if ( null == hostHeader ) - this.hostHeader = null; - else this.hostHeader = hostHeader.trim().toLowerCase(); - } - - public void setHTTPRequestURI( String uri ) { - if ( null == uri || 0 == uri.length()) - this.httpRequestURI = new String( "/" ); - else this.httpRequestURI = uri.trim(); - } - - /** - * The given query string needs to be pulled apart, sorted by paramter name, and reconstructed. - * We sort the query string values via a TreeMap. - * - * @param query - this string still has all URL encoding in place. - */ - public void setQueryString( String query ) { - String parameter = null; - - if (null == query) { - this.canonicalizedQueryString = null; - return; - } - - // -> sort by paramter name - String[] parts = query.split( "&" ); - if (null != parts) { - for( int i=0; i < parts.length; i++ ) { - - parameter = parts[i]; - - if (parameter.startsWith( "?" )) parameter = parameter.substring( 1 ); - - // -> don't include a 'Signature=' parameter - if (parameter.startsWith( "Signature=")) continue; - - int offset = parameter.indexOf( "=" ); - if ( -1 == offset ) - queryParts.put( parameter, parameter + "=" ); - else queryParts.put( parameter.substring( 0, offset ), parameter ); - } - } - - // -> reconstruct into a canonicalized format - Collection headers = queryParts.values(); - Iterator itr = headers.iterator(); - StringBuffer reconstruct = new StringBuffer(); - int count = 0; - - while( itr.hasNext()) { - if (0 < count) reconstruct.append( "&" ); - reconstruct.append( itr.next()); - count++; - } - canonicalizedQueryString = reconstruct.toString(); - } - - - /** - * The request is authenticated if we can regenerate the same signature given - * on the request. Before calling this function make sure to set the header values - * defined by the public values above. - * - * @param httpVerb - the type of HTTP request (e.g., GET, PUT) - * @param secretKey - value obtained from the AWSAccessKeyId - * @param signature - the signature we are trying to recreate, note can be URL-encoded - * @param method - { "HmacSHA1", "HmacSHA256" } - * - * @throws SignatureException - * - * @return true if request has been authenticated, false otherwise - * @throws UnsupportedEncodingException - */ - public boolean verifySignature( String httpVerb, String secretKey, String signature, String method ) - throws SignatureException, UnsupportedEncodingException { - - if (null == httpVerb || null == secretKey || null == signature) return false; - - httpVerb = httpVerb.trim(); - secretKey = secretKey.trim(); - signature = signature.trim(); - - // -> first calculate the StringToSign after the caller has initialized all the header values - String StringToSign = genStringToSign( httpVerb ); - String calSig = calculateRFC2104HMAC( StringToSign, secretKey, method.equalsIgnoreCase( "HmacSHA1" )); - - // -> the passed in signature is defined to be URL encoded? (and it must be base64 encoded) - int offset = signature.indexOf( "%" ); - if (-1 != offset) signature = URLDecoder.decode( signature, "UTF-8" ); - - boolean match = signature.equals( calSig ); - if (!match) logger.error( "Signature mismatch, [" + signature + "] [" + calSig + "] over [" + StringToSign + "]" ); - return match; - } - - - /** - * This function generates the single string that will be used to sign with a users - * secret key. - * - * StringToSign = HTTP-Verb + "\n" + - * ValueOfHostHeaderInLowercase + "\n" + - * HTTPRequestURI + "\n" + - * CanonicalizedQueryString - * - * @return The single StringToSign or null. - */ - private String genStringToSign( String httpVerb ) { - StringBuffer stringToSign = new StringBuffer(); - - stringToSign.append( httpVerb ).append( "\n" ); - - if (null != this.hostHeader) stringToSign.append( this.hostHeader ); - stringToSign.append( "\n" ); - - if (null != this.httpRequestURI) stringToSign.append( this.httpRequestURI ); - stringToSign.append( "\n" ); - - if (null != this.canonicalizedQueryString) stringToSign.append( this.canonicalizedQueryString ); - - if (0 == stringToSign.length()) - return null; - else return stringToSign.toString(); - } - - - /** - * Create a signature by the following method: - * new String( Base64( SHA1 or SHA256 ( key, byte array ))) - * - * @param signIt - the data to generate a keyed HMAC over - * @param secretKey - the user's unique key for the HMAC operation - * @param useSHA1 - if false use SHA256 - * @return String - the recalculated string - * @throws SignatureException - */ - private String calculateRFC2104HMAC( String signIt, String secretKey, boolean useSHA1 ) - throws SignatureException { - SecretKeySpec key = null; - Mac hmacShaAlg = null; - String result = null; - - try { - if ( useSHA1 ) { - key = new SecretKeySpec( secretKey.getBytes(), "HmacSHA1" ); - hmacShaAlg = Mac.getInstance( "HmacSHA1" ); - } - else { - key = new SecretKeySpec( secretKey.getBytes(), "HmacSHA256" ); - hmacShaAlg = Mac.getInstance( "HmacSHA256" ); - } - - hmacShaAlg.init( key ); - byte [] rawHmac = hmacShaAlg.doFinal( signIt.getBytes()); - result = new String( Base64.encodeBase64( rawHmac )); - - } catch( Exception e ) { - throw new SignatureException( "Failed to generate keyed HMAC on REST request: " + e.getMessage()); - } - return result.trim(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.security.SignatureException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Collection; +import java.util.Iterator; +import java.util.TreeMap; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.commons.codec.binary.Base64; +import org.apache.log4j.Logger; + + +public class EC2RestAuth { + protected final static Logger logger = Logger.getLogger(RestAuth.class); + + // TreeMap: used to Sort the UTF-8 query string components by parameter name with natural byte ordering + protected TreeMap queryParts = null; // used to generate a CanonicalizedQueryString + protected String canonicalizedQueryString = null; + protected String hostHeader = null; + protected String httpRequestURI = null; + + public EC2RestAuth() { + // these must be lexicographically sorted + queryParts = new TreeMap(); + } + + public static Calendar parseDateString( String created ) { + DateFormat formatter = null; + Calendar cal = Calendar.getInstance(); + + // -> for some unknown reason SimpleDateFormat does not properly handle the 'Z' timezone + if (created.endsWith( "Z" )) created = created.replace( "Z", "+0000" ); + + try { + formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssz" ); + cal.setTime( formatter.parse( created )); + return cal; + } catch( Exception e ) {} + + try { + formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" ); + cal.setTime( formatter.parse( created )); + return cal; + } catch( Exception e ) {} + + + // -> the time zone is GMT if not defined + try { + formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss" ); + cal.setTime( formatter.parse( created )); + + created = created + "+0000"; + formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" ); + cal.setTime( formatter.parse( created )); + return cal; + } catch( Exception e ) {} + + + // -> including millseconds? + try { + formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.Sz" ); + cal.setTime( formatter.parse( created )); + return cal; + } catch( Exception e ) {} + + try { + formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SZ" ); + cal.setTime( formatter.parse( created )); + return cal; + } catch( Exception e ) {} + + + // -> the CloudStack API used to return this format for some calls + try { + formatter = new SimpleDateFormat( "EEE MMM dd HH:mm:ss z yyyy" ); + cal.setTime( formatter.parse( created )); + return cal; + } catch( Exception e ) {} + + return null; + } + + /** + * Assuming that a port number is to be included. + * + * @param header - contents of the "Host:" header, skipping the 'Host:' preamble. + */ + public void setHostHeader( String hostHeader ) { + if ( null == hostHeader ) + this.hostHeader = null; + else this.hostHeader = hostHeader.trim().toLowerCase(); + } + + public void setHTTPRequestURI( String uri ) { + if ( null == uri || 0 == uri.length()) + this.httpRequestURI = new String( "/" ); + else this.httpRequestURI = uri.trim(); + } + + /** + * The given query string needs to be pulled apart, sorted by paramter name, and reconstructed. + * We sort the query string values via a TreeMap. + * + * @param query - this string still has all URL encoding in place. + */ + public void setQueryString( String query ) { + String parameter = null; + + if (null == query) { + this.canonicalizedQueryString = null; + return; + } + + // -> sort by paramter name + String[] parts = query.split( "&" ); + if (null != parts) { + for( int i=0; i < parts.length; i++ ) { + + parameter = parts[i]; + + if (parameter.startsWith( "?" )) parameter = parameter.substring( 1 ); + + // -> don't include a 'Signature=' parameter + if (parameter.startsWith( "Signature=")) continue; + + int offset = parameter.indexOf( "=" ); + if ( -1 == offset ) + queryParts.put( parameter, parameter + "=" ); + else queryParts.put( parameter.substring( 0, offset ), parameter ); + } + } + + // -> reconstruct into a canonicalized format + Collection headers = queryParts.values(); + Iterator itr = headers.iterator(); + StringBuffer reconstruct = new StringBuffer(); + int count = 0; + + while( itr.hasNext()) { + if (0 < count) reconstruct.append( "&" ); + reconstruct.append( itr.next()); + count++; + } + canonicalizedQueryString = reconstruct.toString(); + } + + + /** + * The request is authenticated if we can regenerate the same signature given + * on the request. Before calling this function make sure to set the header values + * defined by the public values above. + * + * @param httpVerb - the type of HTTP request (e.g., GET, PUT) + * @param secretKey - value obtained from the AWSAccessKeyId + * @param signature - the signature we are trying to recreate, note can be URL-encoded + * @param method - { "HmacSHA1", "HmacSHA256" } + * + * @throws SignatureException + * + * @return true if request has been authenticated, false otherwise + * @throws UnsupportedEncodingException + */ + public boolean verifySignature( String httpVerb, String secretKey, String signature, String method ) + throws SignatureException, UnsupportedEncodingException { + + if (null == httpVerb || null == secretKey || null == signature) return false; + + httpVerb = httpVerb.trim(); + secretKey = secretKey.trim(); + signature = signature.trim(); + + // -> first calculate the StringToSign after the caller has initialized all the header values + String StringToSign = genStringToSign( httpVerb ); + String calSig = calculateRFC2104HMAC( StringToSign, secretKey, method.equalsIgnoreCase( "HmacSHA1" )); + + // -> the passed in signature is defined to be URL encoded? (and it must be base64 encoded) + int offset = signature.indexOf( "%" ); + if (-1 != offset) signature = URLDecoder.decode( signature, "UTF-8" ); + + boolean match = signature.equals( calSig ); + if (!match) logger.error( "Signature mismatch, [" + signature + "] [" + calSig + "] over [" + StringToSign + "]" ); + return match; + } + + + /** + * This function generates the single string that will be used to sign with a users + * secret key. + * + * StringToSign = HTTP-Verb + "\n" + + * ValueOfHostHeaderInLowercase + "\n" + + * HTTPRequestURI + "\n" + + * CanonicalizedQueryString + * + * @return The single StringToSign or null. + */ + private String genStringToSign( String httpVerb ) { + StringBuffer stringToSign = new StringBuffer(); + + stringToSign.append( httpVerb ).append( "\n" ); + + if (null != this.hostHeader) stringToSign.append( this.hostHeader ); + stringToSign.append( "\n" ); + + if (null != this.httpRequestURI) stringToSign.append( this.httpRequestURI ); + stringToSign.append( "\n" ); + + if (null != this.canonicalizedQueryString) stringToSign.append( this.canonicalizedQueryString ); + + if (0 == stringToSign.length()) + return null; + else return stringToSign.toString(); + } + + + /** + * Create a signature by the following method: + * new String( Base64( SHA1 or SHA256 ( key, byte array ))) + * + * @param signIt - the data to generate a keyed HMAC over + * @param secretKey - the user's unique key for the HMAC operation + * @param useSHA1 - if false use SHA256 + * @return String - the recalculated string + * @throws SignatureException + */ + private String calculateRFC2104HMAC( String signIt, String secretKey, boolean useSHA1 ) + throws SignatureException { + SecretKeySpec key = null; + Mac hmacShaAlg = null; + String result = null; + + try { + if ( useSHA1 ) { + key = new SecretKeySpec( secretKey.getBytes(), "HmacSHA1" ); + hmacShaAlg = Mac.getInstance( "HmacSHA1" ); + } + else { + key = new SecretKeySpec( secretKey.getBytes(), "HmacSHA256" ); + hmacShaAlg = Mac.getInstance( "HmacSHA256" ); + } + + hmacShaAlg.init( key ); + byte [] rawHmac = hmacShaAlg.doFinal( signIt.getBytes()); + result = new String( Base64.encodeBase64( rawHmac )); + + } catch( Exception e ) { + throw new SignatureException( "Failed to generate keyed HMAC on REST request: " + e.getMessage()); + } + return result.trim(); + } +} diff --git a/awsapi/src/com/cloud/bridge/util/EncryptionSecretKeyCheckerUtil.java b/awsapi/src/com/cloud/bridge/util/EncryptionSecretKeyCheckerUtil.java index 4ff8c9bdbd2..0a652212b3e 100644 --- a/awsapi/src/com/cloud/bridge/util/EncryptionSecretKeyCheckerUtil.java +++ b/awsapi/src/com/cloud/bridge/util/EncryptionSecretKeyCheckerUtil.java @@ -1,122 +1,138 @@ -package com.cloud.bridge.util; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.Properties; - -import org.apache.log4j.Logger; -import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; -import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig; - - -public class EncryptionSecretKeyCheckerUtil { - private static final Logger s_logger = Logger.getLogger(EncryptionSecretKeyCheckerUtil.class); - - private static final String s_keyFile = "/etc/cloud/management/key"; - private static final String s_envKey = "CLOUD_SECRET_KEY"; - private static StandardPBEStringEncryptor s_encryptor = new StandardPBEStringEncryptor(); - private static boolean s_useEncryption = false; - - static{ - //Get encryption type from db.properties - final File dbPropsFile = ConfigurationHelper.findConfigurationFile("db.properties"); - final Properties dbProps = new Properties(); - try { - dbProps.load(new FileInputStream(dbPropsFile)); - - final String encryptionType = dbProps.getProperty("db.cloud.encryption.type"); - - s_logger.debug("Encryption Type: "+ encryptionType); - - if(encryptionType != null && !encryptionType.equals("none")){ - - s_encryptor.setAlgorithm("PBEWithMD5AndDES"); - String secretKey = null; - - SimpleStringPBEConfig stringConfig = new SimpleStringPBEConfig(); - - if(encryptionType.equals("file")){ - try { - BufferedReader in = new BufferedReader(new FileReader(s_keyFile)); - secretKey = in.readLine(); - //Check for null or empty secret key - } catch (FileNotFoundException e) { - throw new RuntimeException("File containing secret key not found: "+s_keyFile, e); - } catch (IOException e) { - throw new RuntimeException("Error while reading secret key from: "+s_keyFile, e); - } - - if(secretKey == null || secretKey.isEmpty()){ - throw new RuntimeException("Secret key is null or empty in file "+s_keyFile); - } - - } else if(encryptionType.equals("env")){ - secretKey = System.getenv(s_envKey); - if(secretKey == null || secretKey.isEmpty()){ - throw new RuntimeException("Environment variable "+s_envKey+" is not set or empty"); - } - } else if(encryptionType.equals("web")){ - ServerSocket serverSocket = null; - int port = 8097; - try { - serverSocket = new ServerSocket(port); - } catch (IOException ioex) { - throw new RuntimeException("Error initializing secret key reciever", ioex); - } - s_logger.info("Waiting for admin to send secret key on port "+port); - Socket clientSocket = null; - try { - clientSocket = serverSocket.accept(); - } catch (IOException e) { - throw new RuntimeException("Accept failed on "+port); - } - PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true); - BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); - String inputLine, outputLine; - if ((inputLine = in.readLine()) != null) { - secretKey = inputLine; - } - out.close(); - in.close(); - clientSocket.close(); - serverSocket.close(); - } else { - throw new RuntimeException("Invalid encryption type: "+encryptionType); - } - - stringConfig.setPassword(secretKey); - s_encryptor.setConfig(stringConfig); - s_useEncryption = true; - } - } catch (FileNotFoundException e) { - throw new RuntimeException("File db.properties not found", e); - } catch (IOException e) { - throw new RuntimeException("Error while reading db.properties", e); - } - } - - public static StandardPBEStringEncryptor getEncryptor() { - return s_encryptor; - } - - public static boolean useEncryption(){ - return s_useEncryption; - } - - //Initialize encryptor for migration during secret key change - public static void initEncryptorForMigration(String secretKey){ - s_encryptor.setAlgorithm("PBEWithMD5AndDES"); - SimpleStringPBEConfig stringConfig = new SimpleStringPBEConfig(); - stringConfig.setPassword(secretKey); - s_encryptor.setConfig(stringConfig); - s_useEncryption = true; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.bridge.util; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.Properties; + +import org.apache.log4j.Logger; +import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; +import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig; + + +public class EncryptionSecretKeyCheckerUtil { + private static final Logger s_logger = Logger.getLogger(EncryptionSecretKeyCheckerUtil.class); + + private static final String s_keyFile = "/etc/cloud/management/key"; + private static final String s_envKey = "CLOUD_SECRET_KEY"; + private static StandardPBEStringEncryptor s_encryptor = new StandardPBEStringEncryptor(); + private static boolean s_useEncryption = false; + + static{ + //Get encryption type from db.properties + final File dbPropsFile = ConfigurationHelper.findConfigurationFile("db.properties"); + final Properties dbProps = new Properties(); + try { + dbProps.load(new FileInputStream(dbPropsFile)); + + final String encryptionType = dbProps.getProperty("db.cloud.encryption.type"); + + s_logger.debug("Encryption Type: "+ encryptionType); + + if(encryptionType != null && !encryptionType.equals("none")){ + + s_encryptor.setAlgorithm("PBEWithMD5AndDES"); + String secretKey = null; + + SimpleStringPBEConfig stringConfig = new SimpleStringPBEConfig(); + + if(encryptionType.equals("file")){ + try { + BufferedReader in = new BufferedReader(new FileReader(s_keyFile)); + secretKey = in.readLine(); + //Check for null or empty secret key + } catch (FileNotFoundException e) { + throw new RuntimeException("File containing secret key not found: "+s_keyFile, e); + } catch (IOException e) { + throw new RuntimeException("Error while reading secret key from: "+s_keyFile, e); + } + + if(secretKey == null || secretKey.isEmpty()){ + throw new RuntimeException("Secret key is null or empty in file "+s_keyFile); + } + + } else if(encryptionType.equals("env")){ + secretKey = System.getenv(s_envKey); + if(secretKey == null || secretKey.isEmpty()){ + throw new RuntimeException("Environment variable "+s_envKey+" is not set or empty"); + } + } else if(encryptionType.equals("web")){ + ServerSocket serverSocket = null; + int port = 8097; + try { + serverSocket = new ServerSocket(port); + } catch (IOException ioex) { + throw new RuntimeException("Error initializing secret key reciever", ioex); + } + s_logger.info("Waiting for admin to send secret key on port "+port); + Socket clientSocket = null; + try { + clientSocket = serverSocket.accept(); + } catch (IOException e) { + throw new RuntimeException("Accept failed on "+port); + } + PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true); + BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); + String inputLine, outputLine; + if ((inputLine = in.readLine()) != null) { + secretKey = inputLine; + } + out.close(); + in.close(); + clientSocket.close(); + serverSocket.close(); + } else { + throw new RuntimeException("Invalid encryption type: "+encryptionType); + } + + stringConfig.setPassword(secretKey); + s_encryptor.setConfig(stringConfig); + s_useEncryption = true; + } + } catch (FileNotFoundException e) { + throw new RuntimeException("File db.properties not found", e); + } catch (IOException e) { + throw new RuntimeException("Error while reading db.properties", e); + } + } + + public static StandardPBEStringEncryptor getEncryptor() { + return s_encryptor; + } + + public static boolean useEncryption(){ + return s_useEncryption; + } + + //Initialize encryptor for migration during secret key change + public static void initEncryptorForMigration(String secretKey){ + s_encryptor.setAlgorithm("PBEWithMD5AndDES"); + SimpleStringPBEConfig stringConfig = new SimpleStringPBEConfig(); + stringConfig.setPassword(secretKey); + s_encryptor.setConfig(stringConfig); + s_useEncryption = true; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/EntityParam.java b/awsapi/src/com/cloud/bridge/util/EntityParam.java index 5cfe2e57a80..c11f4b98a39 100644 --- a/awsapi/src/com/cloud/bridge/util/EntityParam.java +++ b/awsapi/src/com/cloud/bridge/util/EntityParam.java @@ -1,31 +1,47 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -/** - * @author Kelven Yang - */ -public class EntityParam { - private Object entity; - - public EntityParam(Object entity) { - this.entity = entity; - } - - public Object entityValue() { - return entity; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +/** + * @author Kelven Yang + */ +public class EntityParam { + private Object entity; + + public EntityParam(Object entity) { + this.entity = entity; + } + + public Object entityValue() { + return entity; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/HeaderParam.java b/awsapi/src/com/cloud/bridge/util/HeaderParam.java index b510aa518f8..3b70ab1d642 100644 --- a/awsapi/src/com/cloud/bridge/util/HeaderParam.java +++ b/awsapi/src/com/cloud/bridge/util/HeaderParam.java @@ -1,33 +1,49 @@ -package com.cloud.bridge.util; - -public class HeaderParam { - - protected String name; - protected String value; - - public HeaderParam() { - name = null; - value = null; - } - - public HeaderParam (String name, String value) { - this.name = name; - this.name = value; - } - - public void setName( String name ) { - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setValue( String value ) { - this.value = value; - } - - public String getValue() { - return this.value; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.bridge.util; + +public class HeaderParam { + + protected String name; + protected String value; + + public HeaderParam() { + name = null; + value = null; + } + + public HeaderParam (String name, String value) { + this.name = name; + this.name = value; + } + + public void setName( String name ) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void setValue( String value ) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/ISO8601SimpleDateTimeFormat.java b/awsapi/src/com/cloud/bridge/util/ISO8601SimpleDateTimeFormat.java index 3869957ae2e..2c34bce2c94 100644 --- a/awsapi/src/com/cloud/bridge/util/ISO8601SimpleDateTimeFormat.java +++ b/awsapi/src/com/cloud/bridge/util/ISO8601SimpleDateTimeFormat.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/util/IpAddressRange.java b/awsapi/src/com/cloud/bridge/util/IpAddressRange.java index 365d48802ed..ffd17b4a940 100644 --- a/awsapi/src/com/cloud/bridge/util/IpAddressRange.java +++ b/awsapi/src/com/cloud/bridge/util/IpAddressRange.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/util/IteratorHelper.java b/awsapi/src/com/cloud/bridge/util/IteratorHelper.java index f2573b7112c..03267cfbfae 100644 --- a/awsapi/src/com/cloud/bridge/util/IteratorHelper.java +++ b/awsapi/src/com/cloud/bridge/util/IteratorHelper.java @@ -1,56 +1,72 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.util.Enumeration; -import java.util.Iterator; - -/** - * @author Kelven Yang - */ -public class IteratorHelper { - public static Iterable enumerationAsIterable(final Enumeration e) { - return new Iterable () { - public Iterator iterator() { - return new Iterator() { - public boolean hasNext() { - return e.hasMoreElements(); - } - - public T next() { - return e.nextElement(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - }; - } - - public static Enumeration iteratorAsEnumeration(final Iterator it) { - return new Enumeration() { - public boolean hasMoreElements() { - return it.hasNext(); - } - - public T nextElement() { - return it.next(); - } - }; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.util.Enumeration; +import java.util.Iterator; + +/** + * @author Kelven Yang + */ +public class IteratorHelper { + public static Iterable enumerationAsIterable(final Enumeration e) { + return new Iterable () { + public Iterator iterator() { + return new Iterator() { + public boolean hasNext() { + return e.hasMoreElements(); + } + + public T next() { + return e.nextElement(); + } + + public void remove() { + throw new UnsupportedOperationException(); + } + }; + } + }; + } + + public static Enumeration iteratorAsEnumeration(final Iterator it) { + return new Enumeration() { + public boolean hasMoreElements() { + return it.hasNext(); + } + + public T nextElement() { + return it.next(); + } + }; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/JsonAccessor.java b/awsapi/src/com/cloud/bridge/util/JsonAccessor.java index 81bff32d1fe..127a4018d4f 100644 --- a/awsapi/src/com/cloud/bridge/util/JsonAccessor.java +++ b/awsapi/src/com/cloud/bridge/util/JsonAccessor.java @@ -1,251 +1,267 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.cloud.bridge.service.exception.InternalErrorException; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; - -/** - * JsonAccessor provides the functionality to allow navigating JSON object graph using simple expressions, - * for example, following property access expressions are all valid ones - * - * rootobj.level1obj[1].property - * this[0].level1obj[1].property - * - * @author Kelven Yang - */ -public class JsonAccessor { - private JsonElement _json; - - Pattern _arrayAccessorMatcher = Pattern.compile("(.*)\\[(\\d+)\\]"); - - public JsonAccessor(JsonElement json) { - assert(json != null); - _json = json; - } - - public BigDecimal getAsBigDecimal(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsBigDecimal(); - } - - public BigInteger getAsBigInteger(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsBigInteger(); - } - - public boolean getAsBoolean(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsBoolean(); - } - - public byte getAsByte(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsByte(); - } - - public char getAsCharacter(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsCharacter(); - } - - public double getAsDouble(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsDouble(); - } - - public float getAsFloat(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsFloat(); - } - - public int getAsInt(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsInt(); - } - - public long getAsLong(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsLong(); - } - - public Number getAsNumber(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsNumber(); - } - - public short getAsShort(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsShort(); - } - - public String getAsString(String propPath) { - JsonElement jsonElement = eval(propPath); - return jsonElement.getAsString(); - } - - public boolean isBoolean(String propPath) { - JsonElement jsonElement = eval(propPath); - if(jsonElement instanceof JsonPrimitive) - return ((JsonPrimitive)jsonElement).isBoolean(); - - return false; - } - - public boolean isNumber(String propPath) { - JsonElement jsonElement = eval(propPath); - - if(jsonElement instanceof JsonPrimitive) - return ((JsonPrimitive)jsonElement).isNumber(); - return false; - } - - public boolean isString(String propPath) { - JsonElement jsonElement = eval(propPath); - - if(jsonElement instanceof JsonPrimitive) - return ((JsonPrimitive)jsonElement).isString(); - return false; - } - - /* - * Return - * -1 : property expression can not be resolved - * 0 : match to a null JSON object - * 1+ : matched, for array element, the count of the elements inside the array - */ - public int getMatchCount(String propPath) { - JsonElement jsonElement = tryEval(propPath); - if(jsonElement == null) - return -1; - - if(jsonElement.isJsonNull()) - return 0; - - if(jsonElement.isJsonArray()) - return ((JsonArray)jsonElement).size(); - - return 1; - } - - public JsonElement eval(String propPath) { - JsonElement jsonElement = tryEval(propPath); - if(jsonElement == null) - throw new InternalErrorException("Property " + propPath + " is resolved to null JSON element on object: " + _json.toString()); - - return jsonElement; - } - - public JsonElement tryEval(String propPath) { - assert(propPath != null); - String[] tokens = propPath.split("\\."); - - ArrayList resolverChain = new ArrayList(); - for(String token : tokens) { - Matcher matcher = _arrayAccessorMatcher.matcher(token); - if(matcher.find()) { - String propStr = matcher.group(1); - String indexStr = matcher.group(2); - - resolverChain.add(new ArrayPropertyResolver(propStr, Integer.parseInt(indexStr))); - } else { - resolverChain.add(new PropertyResolver(token)); - } - } - - JsonElement jsonElementToResolveAt = _json; - for(Resolver resolver : resolverChain) { - jsonElementToResolveAt = resolver.resolve(jsonElementToResolveAt); - - if(jsonElementToResolveAt == null) - break; - } - - return jsonElementToResolveAt; - } - - // - // Property resolvers - // - private static interface Resolver { - public JsonElement resolve(JsonElement jsonElementToResolveAt); - } - - private static class PropertyResolver implements Resolver { - protected String _propName; - - public PropertyResolver(String propName) { - _propName = propName; - } - - public JsonElement resolve(JsonElement jsonElementToResolveAt) { - if("this".equals(_propName)) - return jsonElementToResolveAt; - - if(jsonElementToResolveAt.isJsonObject()) - return ((JsonObject)jsonElementToResolveAt).get(_propName); - - if(jsonElementToResolveAt.isJsonNull()) - throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString())); - - throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName - + ", on object: " + jsonElementToResolveAt.toString()); - } - } - - private static class ArrayPropertyResolver extends PropertyResolver { - protected int _index; - - public ArrayPropertyResolver(String propName, int index) { - super(propName); - _index = index; - } - - public JsonElement resolve(JsonElement jsonElementToResolveAt) { - if(!"this".equals(_propName)) { - if(jsonElementToResolveAt.isJsonObject()) { - jsonElementToResolveAt = ((JsonObject)jsonElementToResolveAt).get(_propName); - } else { - if(jsonElementToResolveAt.isJsonNull()) - throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString())); - - - throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName - + ", on object: " + jsonElementToResolveAt.toString()); - } - } - - if(jsonElementToResolveAt instanceof JsonArray) { - return ((JsonArray)jsonElementToResolveAt).get(_index); - } - - if(jsonElementToResolveAt.isJsonNull()) - throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString())); - - throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName - + ", on object: " + jsonElementToResolveAt.toString()); - } - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.cloud.bridge.service.exception.InternalErrorException; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; + +/** + * JsonAccessor provides the functionality to allow navigating JSON object graph using simple expressions, + * for example, following property access expressions are all valid ones + * + * rootobj.level1obj[1].property + * this[0].level1obj[1].property + * + * @author Kelven Yang + */ +public class JsonAccessor { + private JsonElement _json; + + Pattern _arrayAccessorMatcher = Pattern.compile("(.*)\\[(\\d+)\\]"); + + public JsonAccessor(JsonElement json) { + assert(json != null); + _json = json; + } + + public BigDecimal getAsBigDecimal(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsBigDecimal(); + } + + public BigInteger getAsBigInteger(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsBigInteger(); + } + + public boolean getAsBoolean(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsBoolean(); + } + + public byte getAsByte(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsByte(); + } + + public char getAsCharacter(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsCharacter(); + } + + public double getAsDouble(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsDouble(); + } + + public float getAsFloat(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsFloat(); + } + + public int getAsInt(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsInt(); + } + + public long getAsLong(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsLong(); + } + + public Number getAsNumber(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsNumber(); + } + + public short getAsShort(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsShort(); + } + + public String getAsString(String propPath) { + JsonElement jsonElement = eval(propPath); + return jsonElement.getAsString(); + } + + public boolean isBoolean(String propPath) { + JsonElement jsonElement = eval(propPath); + if(jsonElement instanceof JsonPrimitive) + return ((JsonPrimitive)jsonElement).isBoolean(); + + return false; + } + + public boolean isNumber(String propPath) { + JsonElement jsonElement = eval(propPath); + + if(jsonElement instanceof JsonPrimitive) + return ((JsonPrimitive)jsonElement).isNumber(); + return false; + } + + public boolean isString(String propPath) { + JsonElement jsonElement = eval(propPath); + + if(jsonElement instanceof JsonPrimitive) + return ((JsonPrimitive)jsonElement).isString(); + return false; + } + + /* + * Return + * -1 : property expression can not be resolved + * 0 : match to a null JSON object + * 1+ : matched, for array element, the count of the elements inside the array + */ + public int getMatchCount(String propPath) { + JsonElement jsonElement = tryEval(propPath); + if(jsonElement == null) + return -1; + + if(jsonElement.isJsonNull()) + return 0; + + if(jsonElement.isJsonArray()) + return ((JsonArray)jsonElement).size(); + + return 1; + } + + public JsonElement eval(String propPath) { + JsonElement jsonElement = tryEval(propPath); + if(jsonElement == null) + throw new InternalErrorException("Property " + propPath + " is resolved to null JSON element on object: " + _json.toString()); + + return jsonElement; + } + + public JsonElement tryEval(String propPath) { + assert(propPath != null); + String[] tokens = propPath.split("\\."); + + ArrayList resolverChain = new ArrayList(); + for(String token : tokens) { + Matcher matcher = _arrayAccessorMatcher.matcher(token); + if(matcher.find()) { + String propStr = matcher.group(1); + String indexStr = matcher.group(2); + + resolverChain.add(new ArrayPropertyResolver(propStr, Integer.parseInt(indexStr))); + } else { + resolverChain.add(new PropertyResolver(token)); + } + } + + JsonElement jsonElementToResolveAt = _json; + for(Resolver resolver : resolverChain) { + jsonElementToResolveAt = resolver.resolve(jsonElementToResolveAt); + + if(jsonElementToResolveAt == null) + break; + } + + return jsonElementToResolveAt; + } + + // + // Property resolvers + // + private static interface Resolver { + public JsonElement resolve(JsonElement jsonElementToResolveAt); + } + + private static class PropertyResolver implements Resolver { + protected String _propName; + + public PropertyResolver(String propName) { + _propName = propName; + } + + public JsonElement resolve(JsonElement jsonElementToResolveAt) { + if("this".equals(_propName)) + return jsonElementToResolveAt; + + if(jsonElementToResolveAt.isJsonObject()) + return ((JsonObject)jsonElementToResolveAt).get(_propName); + + if(jsonElementToResolveAt.isJsonNull()) + throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString())); + + throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName + + ", on object: " + jsonElementToResolveAt.toString()); + } + } + + private static class ArrayPropertyResolver extends PropertyResolver { + protected int _index; + + public ArrayPropertyResolver(String propName, int index) { + super(propName); + _index = index; + } + + public JsonElement resolve(JsonElement jsonElementToResolveAt) { + if(!"this".equals(_propName)) { + if(jsonElementToResolveAt.isJsonObject()) { + jsonElementToResolveAt = ((JsonObject)jsonElementToResolveAt).get(_propName); + } else { + if(jsonElementToResolveAt.isJsonNull()) + throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString())); + + + throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName + + ", on object: " + jsonElementToResolveAt.toString()); + } + } + + if(jsonElementToResolveAt instanceof JsonArray) { + return ((JsonArray)jsonElementToResolveAt).get(_index); + } + + if(jsonElementToResolveAt.isJsonNull()) + throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString())); + + throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName + + ", on object: " + jsonElementToResolveAt.toString()); + } + } +} diff --git a/awsapi/src/com/cloud/bridge/util/NetHelper.java b/awsapi/src/com/cloud/bridge/util/NetHelper.java index 7ec5b1ccf20..5041277c8f9 100644 --- a/awsapi/src/com/cloud/bridge/util/NetHelper.java +++ b/awsapi/src/com/cloud/bridge/util/NetHelper.java @@ -1,97 +1,113 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.SocketException; -import java.net.UnknownHostException; -import java.util.ArrayList; -import java.util.Formatter; -import java.util.List; - -import org.apache.log4j.Logger; - -/** - * @author Kelven Yang - */ -public class NetHelper { - protected final static Logger logger = Logger.getLogger(NetHelper.class); - - public static String getHostName() { - try { - InetAddress localAddr = InetAddress.getLocalHost(); - if(localAddr != null) { - return localAddr.getHostName(); - } - } catch(UnknownHostException e) { - logger.warn("UnknownHostException when trying to get host name. ", e); - } - return "localhost"; - } - - public static InetAddress[] getAllLocalInetAddresses() { - List addrList = new ArrayList(); - try { - for(NetworkInterface ifc : IteratorHelper.enumerationAsIterable(NetworkInterface.getNetworkInterfaces())) { - if(ifc.isUp() && !ifc.isVirtual()) { - for(InetAddress addr : IteratorHelper.enumerationAsIterable(ifc.getInetAddresses())) { - addrList.add(addr); - } - } - } - } catch (SocketException e) { - logger.warn("SocketException in getAllLocalInetAddresses().", e); - } - - InetAddress[] addrs = new InetAddress[addrList.size()]; - if(addrList.size() > 0) - System.arraycopy(addrList.toArray(), 0, addrs, 0, addrList.size()); - return addrs; - } - - public static InetAddress getFirstNonLoopbackLocalInetAddress() { - InetAddress[] addrs = getAllLocalInetAddresses(); - if(addrs != null) { - for(InetAddress addr : addrs) { - if(logger.isInfoEnabled()) - logger.info("Check local InetAddress : " + addr.toString() + ", total count :" + addrs.length); - - if(!addr.isLoopbackAddress()) - return addr; - } - } - - logger.warn("Unable to determine a non-loopback address, local inet address count :" + addrs.length); - return null; - } - - public static String getMacAddress(InetAddress address) { - StringBuffer sb = new StringBuffer(); - Formatter formatter = new Formatter(sb); - try { - NetworkInterface ni = NetworkInterface.getByInetAddress(address); - byte[] mac = ni.getHardwareAddress(); - - for (int i = 0; i < mac.length; i++) { - formatter.format("%02X%s", mac[i], (i < mac.length - 1) ? ":" : ""); - } - } catch (SocketException e) { - logger.error("SocketException when trying to retrieve MAC address", e); - } - return sb.toString(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.net.SocketException; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.Formatter; +import java.util.List; + +import org.apache.log4j.Logger; + +/** + * @author Kelven Yang + */ +public class NetHelper { + protected final static Logger logger = Logger.getLogger(NetHelper.class); + + public static String getHostName() { + try { + InetAddress localAddr = InetAddress.getLocalHost(); + if(localAddr != null) { + return localAddr.getHostName(); + } + } catch(UnknownHostException e) { + logger.warn("UnknownHostException when trying to get host name. ", e); + } + return "localhost"; + } + + public static InetAddress[] getAllLocalInetAddresses() { + List addrList = new ArrayList(); + try { + for(NetworkInterface ifc : IteratorHelper.enumerationAsIterable(NetworkInterface.getNetworkInterfaces())) { + if(ifc.isUp() && !ifc.isVirtual()) { + for(InetAddress addr : IteratorHelper.enumerationAsIterable(ifc.getInetAddresses())) { + addrList.add(addr); + } + } + } + } catch (SocketException e) { + logger.warn("SocketException in getAllLocalInetAddresses().", e); + } + + InetAddress[] addrs = new InetAddress[addrList.size()]; + if(addrList.size() > 0) + System.arraycopy(addrList.toArray(), 0, addrs, 0, addrList.size()); + return addrs; + } + + public static InetAddress getFirstNonLoopbackLocalInetAddress() { + InetAddress[] addrs = getAllLocalInetAddresses(); + if(addrs != null) { + for(InetAddress addr : addrs) { + if(logger.isInfoEnabled()) + logger.info("Check local InetAddress : " + addr.toString() + ", total count :" + addrs.length); + + if(!addr.isLoopbackAddress()) + return addr; + } + } + + logger.warn("Unable to determine a non-loopback address, local inet address count :" + addrs.length); + return null; + } + + public static String getMacAddress(InetAddress address) { + StringBuffer sb = new StringBuffer(); + Formatter formatter = new Formatter(sb); + try { + NetworkInterface ni = NetworkInterface.getByInetAddress(address); + byte[] mac = ni.getHardwareAddress(); + + for (int i = 0; i < mac.length; i++) { + formatter.format("%02X%s", mac[i], (i < mac.length - 1) ? ":" : ""); + } + } catch (SocketException e) { + logger.error("SocketException when trying to retrieve MAC address", e); + } + return sb.toString(); + } +} diff --git a/awsapi/src/com/cloud/bridge/util/OrderedPair.java b/awsapi/src/com/cloud/bridge/util/OrderedPair.java index beaae9baebb..0ef08811ff4 100644 --- a/awsapi/src/com/cloud/bridge/util/OrderedPair.java +++ b/awsapi/src/com/cloud/bridge/util/OrderedPair.java @@ -1,52 +1,68 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -/** - * @author Kelven Yang, John Zucker - * Reusable class whose instances encode any ordered pair (or 2-tuple) of values of types T1 and T2 - * Provide getters: getFirst(), getSecond() - * Provide setters: setFirst(val), setSecond(val) - * @param - * @param - */ -public class OrderedPair { - T1 first; - T2 second; - - public OrderedPair(T1 t1, T2 t2) { - first = t1; - second = t2; - } - - public T1 getFirst() { - return first; - } - - public OrderedPair setFirst(T1 t1) { - first = t1; - return this; - } - - public T2 getSecond() { - return second; - } - - public OrderedPair setSecond(T2 t2) { - second = t2; - return this; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +/** + * @author Kelven Yang, John Zucker + * Reusable class whose instances encode any ordered pair (or 2-tuple) of values of types T1 and T2 + * Provide getters: getFirst(), getSecond() + * Provide setters: setFirst(val), setSecond(val) + * @param + * @param + */ +public class OrderedPair { + T1 first; + T2 second; + + public OrderedPair(T1 t1, T2 t2) { + first = t1; + second = t2; + } + + public T1 getFirst() { + return first; + } + + public OrderedPair setFirst(T1 t1) { + first = t1; + return this; + } + + public T2 getSecond() { + return second; + } + + public OrderedPair setSecond(T2 t2) { + second = t2; + return this; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/PolicyParser.java b/awsapi/src/com/cloud/bridge/util/PolicyParser.java index 0609abeb055..ef7013c36f7 100644 --- a/awsapi/src/com/cloud/bridge/util/PolicyParser.java +++ b/awsapi/src/com/cloud/bridge/util/PolicyParser.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright 2011 Cloud.com, Inc. * diff --git a/awsapi/src/com/cloud/bridge/util/QueryHelper.java b/awsapi/src/com/cloud/bridge/util/QueryHelper.java index 279c4d6995b..6f0a6a1a87f 100644 --- a/awsapi/src/com/cloud/bridge/util/QueryHelper.java +++ b/awsapi/src/com/cloud/bridge/util/QueryHelper.java @@ -1,87 +1,103 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.Locale; - -import org.hibernate.Query; - -/** - * @author Kelven Yang - */ -public class QueryHelper { - public static void bindParameters(Query query, Object[] params) { - int pos = 0; - if(params != null && params.length > 0) { - for(Object param : params) { - if(param instanceof Byte) - query.setByte(pos++, ((Byte)param).byteValue()); - else if(param instanceof Short) - query.setShort(pos++, ((Short)param).shortValue()); - else if(param instanceof Integer) - query.setInteger(pos++, ((Integer)param).intValue()); - else if(param instanceof Long) - query.setLong(pos++, ((Long)param).longValue()); - else if(param instanceof Float) - query.setFloat(pos++, ((Float)param).floatValue()); - else if(param instanceof Double) - query.setDouble(pos++, ((Double)param).doubleValue()); - else if(param instanceof Boolean) - query.setBoolean(pos++, ((Boolean)param).booleanValue()); - else if(param instanceof Character) - query.setCharacter(pos++, ((Character)param).charValue()); - else if(param instanceof Date) - query.setDate(pos++, (Date)param); - else if(param instanceof Calendar) - query.setCalendar(pos++, (Calendar)param); - else if(param instanceof CalendarDateParam) - query.setCalendarDate(pos++, ((CalendarDateParam)param).dateValue()); - else if(param instanceof TimestampParam) - query.setTimestamp(pos++, ((TimestampParam)param).timestampValue()); - else if(param instanceof TimeParam) - query.setTime(pos++, ((TimeParam)param).timeValue()); - else if(param instanceof String) - query.setString(pos++, (String)param); - else if(param instanceof TextParam) - query.setText(pos++, ((TextParam)param).textValue()); - else if(param instanceof byte[]) - query.setBinary(pos++, (byte[])param); - else if(param instanceof BigDecimal) - query.setBigDecimal(pos++, (BigDecimal)param); - else if(param instanceof BigInteger) - query.setBigInteger(pos++, (BigInteger)param); - else if(param instanceof Locale) - query.setLocale(pos++, (Locale)param); - else if(param instanceof EntityParam) - query.setEntity(pos++, ((EntityParam)param).entityValue()); - else if(param instanceof Serializable) - query.setSerializable(pos++, (Serializable)param); - else - query.setEntity(pos++, param); - } - } - } - - public static List executeQuery(Query query) { - return (List)query.list(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +import org.hibernate.Query; + +/** + * @author Kelven Yang + */ +public class QueryHelper { + public static void bindParameters(Query query, Object[] params) { + int pos = 0; + if(params != null && params.length > 0) { + for(Object param : params) { + if(param instanceof Byte) + query.setByte(pos++, ((Byte)param).byteValue()); + else if(param instanceof Short) + query.setShort(pos++, ((Short)param).shortValue()); + else if(param instanceof Integer) + query.setInteger(pos++, ((Integer)param).intValue()); + else if(param instanceof Long) + query.setLong(pos++, ((Long)param).longValue()); + else if(param instanceof Float) + query.setFloat(pos++, ((Float)param).floatValue()); + else if(param instanceof Double) + query.setDouble(pos++, ((Double)param).doubleValue()); + else if(param instanceof Boolean) + query.setBoolean(pos++, ((Boolean)param).booleanValue()); + else if(param instanceof Character) + query.setCharacter(pos++, ((Character)param).charValue()); + else if(param instanceof Date) + query.setDate(pos++, (Date)param); + else if(param instanceof Calendar) + query.setCalendar(pos++, (Calendar)param); + else if(param instanceof CalendarDateParam) + query.setCalendarDate(pos++, ((CalendarDateParam)param).dateValue()); + else if(param instanceof TimestampParam) + query.setTimestamp(pos++, ((TimestampParam)param).timestampValue()); + else if(param instanceof TimeParam) + query.setTime(pos++, ((TimeParam)param).timeValue()); + else if(param instanceof String) + query.setString(pos++, (String)param); + else if(param instanceof TextParam) + query.setText(pos++, ((TextParam)param).textValue()); + else if(param instanceof byte[]) + query.setBinary(pos++, (byte[])param); + else if(param instanceof BigDecimal) + query.setBigDecimal(pos++, (BigDecimal)param); + else if(param instanceof BigInteger) + query.setBigInteger(pos++, (BigInteger)param); + else if(param instanceof Locale) + query.setLocale(pos++, (Locale)param); + else if(param instanceof EntityParam) + query.setEntity(pos++, ((EntityParam)param).entityValue()); + else if(param instanceof Serializable) + query.setSerializable(pos++, (Serializable)param); + else + query.setEntity(pos++, param); + } + } + } + + public static List executeQuery(Query query) { + return (List)query.list(); + } +} diff --git a/awsapi/src/com/cloud/bridge/util/RestAuth.java b/awsapi/src/com/cloud/bridge/util/RestAuth.java index dc8ac5df7e2..32794a3f2e7 100644 --- a/awsapi/src/com/cloud/bridge/util/RestAuth.java +++ b/awsapi/src/com/cloud/bridge/util/RestAuth.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/util/S3SoapAuth.java b/awsapi/src/com/cloud/bridge/util/S3SoapAuth.java index 99c4e64a267..4f49bb30722 100644 --- a/awsapi/src/com/cloud/bridge/util/S3SoapAuth.java +++ b/awsapi/src/com/cloud/bridge/util/S3SoapAuth.java @@ -1,73 +1,89 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; - -import org.apache.axis2.AxisFault; -import org.apache.commons.codec.binary.Base64; -import org.apache.log4j.Logger; - - -/** - * Both the SOAP code and the DIME implementation in the REST servlet need - * this authentication functionality. - */ -public class S3SoapAuth { - protected final static Logger logger = Logger.getLogger(S3SoapAuth.class); - - public S3SoapAuth() { - } - - public static void verifySignature( String givenSignature, String operation, String timestamp, String accessKey, String secretKey ) - throws AxisFault { - // -> calculate RFC 2104 HMAC-SHA1 digest over the constructed string - String signString = "AmazonS3" + operation + timestamp; - String calSig = calculateRFC2104HMAC( signString, secretKey ); - - if ( null == calSig || !givenSignature.equals( calSig )) - { - logger.error( "Signature mismatch, [" + givenSignature + "] [" + calSig + "] over [" + signString + "]" ); - throw new AxisFault( "Authentication signature mismatch on AccessKey: [" + accessKey + "] [" + operation + "]", - "Client.SignatureDoesNotMatch" ); - } - } - - /** - * Create a signature by the following method: - * new String( Base64( SHA1( key, byte array ))) - * - * @param signIt - the data to generate a keyed HMAC over - * @param secretKey - the user's unique key for the HMAC operation - * @return String - the recalculated string - */ - private static String calculateRFC2104HMAC( String signIt, String secretKey ) { - String result = null; - try - { SecretKeySpec key = new SecretKeySpec( secretKey.getBytes(), "HmacSHA1" ); - Mac hmacSha1 = Mac.getInstance( "HmacSHA1" ); - hmacSha1.init( key ); - byte [] rawHmac = hmacSha1.doFinal( signIt.getBytes()); - result = new String( Base64.encodeBase64( rawHmac )); - - } catch( Exception e ) { - logger.error( "Failed to generate keyed HMAC on soap request: " + e.getMessage()); - return null; - } - return result.trim(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.axis2.AxisFault; +import org.apache.commons.codec.binary.Base64; +import org.apache.log4j.Logger; + + +/** + * Both the SOAP code and the DIME implementation in the REST servlet need + * this authentication functionality. + */ +public class S3SoapAuth { + protected final static Logger logger = Logger.getLogger(S3SoapAuth.class); + + public S3SoapAuth() { + } + + public static void verifySignature( String givenSignature, String operation, String timestamp, String accessKey, String secretKey ) + throws AxisFault { + // -> calculate RFC 2104 HMAC-SHA1 digest over the constructed string + String signString = "AmazonS3" + operation + timestamp; + String calSig = calculateRFC2104HMAC( signString, secretKey ); + + if ( null == calSig || !givenSignature.equals( calSig )) + { + logger.error( "Signature mismatch, [" + givenSignature + "] [" + calSig + "] over [" + signString + "]" ); + throw new AxisFault( "Authentication signature mismatch on AccessKey: [" + accessKey + "] [" + operation + "]", + "Client.SignatureDoesNotMatch" ); + } + } + + /** + * Create a signature by the following method: + * new String( Base64( SHA1( key, byte array ))) + * + * @param signIt - the data to generate a keyed HMAC over + * @param secretKey - the user's unique key for the HMAC operation + * @return String - the recalculated string + */ + private static String calculateRFC2104HMAC( String signIt, String secretKey ) { + String result = null; + try + { SecretKeySpec key = new SecretKeySpec( secretKey.getBytes(), "HmacSHA1" ); + Mac hmacSha1 = Mac.getInstance( "HmacSHA1" ); + hmacSha1.init( key ); + byte [] rawHmac = hmacSha1.doFinal( signIt.getBytes()); + result = new String( Base64.encodeBase64( rawHmac )); + + } catch( Exception e ) { + logger.error( "Failed to generate keyed HMAC on soap request: " + e.getMessage()); + return null; + } + return result.trim(); + } +} diff --git a/awsapi/src/com/cloud/bridge/util/ServletRequestDataSource.java b/awsapi/src/com/cloud/bridge/util/ServletRequestDataSource.java index 14bcb778888..04c0323e82d 100644 --- a/awsapi/src/com/cloud/bridge/util/ServletRequestDataSource.java +++ b/awsapi/src/com/cloud/bridge/util/ServletRequestDataSource.java @@ -1,61 +1,77 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import javax.activation.DataSource; -import javax.servlet.http.HttpServletRequest; - -import org.apache.log4j.Logger; - -/** - * @author Kelven Yang - */ -public class ServletRequestDataSource implements DataSource { - protected final static Logger logger = Logger.getLogger(ServletRequestDataSource.class); - - private HttpServletRequest request; - - public ServletRequestDataSource(HttpServletRequest request) { - this.request = request; - } - - @Override - public String getContentType() { - assert(false); - return null; - } - - @Override - public InputStream getInputStream() throws IOException { - return request.getInputStream(); - } - - @Override - public String getName() { - assert(false); - return null; - } - - @Override - public OutputStream getOutputStream() throws IOException { - assert(false); - return null; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import javax.activation.DataSource; +import javax.servlet.http.HttpServletRequest; + +import org.apache.log4j.Logger; + +/** + * @author Kelven Yang + */ +public class ServletRequestDataSource implements DataSource { + protected final static Logger logger = Logger.getLogger(ServletRequestDataSource.class); + + private HttpServletRequest request; + + public ServletRequestDataSource(HttpServletRequest request) { + this.request = request; + } + + @Override + public String getContentType() { + assert(false); + return null; + } + + @Override + public InputStream getInputStream() throws IOException { + return request.getInputStream(); + } + + @Override + public String getName() { + assert(false); + return null; + } + + @Override + public OutputStream getOutputStream() throws IOException { + assert(false); + return null; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/StringHelper.java b/awsapi/src/com/cloud/bridge/util/StringHelper.java index 2220346b44d..eeb38d4fb79 100644 --- a/awsapi/src/com/cloud/bridge/util/StringHelper.java +++ b/awsapi/src/com/cloud/bridge/util/StringHelper.java @@ -1,111 +1,127 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.IOException; -import java.io.InputStream; - -/** - * @author Kelven, John Zucker - * Provide converters for regexp (case independent tokens) - * Also provide upper case or lower case (default) converters for byte array b[] to hex String - */ -public class StringHelper { - public static final String EMPTY_STRING = ""; - - private static final char[] hexCharsUpperCase = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; - - private static final char[] hexCharsLowerCase = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' }; - - /* Convert byte array b[] into an uppercase hex string - */ - public static String toHexStringUpperCase(byte[] b) { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < b.length; i++) { - sb.append(hexCharsUpperCase[ (int)(((int)b[i] >> 4) & 0x0f)]); - sb.append(hexCharsUpperCase[ (int)(((int)b[i]) & 0x0f)]); - } - return sb.toString(); - } - - /* Convert byte array b[] into a lowercase (default) hex string - */ - public static String toHexString(byte[] b) { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < b.length; i++) { - sb.append(hexCharsLowerCase[ (int)(((int)b[i] >> 4) & 0x0f)]); - sb.append(hexCharsLowerCase[ (int)(((int)b[i]) & 0x0f)]); - } - return sb.toString(); - } - - public static String substringInBetween(String name, - String prefix, String delimiter) { - - int startPos = 0; - if(prefix != null) - startPos = prefix.length() + 1; - - int endPos = name.indexOf(delimiter, startPos); - if(endPos > 0) - return name.substring(startPos, endPos); - - return null; - } - - public static String stringFromStream(InputStream is) throws IOException { - StringBuffer sb = new StringBuffer(); - byte[] b = new byte[4096]; - int n; - while((n = is.read(b)) != -1) { - sb.append(new String(b, 0, n)); - } - return sb.toString(); - } - - /** - * Convert the string into a regex to allow easy matching. In both S3 and EC2 regex strings - * are used for matching. We must remember to quote all special regex characters that appear - * in the string. - */ - public static String toRegex(String param) - { - StringBuffer regex = new StringBuffer(); - for( int i=0; i < param.length(); i++ ) - { - char next = param.charAt( i ); - if ('*' == next) regex.append( ".+" ); // -> multi-character match wild card - else if ('?' == next) regex.append( "." ); // -> single-character match wild card - else if ('.' == next) regex.append( "\\." ); // all of these are special regex characters we are quoting - else if ('+' == next) regex.append( "\\+" ); - else if ('$' == next) regex.append( "\\$" ); - else if ('\\' == next) regex.append( "\\\\" ); - else if ('[' == next) regex.append( "\\[" ); - else if (']' == next) regex.append( "\\]" ); - else if ('{' == next) regex.append( "\\{" ); - else if ('}' == next) regex.append( "\\}" ); - else if ('(' == next) regex.append( "\\(" ); - else if (')' == next) regex.append( "\\)" ); - else if ('&' == next) regex.append( "\\&" ); - else if ('^' == next) regex.append( "\\^" ); - else if ('-' == next) regex.append( "\\-" ); - else if ('|' == next) regex.append( "\\|" ); - else regex.append( next ); - } - - return regex.toString(); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.IOException; +import java.io.InputStream; + +/** + * @author Kelven, John Zucker + * Provide converters for regexp (case independent tokens) + * Also provide upper case or lower case (default) converters for byte array b[] to hex String + */ +public class StringHelper { + public static final String EMPTY_STRING = ""; + + private static final char[] hexCharsUpperCase = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; + + private static final char[] hexCharsLowerCase = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' }; + + /* Convert byte array b[] into an uppercase hex string + */ + public static String toHexStringUpperCase(byte[] b) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < b.length; i++) { + sb.append(hexCharsUpperCase[ (int)(((int)b[i] >> 4) & 0x0f)]); + sb.append(hexCharsUpperCase[ (int)(((int)b[i]) & 0x0f)]); + } + return sb.toString(); + } + + /* Convert byte array b[] into a lowercase (default) hex string + */ + public static String toHexString(byte[] b) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < b.length; i++) { + sb.append(hexCharsLowerCase[ (int)(((int)b[i] >> 4) & 0x0f)]); + sb.append(hexCharsLowerCase[ (int)(((int)b[i]) & 0x0f)]); + } + return sb.toString(); + } + + public static String substringInBetween(String name, + String prefix, String delimiter) { + + int startPos = 0; + if(prefix != null) + startPos = prefix.length() + 1; + + int endPos = name.indexOf(delimiter, startPos); + if(endPos > 0) + return name.substring(startPos, endPos); + + return null; + } + + public static String stringFromStream(InputStream is) throws IOException { + StringBuffer sb = new StringBuffer(); + byte[] b = new byte[4096]; + int n; + while((n = is.read(b)) != -1) { + sb.append(new String(b, 0, n)); + } + return sb.toString(); + } + + /** + * Convert the string into a regex to allow easy matching. In both S3 and EC2 regex strings + * are used for matching. We must remember to quote all special regex characters that appear + * in the string. + */ + public static String toRegex(String param) + { + StringBuffer regex = new StringBuffer(); + for( int i=0; i < param.length(); i++ ) + { + char next = param.charAt( i ); + if ('*' == next) regex.append( ".+" ); // -> multi-character match wild card + else if ('?' == next) regex.append( "." ); // -> single-character match wild card + else if ('.' == next) regex.append( "\\." ); // all of these are special regex characters we are quoting + else if ('+' == next) regex.append( "\\+" ); + else if ('$' == next) regex.append( "\\$" ); + else if ('\\' == next) regex.append( "\\\\" ); + else if ('[' == next) regex.append( "\\[" ); + else if (']' == next) regex.append( "\\]" ); + else if ('{' == next) regex.append( "\\{" ); + else if ('}' == next) regex.append( "\\}" ); + else if ('(' == next) regex.append( "\\(" ); + else if (')' == next) regex.append( "\\)" ); + else if ('&' == next) regex.append( "\\&" ); + else if ('^' == next) regex.append( "\\^" ); + else if ('-' == next) regex.append( "\\-" ); + else if ('|' == next) regex.append( "\\|" ); + else regex.append( next ); + } + + return regex.toString(); + } +} diff --git a/awsapi/src/com/cloud/bridge/util/TextParam.java b/awsapi/src/com/cloud/bridge/util/TextParam.java index f7c98f002e7..7b85a68e5ee 100644 --- a/awsapi/src/com/cloud/bridge/util/TextParam.java +++ b/awsapi/src/com/cloud/bridge/util/TextParam.java @@ -1,31 +1,47 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -/** - * @author Kelven - */ -public class TextParam { - private String textValue; - - public TextParam(String textValue) { - this.textValue = textValue; - } - - public String textValue() { - return textValue; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +/** + * @author Kelven + */ +public class TextParam { + private String textValue; + + public TextParam(String textValue) { + this.textValue = textValue; + } + + public String textValue() { + return textValue; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/TimeParam.java b/awsapi/src/com/cloud/bridge/util/TimeParam.java index fae2675797c..af630e51bdd 100644 --- a/awsapi/src/com/cloud/bridge/util/TimeParam.java +++ b/awsapi/src/com/cloud/bridge/util/TimeParam.java @@ -1,33 +1,49 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.util.Date; - -/** - * @author Kelven Yang - */ -public class TimeParam { - private Date timeValue; - - public TimeParam(Date timeValue) { - this.timeValue = timeValue; - } - - public Date timeValue() { - return timeValue; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.util.Date; + +/** + * @author Kelven Yang + */ +public class TimeParam { + private Date timeValue; + + public TimeParam(Date timeValue) { + this.timeValue = timeValue; + } + + public Date timeValue() { + return timeValue; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/TimestampParam.java b/awsapi/src/com/cloud/bridge/util/TimestampParam.java index 7ae153f0fb0..64d5d44bc7a 100644 --- a/awsapi/src/com/cloud/bridge/util/TimestampParam.java +++ b/awsapi/src/com/cloud/bridge/util/TimestampParam.java @@ -1,33 +1,49 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.util.Date; - -/** - * @author Kelven Yang - */ -public class TimestampParam { - private Date timestampValue; - - public TimestampParam(Date timestampValue) { - this.timestampValue = timestampValue; - } - - public Date timestampValue() { - return timestampValue; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.util.Date; + +/** + * @author Kelven Yang + */ +public class TimestampParam { + private Date timestampValue; + + public TimestampParam(Date timestampValue) { + this.timestampValue = timestampValue; + } + + public Date timestampValue() { + return timestampValue; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/Triple.java b/awsapi/src/com/cloud/bridge/util/Triple.java index 146e2917d75..dbeaa74a26c 100644 --- a/awsapi/src/com/cloud/bridge/util/Triple.java +++ b/awsapi/src/com/cloud/bridge/util/Triple.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/bridge/util/XElement.java b/awsapi/src/com/cloud/bridge/util/XElement.java index d330ddf3b23..782657bc482 100644 --- a/awsapi/src/com/cloud/bridge/util/XElement.java +++ b/awsapi/src/com/cloud/bridge/util/XElement.java @@ -1,33 +1,49 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @author Kelven Yang - */ -@Target({ElementType.TYPE, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface XElement { - String name(); - String ns() default ""; - String item() default ""; - String itemClass() default ""; -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @author Kelven Yang + */ +@Target({ElementType.TYPE, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface XElement { + String name(); + String ns() default ""; + String item() default ""; + String itemClass() default ""; +} diff --git a/awsapi/src/com/cloud/bridge/util/XFlatten.java b/awsapi/src/com/cloud/bridge/util/XFlatten.java index 8aec2091092..bb338e44a3b 100644 --- a/awsapi/src/com/cloud/bridge/util/XFlatten.java +++ b/awsapi/src/com/cloud/bridge/util/XFlatten.java @@ -1,30 +1,46 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @author Kelven Yang - */ -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface XFlatten { - boolean value(); -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @author Kelven Yang + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface XFlatten { + boolean value(); +} diff --git a/awsapi/src/com/cloud/bridge/util/XOmitNull.java b/awsapi/src/com/cloud/bridge/util/XOmitNull.java index 40340bbdc18..3efe781eec8 100644 --- a/awsapi/src/com/cloud/bridge/util/XOmitNull.java +++ b/awsapi/src/com/cloud/bridge/util/XOmitNull.java @@ -1,30 +1,46 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @author Kelven Yang - */ -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface XOmitNull { - boolean value(); -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @author Kelven Yang + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface XOmitNull { + boolean value(); +} diff --git a/awsapi/src/com/cloud/bridge/util/XSerializable.java b/awsapi/src/com/cloud/bridge/util/XSerializable.java index 73810ce4313..303bdd1efbd 100644 --- a/awsapi/src/com/cloud/bridge/util/XSerializable.java +++ b/awsapi/src/com/cloud/bridge/util/XSerializable.java @@ -1,28 +1,44 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.PrintWriter; - -import org.w3c.dom.Node; - -/** - * @author Kelven Yang - */ -public interface XSerializable { - void serializeTo(XSerializer serializer, int indentLevel, PrintWriter writer); - void serializeFrom(XSerializer serializer, Object object, Node node); -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.PrintWriter; + +import org.w3c.dom.Node; + +/** + * @author Kelven Yang + */ +public interface XSerializable { + void serializeTo(XSerializer serializer, int indentLevel, PrintWriter writer); + void serializeFrom(XSerializer serializer, Object object, Node node); +} diff --git a/awsapi/src/com/cloud/bridge/util/XSerializer.java b/awsapi/src/com/cloud/bridge/util/XSerializer.java index 35a4aced8c9..73ca3a5e5b6 100644 --- a/awsapi/src/com/cloud/bridge/util/XSerializer.java +++ b/awsapi/src/com/cloud/bridge/util/XSerializer.java @@ -1,498 +1,514 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -import org.apache.log4j.Logger; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * @author Kelven Yang - */ -public class XSerializer { - protected final static Logger logger = Logger.getLogger(XSerializer.class); - - private static Map> rootTypes = new HashMap>(); - - private XSerializerAdapter adapter; - private boolean flattenCollection; - private boolean omitNull; - - public XSerializer(XSerializerAdapter adapter) { - this.adapter = adapter; - adapter.setSerializer(this); - - // set default serialization options - flattenCollection = false; - omitNull = false; - } - - public XSerializer(XSerializerAdapter adapter, boolean flattenCollection, boolean omitNull) { - this.adapter = adapter; - adapter.setSerializer(this); - - this.flattenCollection = flattenCollection; - this.omitNull = omitNull; - } - - public boolean getFlattenCollection() { - return flattenCollection; - } - - public void setFlattenCollection(boolean value) { - flattenCollection = value; - } - - public boolean flattenField(Field f) { - XFlatten flatten = f.getAnnotation(XFlatten.class); - if(flatten != null) - return flatten.value(); - return flattenCollection; - } - - public boolean omitNullField(Field f) { - XOmitNull omit= f.getAnnotation(XOmitNull.class); - if(omit != null) - return omit.value(); - - return omitNull; - } - - public boolean getOmitNull() { - return omitNull; - } - - public void setOmitNull(boolean value) { - omitNull = value; - } - - public static void registerRootType(String elementName, Class clz) { - rootTypes.put(elementName, clz); - } - - public XSerializerAdapter getAdapter() { - return adapter; - } - - public static Object mapElement(String elementName) { - Class clz = rootTypes.get(elementName); - if(clz == null) { - logger.error("Object class is not registered for root element " + elementName); - throw new IllegalArgumentException("Object class is not registered for root element " + elementName); - } - - try { - return clz.newInstance(); - } catch (InstantiationException e) { - logger.error("Unable to instantiate object for root element due to InstantiationException, XML element: " + elementName); - throw new IllegalArgumentException("Unable to instantiate object for root element " + elementName); - } catch (IllegalAccessException e) { - logger.error("Unable to instantiate object for root element due to IllegalAccessException, XML element: " + elementName); - throw new IllegalArgumentException("Unable to instantiate object for root element due to IllegalAccessException, XML element: " + elementName); - } - } - - public Object serializeFrom(String xmlString) { - try { - Document doc = XmlHelper.parse(xmlString); - Node node = XmlHelper.getRootNode(doc); - if(node == null) { - logger.error("Invalid XML document, no root element"); - return null; - } - - Object object = mapElement(node.getNodeName()); - if(object == null) { - logger.error("Unable to map root element. Please remember to use XSerializer.registerRootType() to register the root object type"); - return null; - } - - if(object instanceof XSerializable) - ((XSerializable)object).serializeFrom(this, object, node); - else - serializeFrom(object, object.getClass(), node); - - return object; - } catch (IOException e) { - logger.error("Unable to parse XML input due to " + e.getMessage(), e); - } - return null; - } - - private void serializeFrom(Object object, Class clz, Node node) { - if(clz.getSuperclass() != null) - serializeFrom(object, clz.getSuperclass(), node); - - Field[] fields = clz.getDeclaredFields(); - for(int i = 0; i < fields.length; i++) { - Field f = fields[i]; - - if((f.getModifiers() & Modifier.STATIC) == 0) { - f.setAccessible(true); - - Class fieldType = f.getType(); - XElement elem = f.getAnnotation(XElement.class); - if(elem == null) - continue; - - try { - if(fieldType.isPrimitive()) { - setPrimitiveField(f, object, XmlHelper.getChildNodeTextContent(node, elem.name())); - } else if(fieldType.getSuperclass() == Number.class) { - setNumberField(f, object, XmlHelper.getChildNodeTextContent(node, elem.name())); - } else if(fieldType == String.class) { - f.set(object, XmlHelper.getChildNodeTextContent(node, elem.name())); - } else if(fieldType == Date.class) { - setDateField(f, object, XmlHelper.getChildNodeTextContent(node, elem.name())); - } else if(fieldType == Calendar.class) { - setCalendarField(f, object, XmlHelper.getChildNodeTextContent(node, elem.name())); - } else if(fieldType.isArray()) { - if(flattenField(f)) - setArrayField(f, object, node, elem.item(), elem.itemClass()); - else - setArrayField(f, object, XmlHelper.getChildNode(node, elem.name()), elem.item(), elem.itemClass()); - } else if(Collection.class.isAssignableFrom(fieldType)) { - if(flattenField(f)) - setCollectionField(f, object, node, elem.item(), elem.itemClass()); - else - setCollectionField(f, object, XmlHelper.getChildNode(node, elem.name()), elem.item(), elem.itemClass()); - } else { - Node childNode = XmlHelper.getChildNode(node, elem.name()); - Object fieldObject = f.get(object); - if(fieldObject == null) { - try { - fieldObject = fieldType.newInstance(); - } catch (InstantiationException e) { - logger.error("Unable to instantiate " + fieldType.getName() + " object, please make sure it has public constructor"); - assert(false); - } - f.set(object, fieldObject); - } - serializeFrom(fieldObject, fieldType, childNode); - } - } catch(IllegalArgumentException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - } catch(IllegalAccessException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - } - } - } - } - - private void setPrimitiveField(Field f, Object object, String valueContent) - throws IllegalArgumentException, IllegalAccessException { - - String clzName = f.getType().getName(); - if(clzName.equals("boolean")) { - if(valueContent != null && valueContent.equalsIgnoreCase("true")) - f.setBoolean(object, true); - else - f.setBoolean(object, false); - } else if(clzName.equals("byte")) { - byte value = 0; - if(valueContent != null) - value = Byte.parseByte(valueContent); - f.setByte(object, value); - } else if(clzName.equals("char")) { - char value = '\0'; - if(valueContent != null) { - if(valueContent.charAt(0) == '\'') - value = valueContent.charAt(1); - else - value = valueContent.charAt(0); - } - f.setChar(object, value); - } else if(clzName.equals("short")) { - short value = 0; - if(valueContent != null) - value = Short.parseShort(valueContent); - f.setShort(object, value); - } else if(clzName.equals("int")) { - int value = 0; - if(valueContent != null) - value = Integer.parseInt(valueContent); - f.setInt(object, value); - } else if(clzName.equals("long")) { - long value = 0; - if(valueContent != null) - value = Long.parseLong(valueContent); - f.setLong(object, value); - } else if(clzName.equals("float")) { - float value = 0; - if(valueContent != null) - value = Float.parseFloat(valueContent); - f.setFloat(object, value); - } else if(clzName.equals("double")) { - double value = 0; - if(valueContent != null) - value = Double.parseDouble(valueContent); - f.setDouble(object, value); - } else { - logger.error("Assertion failed at setPrimitiveFiled"); - assert(false); - } - } - - private void setNumberField(Field f, Object object, String valueContent) - throws IllegalArgumentException, IllegalAccessException { - - String clzName = f.getType().getName(); - if(clzName.equals("Byte")) { - byte value = 0; - if(valueContent != null) - value = Byte.parseByte(valueContent); - f.set(object, new Byte(value)); - } else if(clzName.equals("Short")) { - short value = 0; - if(valueContent != null) - value = Short.parseShort(valueContent); - f.set(object, new Short(value)); - } else if(clzName.equals("Integer")) { - int value = 0; - if(valueContent != null) - value = Integer.parseInt(valueContent); - f.set(object, new Integer(value)); - } else if(clzName.equals("Long")) { - long value = 0; - if(valueContent != null) - value = Long.parseLong(valueContent); - f.set(object, new Long(value)); - } else if(clzName.equals("Float")) { - float value = 0; - if(valueContent != null) - value = Float.parseFloat(valueContent); - f.set(object, new Float(value)); - } else if(clzName.equals("Double")) { - double value = 0; - if(valueContent != null) - value = Double.parseDouble(valueContent); - f.setDouble(object, new Double(value)); - } else if(clzName.equals("AtomicInteger")) { - int value = 0; - if(valueContent != null) - value = Integer.parseInt(valueContent); - f.set(object, new AtomicInteger(value)); - } else if(clzName.equals("AtomicLong")) { - long value = 0; - if(valueContent != null) - value = Long.parseLong(valueContent); - f.set(object, new AtomicLong(value)); - } else if(clzName.equals("BigInteger")) { - logger.error("we don't support BigInteger for now"); - assert(false); - } else if(clzName.equals("BigDecimal")) { - logger.error("we don't support BigInteger for now"); - assert(false); - } else { - logger.error("Assertion failed at setPrimitiveFiled"); - assert(false); - } - } - - private void setDateField(Field f, Object object, String valueContent) - throws IllegalArgumentException, IllegalAccessException { - - if(valueContent != null) { - valueContent = valueContent.replace('T', ' '); - valueContent = valueContent.replace('.', '\0'); - - SimpleDateFormat df = DateHelper.getGMTDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - Date value = df.parse(valueContent); - f.set(object, value); - } catch (ParseException e) { - logger.error("Unrecognized date/time format " + valueContent); - } - } - } - - private void setCalendarField(Field f, Object object, String valueContent) - throws IllegalArgumentException, IllegalAccessException { - - if(valueContent != null) { - valueContent = valueContent.replace('T', ' '); - valueContent = valueContent.replace('.', '\0'); - - SimpleDateFormat df = DateHelper.getGMTDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - Date value = df.parse(valueContent); - f.set(object, DateHelper.toCalendar(value)); - } catch (ParseException e) { - logger.error("Unrecognized date/time format " + valueContent); - } - } - } - - private void setArrayField(Field f, Object object, Node node, String itemElementName, String itemClass) - throws IllegalArgumentException, IllegalAccessException { - - List arrayList = new ArrayList(); - - Class itemClz = null; - try { - itemClz = this.getClass().forName(itemClass); - } catch (ClassNotFoundException e) { - logger.error("Unable to find class " + itemClass); - return; - } - - if(node != null) { - NodeList l = node.getChildNodes(); - if(l != null && l.getLength() > 0) { - for(int i = 0; i < l.getLength(); i++) { - try { - Node itemNode = l.item(i); - if(itemNode.getNodeName().equals(itemElementName)) { - Object item = itemClz.newInstance(); - serializeFrom(item, itemClz, l.item(i)); - arrayList.add(item); - } - } catch (InstantiationException e) { - logger.error("Unable to initiate object instance for class " + itemClass + ", make sure it has public constructor"); - break; - } - } - } - } - - Object arrary = Array.newInstance(f.getType().getComponentType(), arrayList.size()); - arrayList.toArray((Object[])arrary); - f.set(object, arrary); - } - - private void setCollectionField(Field f, Object object, Node node, String itemElementName, String itemClass) - throws IllegalArgumentException, IllegalAccessException { - Object fieldObject = f.get(object); - - if(fieldObject == null) { - logger.error("Please initialize collection field " + f.getName() + " in class " + object.getClass().getName() + "'s constructor"); - return; - } - - Class itemClz = null; - try { - itemClz = this.getClass().forName(itemClass); - } catch (ClassNotFoundException e) { - logger.error("Unable to find class " + itemClass); - return; - } - - NodeList l = node.getChildNodes(); - if(l != null && l.getLength() > 0) { - for(int i = 0; i < l.getLength(); i++) { - try { - Node itemNode = l.item(i); - if(itemNode.getNodeName().equals(itemElementName)) { - Object item = itemClz.newInstance(); - serializeFrom(item, itemClz, l.item(i)); - ((Collection)fieldObject).add(item); - } - } catch (InstantiationException e) { - logger.error("Unable to initiate object instance for class " + itemClass + ", make sure it has public constructor"); - break; - } - } - } - } - - public void serializeTo(Object obj, String startElement, String namespace, int indentLevel, PrintWriter writer) { - if(startElement != null) { - adapter.beginElement(startElement, namespace, indentLevel, writer); - indentLevel++; - } - - if(obj instanceof XSerializable) { - ((XSerializable)obj).serializeTo(this, indentLevel, writer); - } else { - Class clz = obj.getClass(); - serializeTo(obj, clz, indentLevel, writer); - } - - if(startElement != null) { - indentLevel--; - adapter.endElement(startElement, indentLevel, writer); - } - } - - public String serializeTo(Object obj, String startElement, String namespace, int indentLevel) { - StringWriter writer = new StringWriter(); - serializeTo(obj, startElement, namespace, indentLevel, new PrintWriter(writer)); - return writer.toString(); - } - - private void serializeTo(Object obj, Class clz, int indentLevel, PrintWriter writer) { - if(clz.getSuperclass() != null) - serializeTo(obj, clz.getSuperclass(), indentLevel, writer); - - Field[] fields = clz.getDeclaredFields(); - for(int i = 0; i < fields.length; i++) { - Field f = fields[i]; - - if((f.getModifiers() & Modifier.STATIC) == 0) { - f.setAccessible(true); - - Class fieldType = f.getType(); - XElement elem = f.getAnnotation(XElement.class); - if(elem == null) - continue; - - Object fieldValue = null; - try { - fieldValue = f.get(obj); - } catch (IllegalArgumentException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - } catch (IllegalAccessException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - } - - adapter.writeElement(elem.name(), elem.item(), fieldValue, f, indentLevel, writer); - if(i < fields.length - 1) { - Field next = fields[i + 1]; - if((next.getModifiers() & Modifier.STATIC) == 0 && next.getAnnotation(XElement.class) != null) { - adapter.writeSeparator(indentLevel, writer); - } - } - } - } - } - - public boolean isComposite(Class clz) { - if(clz.isPrimitive() || clz.getSuperclass() == Number.class || - clz == String.class || clz == Date.class || clz == Calendar.class) { - return false; - } - return true; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * @author Kelven Yang + */ +public class XSerializer { + protected final static Logger logger = Logger.getLogger(XSerializer.class); + + private static Map> rootTypes = new HashMap>(); + + private XSerializerAdapter adapter; + private boolean flattenCollection; + private boolean omitNull; + + public XSerializer(XSerializerAdapter adapter) { + this.adapter = adapter; + adapter.setSerializer(this); + + // set default serialization options + flattenCollection = false; + omitNull = false; + } + + public XSerializer(XSerializerAdapter adapter, boolean flattenCollection, boolean omitNull) { + this.adapter = adapter; + adapter.setSerializer(this); + + this.flattenCollection = flattenCollection; + this.omitNull = omitNull; + } + + public boolean getFlattenCollection() { + return flattenCollection; + } + + public void setFlattenCollection(boolean value) { + flattenCollection = value; + } + + public boolean flattenField(Field f) { + XFlatten flatten = f.getAnnotation(XFlatten.class); + if(flatten != null) + return flatten.value(); + return flattenCollection; + } + + public boolean omitNullField(Field f) { + XOmitNull omit= f.getAnnotation(XOmitNull.class); + if(omit != null) + return omit.value(); + + return omitNull; + } + + public boolean getOmitNull() { + return omitNull; + } + + public void setOmitNull(boolean value) { + omitNull = value; + } + + public static void registerRootType(String elementName, Class clz) { + rootTypes.put(elementName, clz); + } + + public XSerializerAdapter getAdapter() { + return adapter; + } + + public static Object mapElement(String elementName) { + Class clz = rootTypes.get(elementName); + if(clz == null) { + logger.error("Object class is not registered for root element " + elementName); + throw new IllegalArgumentException("Object class is not registered for root element " + elementName); + } + + try { + return clz.newInstance(); + } catch (InstantiationException e) { + logger.error("Unable to instantiate object for root element due to InstantiationException, XML element: " + elementName); + throw new IllegalArgumentException("Unable to instantiate object for root element " + elementName); + } catch (IllegalAccessException e) { + logger.error("Unable to instantiate object for root element due to IllegalAccessException, XML element: " + elementName); + throw new IllegalArgumentException("Unable to instantiate object for root element due to IllegalAccessException, XML element: " + elementName); + } + } + + public Object serializeFrom(String xmlString) { + try { + Document doc = XmlHelper.parse(xmlString); + Node node = XmlHelper.getRootNode(doc); + if(node == null) { + logger.error("Invalid XML document, no root element"); + return null; + } + + Object object = mapElement(node.getNodeName()); + if(object == null) { + logger.error("Unable to map root element. Please remember to use XSerializer.registerRootType() to register the root object type"); + return null; + } + + if(object instanceof XSerializable) + ((XSerializable)object).serializeFrom(this, object, node); + else + serializeFrom(object, object.getClass(), node); + + return object; + } catch (IOException e) { + logger.error("Unable to parse XML input due to " + e.getMessage(), e); + } + return null; + } + + private void serializeFrom(Object object, Class clz, Node node) { + if(clz.getSuperclass() != null) + serializeFrom(object, clz.getSuperclass(), node); + + Field[] fields = clz.getDeclaredFields(); + for(int i = 0; i < fields.length; i++) { + Field f = fields[i]; + + if((f.getModifiers() & Modifier.STATIC) == 0) { + f.setAccessible(true); + + Class fieldType = f.getType(); + XElement elem = f.getAnnotation(XElement.class); + if(elem == null) + continue; + + try { + if(fieldType.isPrimitive()) { + setPrimitiveField(f, object, XmlHelper.getChildNodeTextContent(node, elem.name())); + } else if(fieldType.getSuperclass() == Number.class) { + setNumberField(f, object, XmlHelper.getChildNodeTextContent(node, elem.name())); + } else if(fieldType == String.class) { + f.set(object, XmlHelper.getChildNodeTextContent(node, elem.name())); + } else if(fieldType == Date.class) { + setDateField(f, object, XmlHelper.getChildNodeTextContent(node, elem.name())); + } else if(fieldType == Calendar.class) { + setCalendarField(f, object, XmlHelper.getChildNodeTextContent(node, elem.name())); + } else if(fieldType.isArray()) { + if(flattenField(f)) + setArrayField(f, object, node, elem.item(), elem.itemClass()); + else + setArrayField(f, object, XmlHelper.getChildNode(node, elem.name()), elem.item(), elem.itemClass()); + } else if(Collection.class.isAssignableFrom(fieldType)) { + if(flattenField(f)) + setCollectionField(f, object, node, elem.item(), elem.itemClass()); + else + setCollectionField(f, object, XmlHelper.getChildNode(node, elem.name()), elem.item(), elem.itemClass()); + } else { + Node childNode = XmlHelper.getChildNode(node, elem.name()); + Object fieldObject = f.get(object); + if(fieldObject == null) { + try { + fieldObject = fieldType.newInstance(); + } catch (InstantiationException e) { + logger.error("Unable to instantiate " + fieldType.getName() + " object, please make sure it has public constructor"); + assert(false); + } + f.set(object, fieldObject); + } + serializeFrom(fieldObject, fieldType, childNode); + } + } catch(IllegalArgumentException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + } catch(IllegalAccessException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + } + } + } + } + + private void setPrimitiveField(Field f, Object object, String valueContent) + throws IllegalArgumentException, IllegalAccessException { + + String clzName = f.getType().getName(); + if(clzName.equals("boolean")) { + if(valueContent != null && valueContent.equalsIgnoreCase("true")) + f.setBoolean(object, true); + else + f.setBoolean(object, false); + } else if(clzName.equals("byte")) { + byte value = 0; + if(valueContent != null) + value = Byte.parseByte(valueContent); + f.setByte(object, value); + } else if(clzName.equals("char")) { + char value = '\0'; + if(valueContent != null) { + if(valueContent.charAt(0) == '\'') + value = valueContent.charAt(1); + else + value = valueContent.charAt(0); + } + f.setChar(object, value); + } else if(clzName.equals("short")) { + short value = 0; + if(valueContent != null) + value = Short.parseShort(valueContent); + f.setShort(object, value); + } else if(clzName.equals("int")) { + int value = 0; + if(valueContent != null) + value = Integer.parseInt(valueContent); + f.setInt(object, value); + } else if(clzName.equals("long")) { + long value = 0; + if(valueContent != null) + value = Long.parseLong(valueContent); + f.setLong(object, value); + } else if(clzName.equals("float")) { + float value = 0; + if(valueContent != null) + value = Float.parseFloat(valueContent); + f.setFloat(object, value); + } else if(clzName.equals("double")) { + double value = 0; + if(valueContent != null) + value = Double.parseDouble(valueContent); + f.setDouble(object, value); + } else { + logger.error("Assertion failed at setPrimitiveFiled"); + assert(false); + } + } + + private void setNumberField(Field f, Object object, String valueContent) + throws IllegalArgumentException, IllegalAccessException { + + String clzName = f.getType().getName(); + if(clzName.equals("Byte")) { + byte value = 0; + if(valueContent != null) + value = Byte.parseByte(valueContent); + f.set(object, new Byte(value)); + } else if(clzName.equals("Short")) { + short value = 0; + if(valueContent != null) + value = Short.parseShort(valueContent); + f.set(object, new Short(value)); + } else if(clzName.equals("Integer")) { + int value = 0; + if(valueContent != null) + value = Integer.parseInt(valueContent); + f.set(object, new Integer(value)); + } else if(clzName.equals("Long")) { + long value = 0; + if(valueContent != null) + value = Long.parseLong(valueContent); + f.set(object, new Long(value)); + } else if(clzName.equals("Float")) { + float value = 0; + if(valueContent != null) + value = Float.parseFloat(valueContent); + f.set(object, new Float(value)); + } else if(clzName.equals("Double")) { + double value = 0; + if(valueContent != null) + value = Double.parseDouble(valueContent); + f.setDouble(object, new Double(value)); + } else if(clzName.equals("AtomicInteger")) { + int value = 0; + if(valueContent != null) + value = Integer.parseInt(valueContent); + f.set(object, new AtomicInteger(value)); + } else if(clzName.equals("AtomicLong")) { + long value = 0; + if(valueContent != null) + value = Long.parseLong(valueContent); + f.set(object, new AtomicLong(value)); + } else if(clzName.equals("BigInteger")) { + logger.error("we don't support BigInteger for now"); + assert(false); + } else if(clzName.equals("BigDecimal")) { + logger.error("we don't support BigInteger for now"); + assert(false); + } else { + logger.error("Assertion failed at setPrimitiveFiled"); + assert(false); + } + } + + private void setDateField(Field f, Object object, String valueContent) + throws IllegalArgumentException, IllegalAccessException { + + if(valueContent != null) { + valueContent = valueContent.replace('T', ' '); + valueContent = valueContent.replace('.', '\0'); + + SimpleDateFormat df = DateHelper.getGMTDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + Date value = df.parse(valueContent); + f.set(object, value); + } catch (ParseException e) { + logger.error("Unrecognized date/time format " + valueContent); + } + } + } + + private void setCalendarField(Field f, Object object, String valueContent) + throws IllegalArgumentException, IllegalAccessException { + + if(valueContent != null) { + valueContent = valueContent.replace('T', ' '); + valueContent = valueContent.replace('.', '\0'); + + SimpleDateFormat df = DateHelper.getGMTDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + Date value = df.parse(valueContent); + f.set(object, DateHelper.toCalendar(value)); + } catch (ParseException e) { + logger.error("Unrecognized date/time format " + valueContent); + } + } + } + + private void setArrayField(Field f, Object object, Node node, String itemElementName, String itemClass) + throws IllegalArgumentException, IllegalAccessException { + + List arrayList = new ArrayList(); + + Class itemClz = null; + try { + itemClz = this.getClass().forName(itemClass); + } catch (ClassNotFoundException e) { + logger.error("Unable to find class " + itemClass); + return; + } + + if(node != null) { + NodeList l = node.getChildNodes(); + if(l != null && l.getLength() > 0) { + for(int i = 0; i < l.getLength(); i++) { + try { + Node itemNode = l.item(i); + if(itemNode.getNodeName().equals(itemElementName)) { + Object item = itemClz.newInstance(); + serializeFrom(item, itemClz, l.item(i)); + arrayList.add(item); + } + } catch (InstantiationException e) { + logger.error("Unable to initiate object instance for class " + itemClass + ", make sure it has public constructor"); + break; + } + } + } + } + + Object arrary = Array.newInstance(f.getType().getComponentType(), arrayList.size()); + arrayList.toArray((Object[])arrary); + f.set(object, arrary); + } + + private void setCollectionField(Field f, Object object, Node node, String itemElementName, String itemClass) + throws IllegalArgumentException, IllegalAccessException { + Object fieldObject = f.get(object); + + if(fieldObject == null) { + logger.error("Please initialize collection field " + f.getName() + " in class " + object.getClass().getName() + "'s constructor"); + return; + } + + Class itemClz = null; + try { + itemClz = this.getClass().forName(itemClass); + } catch (ClassNotFoundException e) { + logger.error("Unable to find class " + itemClass); + return; + } + + NodeList l = node.getChildNodes(); + if(l != null && l.getLength() > 0) { + for(int i = 0; i < l.getLength(); i++) { + try { + Node itemNode = l.item(i); + if(itemNode.getNodeName().equals(itemElementName)) { + Object item = itemClz.newInstance(); + serializeFrom(item, itemClz, l.item(i)); + ((Collection)fieldObject).add(item); + } + } catch (InstantiationException e) { + logger.error("Unable to initiate object instance for class " + itemClass + ", make sure it has public constructor"); + break; + } + } + } + } + + public void serializeTo(Object obj, String startElement, String namespace, int indentLevel, PrintWriter writer) { + if(startElement != null) { + adapter.beginElement(startElement, namespace, indentLevel, writer); + indentLevel++; + } + + if(obj instanceof XSerializable) { + ((XSerializable)obj).serializeTo(this, indentLevel, writer); + } else { + Class clz = obj.getClass(); + serializeTo(obj, clz, indentLevel, writer); + } + + if(startElement != null) { + indentLevel--; + adapter.endElement(startElement, indentLevel, writer); + } + } + + public String serializeTo(Object obj, String startElement, String namespace, int indentLevel) { + StringWriter writer = new StringWriter(); + serializeTo(obj, startElement, namespace, indentLevel, new PrintWriter(writer)); + return writer.toString(); + } + + private void serializeTo(Object obj, Class clz, int indentLevel, PrintWriter writer) { + if(clz.getSuperclass() != null) + serializeTo(obj, clz.getSuperclass(), indentLevel, writer); + + Field[] fields = clz.getDeclaredFields(); + for(int i = 0; i < fields.length; i++) { + Field f = fields[i]; + + if((f.getModifiers() & Modifier.STATIC) == 0) { + f.setAccessible(true); + + Class fieldType = f.getType(); + XElement elem = f.getAnnotation(XElement.class); + if(elem == null) + continue; + + Object fieldValue = null; + try { + fieldValue = f.get(obj); + } catch (IllegalArgumentException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + } catch (IllegalAccessException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + } + + adapter.writeElement(elem.name(), elem.item(), fieldValue, f, indentLevel, writer); + if(i < fields.length - 1) { + Field next = fields[i + 1]; + if((next.getModifiers() & Modifier.STATIC) == 0 && next.getAnnotation(XElement.class) != null) { + adapter.writeSeparator(indentLevel, writer); + } + } + } + } + } + + public boolean isComposite(Class clz) { + if(clz.isPrimitive() || clz.getSuperclass() == Number.class || + clz == String.class || clz == Date.class || clz == Calendar.class) { + return false; + } + return true; + } +} diff --git a/awsapi/src/com/cloud/bridge/util/XSerializerAdapter.java b/awsapi/src/com/cloud/bridge/util/XSerializerAdapter.java index 32fcff11f06..6672eb4aa5f 100644 --- a/awsapi/src/com/cloud/bridge/util/XSerializerAdapter.java +++ b/awsapi/src/com/cloud/bridge/util/XSerializerAdapter.java @@ -1,32 +1,48 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.PrintWriter; -import java.lang.reflect.Field; - -/** - * @author Kelven Yang - */ -public interface XSerializerAdapter { - void setSerializer(XSerializer serializer); - - void beginElement(String element, String namespace, int indentLevel, PrintWriter writer); - void endElement(String element, int indentLevel, PrintWriter writer); - - void writeElement(String elementName, String itemName, Object fieldValue, Field f, int indentLevel, PrintWriter writer); - void writeSeparator(int indentLevel, PrintWriter writer); -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.PrintWriter; +import java.lang.reflect.Field; + +/** + * @author Kelven Yang + */ +public interface XSerializerAdapter { + void setSerializer(XSerializer serializer); + + void beginElement(String element, String namespace, int indentLevel, PrintWriter writer); + void endElement(String element, int indentLevel, PrintWriter writer); + + void writeElement(String elementName, String itemName, Object fieldValue, Field f, int indentLevel, PrintWriter writer); + void writeSeparator(int indentLevel, PrintWriter writer); +} diff --git a/awsapi/src/com/cloud/bridge/util/XSerializerJsonAdapter.java b/awsapi/src/com/cloud/bridge/util/XSerializerJsonAdapter.java index 3f65dd6d1c5..ddafb0af17e 100644 --- a/awsapi/src/com/cloud/bridge/util/XSerializerJsonAdapter.java +++ b/awsapi/src/com/cloud/bridge/util/XSerializerJsonAdapter.java @@ -1,165 +1,181 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.PrintWriter; -import java.lang.reflect.Field; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; - -/** - * @author Kelven Yang - */ -public class XSerializerJsonAdapter implements XSerializerAdapter { - private XSerializer serializer; - - public XSerializerJsonAdapter() { - } - - @Override - public void setSerializer(XSerializer serializer) { - this.serializer = serializer; - } - - @Override - public void beginElement(String element, String namespace, int indentLevel, PrintWriter writer) { - indent(true, indentLevel, writer); - if(element != null && !element.isEmpty()) - writer.print(element + ": {"); - else - writer.print("{"); - } - - @Override - public void endElement(String element, int indentLevel, PrintWriter writer) { - indent(true, indentLevel, writer); - writer.print("}"); - } - - @Override - public void writeElement(String elementName, String itemName, Object value, Field f, int indentLevel, PrintWriter writer) { - Class fieldType = f.getType(); - if(!serializer.isComposite(fieldType)) { - if(fieldType == Date.class) { - if(value != null) { - indent(true, indentLevel, writer); - writer.print(elementName + ":\""); - writer.print(DateHelper.getGMTDateFormat("yyyy-MM-dd").format((Date)value) + "T" - + DateHelper.getGMTDateFormat("HH:mm:ss").format((Date)value) + ".000Z"); - writer.print("\""); - } else { - if(!serializer.omitNullField(f)) { - indent(true, indentLevel, writer); - writer.print(elementName + ":null"); - } - } - } else if(fieldType == Calendar.class) { - if(value != null) { - indent(true, indentLevel, writer); - - Date dt = ((Calendar)value).getTime(); - writer.print(elementName + ":\""); - writer.print(DateHelper.getGMTDateFormat("yyyy-MM-dd").format(dt) + "T" - + DateHelper.getGMTDateFormat("HH:mm:ss").format(dt) + ".000Z"); - writer.print("\""); - } else { - if(!serializer.omitNullField(f)) { - indent(true, indentLevel, writer); - writer.print(elementName + ":null"); - } - } - } else { - if(value != null) { - indent(true, indentLevel, writer); - writer.print(elementName + ":\""); - writer.print(value); - writer.print("\""); - } else { - if(!serializer.omitNullField(f)) { - indent(true, indentLevel, writer); - writer.print(elementName + ":null"); - } - } - } - } else if(fieldType.isArray()) { - if(value != null) { - indent(true, indentLevel, writer); - writer.print(elementName + ":["); - indentLevel++; - - Object[] array = (Object[])value; - - for(int i = 0; i < array.length; i++) { - serializer.serializeTo(array[i], "", null, indentLevel, writer); - - if(i < array.length - 1) - writeSeparator(indentLevel, writer); - } - - indentLevel--; - indent(true, indentLevel, writer); - writer.print("]"); - } else { - if(!serializer.omitNullField(f)) { - indent(true, indentLevel, writer); - writer.print(elementName + ":null"); - } - } - } else if (Collection.class.isAssignableFrom(fieldType)) { - if(value != null) { - indent(true, indentLevel, writer); - writer.print(elementName + ":["); - indentLevel++; - - Iterator it = ((Collection)value).iterator(); - if(it != null) { - while(it.hasNext()) { - Object sub = it.next(); - serializer.serializeTo(sub, "", null, indentLevel, writer); - - if(it.hasNext()) - writeSeparator(indentLevel, writer); - } - } - - indentLevel--; - indent(true, indentLevel, writer); - writer.print("]"); - } else { - if(!serializer.omitNullField(f)) { - indent(true, indentLevel, writer); - writer.print(elementName + ":null"); - } - } - } else { - serializer.serializeTo(value, elementName, null, indentLevel, writer); - } - } - - @Override - public void writeSeparator(int indentLevel, PrintWriter writer) { - writer.print(","); - } - - private void indent(boolean newLine, int indentLevel, PrintWriter writer) { - if(newLine) - writer.println(""); - for(int i = 0; i < indentLevel; i++) - writer.append(" "); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.PrintWriter; +import java.lang.reflect.Field; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; + +/** + * @author Kelven Yang + */ +public class XSerializerJsonAdapter implements XSerializerAdapter { + private XSerializer serializer; + + public XSerializerJsonAdapter() { + } + + @Override + public void setSerializer(XSerializer serializer) { + this.serializer = serializer; + } + + @Override + public void beginElement(String element, String namespace, int indentLevel, PrintWriter writer) { + indent(true, indentLevel, writer); + if(element != null && !element.isEmpty()) + writer.print(element + ": {"); + else + writer.print("{"); + } + + @Override + public void endElement(String element, int indentLevel, PrintWriter writer) { + indent(true, indentLevel, writer); + writer.print("}"); + } + + @Override + public void writeElement(String elementName, String itemName, Object value, Field f, int indentLevel, PrintWriter writer) { + Class fieldType = f.getType(); + if(!serializer.isComposite(fieldType)) { + if(fieldType == Date.class) { + if(value != null) { + indent(true, indentLevel, writer); + writer.print(elementName + ":\""); + writer.print(DateHelper.getGMTDateFormat("yyyy-MM-dd").format((Date)value) + "T" + + DateHelper.getGMTDateFormat("HH:mm:ss").format((Date)value) + ".000Z"); + writer.print("\""); + } else { + if(!serializer.omitNullField(f)) { + indent(true, indentLevel, writer); + writer.print(elementName + ":null"); + } + } + } else if(fieldType == Calendar.class) { + if(value != null) { + indent(true, indentLevel, writer); + + Date dt = ((Calendar)value).getTime(); + writer.print(elementName + ":\""); + writer.print(DateHelper.getGMTDateFormat("yyyy-MM-dd").format(dt) + "T" + + DateHelper.getGMTDateFormat("HH:mm:ss").format(dt) + ".000Z"); + writer.print("\""); + } else { + if(!serializer.omitNullField(f)) { + indent(true, indentLevel, writer); + writer.print(elementName + ":null"); + } + } + } else { + if(value != null) { + indent(true, indentLevel, writer); + writer.print(elementName + ":\""); + writer.print(value); + writer.print("\""); + } else { + if(!serializer.omitNullField(f)) { + indent(true, indentLevel, writer); + writer.print(elementName + ":null"); + } + } + } + } else if(fieldType.isArray()) { + if(value != null) { + indent(true, indentLevel, writer); + writer.print(elementName + ":["); + indentLevel++; + + Object[] array = (Object[])value; + + for(int i = 0; i < array.length; i++) { + serializer.serializeTo(array[i], "", null, indentLevel, writer); + + if(i < array.length - 1) + writeSeparator(indentLevel, writer); + } + + indentLevel--; + indent(true, indentLevel, writer); + writer.print("]"); + } else { + if(!serializer.omitNullField(f)) { + indent(true, indentLevel, writer); + writer.print(elementName + ":null"); + } + } + } else if (Collection.class.isAssignableFrom(fieldType)) { + if(value != null) { + indent(true, indentLevel, writer); + writer.print(elementName + ":["); + indentLevel++; + + Iterator it = ((Collection)value).iterator(); + if(it != null) { + while(it.hasNext()) { + Object sub = it.next(); + serializer.serializeTo(sub, "", null, indentLevel, writer); + + if(it.hasNext()) + writeSeparator(indentLevel, writer); + } + } + + indentLevel--; + indent(true, indentLevel, writer); + writer.print("]"); + } else { + if(!serializer.omitNullField(f)) { + indent(true, indentLevel, writer); + writer.print(elementName + ":null"); + } + } + } else { + serializer.serializeTo(value, elementName, null, indentLevel, writer); + } + } + + @Override + public void writeSeparator(int indentLevel, PrintWriter writer) { + writer.print(","); + } + + private void indent(boolean newLine, int indentLevel, PrintWriter writer) { + if(newLine) + writer.println(""); + for(int i = 0; i < indentLevel; i++) + writer.append(" "); + } +} diff --git a/awsapi/src/com/cloud/bridge/util/XSerializerXmlAdapter.java b/awsapi/src/com/cloud/bridge/util/XSerializerXmlAdapter.java index b879885f0c7..d02ee63fedb 100644 --- a/awsapi/src/com/cloud/bridge/util/XSerializerXmlAdapter.java +++ b/awsapi/src/com/cloud/bridge/util/XSerializerXmlAdapter.java @@ -1,173 +1,189 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.PrintWriter; -import java.lang.reflect.Field; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; - -/** - * @author Kelven - */ -public class XSerializerXmlAdapter implements XSerializerAdapter { - - private XSerializer serializer; - - public XSerializerXmlAdapter() { - } - - @Override - public void setSerializer(XSerializer serializer) { - this.serializer = serializer; - } - - @Override - public void beginElement(String element, String namespace, int indentLevel, PrintWriter writer) { - indent(true, indentLevel, writer); - writer.print("<" + element); - if(namespace != null && !namespace.isEmpty()) { - writer.print(" xmlns=\""); - writer.print(namespace); - writer.print("\""); - } - writer.print(">"); - } - - @Override - public void endElement(String element, int indentLevel, PrintWriter writer) { - indent(true, indentLevel, writer); - writer.print(""); - } - - @Override - public void writeElement(String elementName, String itemName, Object value, Field f, int indentLevel, PrintWriter writer) { - Class fieldType = f.getType(); - if(!serializer.isComposite(fieldType)) { - if(fieldType == Date.class) { - if(value != null) { - indent(true, indentLevel, writer); - writer.print("<" + elementName + ">"); - writer.print(DateHelper.getGMTDateFormat("yyyy-MM-dd").format((Date)value) + "T" - + DateHelper.getGMTDateFormat("HH:mm:ss").format((Date)value) + ".000Z"); - writer.print(""); - } else { - if(!serializer.omitNullField(f)) { - indent(true, indentLevel, writer); - writer.print("<" + elementName + "/>"); - } - } - } else if(fieldType == Calendar.class) { - if(value != null) { - indent(true, indentLevel, writer); - - Date dt = ((Calendar)value).getTime(); - writer.print("<" + elementName + ">"); - writer.print(DateHelper.getGMTDateFormat("yyyy-MM-dd").format(dt) + "T" - + DateHelper.getGMTDateFormat("HH:mm:ss").format(dt) + ".000Z"); - writer.print(""); - } else { - if(!serializer.omitNullField(f)) { - indent(true, indentLevel, writer); - writer.print("<" + elementName + "/>"); - } - } - } else { - if(value != null) { - indent(true, indentLevel, writer); - if(!value.toString().isEmpty()) { - writer.print("<" + elementName + ">"); - writer.print(value); - writer.print(""); - } else { - writer.print("<" + elementName + "/>"); - } - } else { - if(!serializer.omitNullField(f)) { - indent(true, indentLevel, writer); - writer.print("<" + elementName + "/>"); - } - } - } - } else if(fieldType.isArray()) { - if(value != null) { - if(!serializer.flattenField(f)) { - indent(true, indentLevel, writer); - writer.print("<" + elementName + ">"); - indentLevel++; - } - - for(Object sub : (Object[])value) { - serializer.serializeTo(sub, itemName, null, indentLevel, writer); - } - - if(!serializer.flattenField(f)) { - indentLevel--; - indent(true, indentLevel, writer); - writer.print(""); - } - } else { - if(!serializer.omitNullField(f)) { - indent(true, indentLevel, writer); - writer.print("<" + elementName + "/>"); - } - } - } else if(Collection.class.isAssignableFrom(fieldType)) { - if(value != null) { - if(!serializer.flattenField(f)) { - indent(true, indentLevel, writer); - writer.print("<" + elementName + ">"); - indentLevel++; - } - - Iterator it = ((Collection)value).iterator(); - if(it != null) { - while(it.hasNext()) { - Object sub = it.next(); - serializer.serializeTo(sub, itemName, null, indentLevel, writer); - } - } - - if(!serializer.flattenField(f)) { - indentLevel--; - indent(true, indentLevel, writer); - writer.print(""); - } - } else { - if(!serializer.omitNullField(f)) { - indent(true, indentLevel, writer); - writer.print("<" + elementName + "/>"); - } - } - } else { - serializer.serializeTo(value, elementName, null, indentLevel, writer); - } - } - - @Override - public void writeSeparator(int indentLevel, PrintWriter writer) { - // do nothing - } - - private void indent(boolean newLine, int indentLevel, PrintWriter writer) { - if(newLine) - writer.println(""); - for(int i = 0; i < indentLevel; i++) - writer.append(" "); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.PrintWriter; +import java.lang.reflect.Field; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; + +/** + * @author Kelven + */ +public class XSerializerXmlAdapter implements XSerializerAdapter { + + private XSerializer serializer; + + public XSerializerXmlAdapter() { + } + + @Override + public void setSerializer(XSerializer serializer) { + this.serializer = serializer; + } + + @Override + public void beginElement(String element, String namespace, int indentLevel, PrintWriter writer) { + indent(true, indentLevel, writer); + writer.print("<" + element); + if(namespace != null && !namespace.isEmpty()) { + writer.print(" xmlns=\""); + writer.print(namespace); + writer.print("\""); + } + writer.print(">"); + } + + @Override + public void endElement(String element, int indentLevel, PrintWriter writer) { + indent(true, indentLevel, writer); + writer.print(""); + } + + @Override + public void writeElement(String elementName, String itemName, Object value, Field f, int indentLevel, PrintWriter writer) { + Class fieldType = f.getType(); + if(!serializer.isComposite(fieldType)) { + if(fieldType == Date.class) { + if(value != null) { + indent(true, indentLevel, writer); + writer.print("<" + elementName + ">"); + writer.print(DateHelper.getGMTDateFormat("yyyy-MM-dd").format((Date)value) + "T" + + DateHelper.getGMTDateFormat("HH:mm:ss").format((Date)value) + ".000Z"); + writer.print(""); + } else { + if(!serializer.omitNullField(f)) { + indent(true, indentLevel, writer); + writer.print("<" + elementName + "/>"); + } + } + } else if(fieldType == Calendar.class) { + if(value != null) { + indent(true, indentLevel, writer); + + Date dt = ((Calendar)value).getTime(); + writer.print("<" + elementName + ">"); + writer.print(DateHelper.getGMTDateFormat("yyyy-MM-dd").format(dt) + "T" + + DateHelper.getGMTDateFormat("HH:mm:ss").format(dt) + ".000Z"); + writer.print(""); + } else { + if(!serializer.omitNullField(f)) { + indent(true, indentLevel, writer); + writer.print("<" + elementName + "/>"); + } + } + } else { + if(value != null) { + indent(true, indentLevel, writer); + if(!value.toString().isEmpty()) { + writer.print("<" + elementName + ">"); + writer.print(value); + writer.print(""); + } else { + writer.print("<" + elementName + "/>"); + } + } else { + if(!serializer.omitNullField(f)) { + indent(true, indentLevel, writer); + writer.print("<" + elementName + "/>"); + } + } + } + } else if(fieldType.isArray()) { + if(value != null) { + if(!serializer.flattenField(f)) { + indent(true, indentLevel, writer); + writer.print("<" + elementName + ">"); + indentLevel++; + } + + for(Object sub : (Object[])value) { + serializer.serializeTo(sub, itemName, null, indentLevel, writer); + } + + if(!serializer.flattenField(f)) { + indentLevel--; + indent(true, indentLevel, writer); + writer.print(""); + } + } else { + if(!serializer.omitNullField(f)) { + indent(true, indentLevel, writer); + writer.print("<" + elementName + "/>"); + } + } + } else if(Collection.class.isAssignableFrom(fieldType)) { + if(value != null) { + if(!serializer.flattenField(f)) { + indent(true, indentLevel, writer); + writer.print("<" + elementName + ">"); + indentLevel++; + } + + Iterator it = ((Collection)value).iterator(); + if(it != null) { + while(it.hasNext()) { + Object sub = it.next(); + serializer.serializeTo(sub, itemName, null, indentLevel, writer); + } + } + + if(!serializer.flattenField(f)) { + indentLevel--; + indent(true, indentLevel, writer); + writer.print(""); + } + } else { + if(!serializer.omitNullField(f)) { + indent(true, indentLevel, writer); + writer.print("<" + elementName + "/>"); + } + } + } else { + serializer.serializeTo(value, elementName, null, indentLevel, writer); + } + } + + @Override + public void writeSeparator(int indentLevel, PrintWriter writer) { + // do nothing + } + + private void indent(boolean newLine, int indentLevel, PrintWriter writer) { + if(newLine) + writer.println(""); + for(int i = 0; i < indentLevel; i++) + writer.append(" "); + } +} diff --git a/awsapi/src/com/cloud/bridge/util/XmlHelper.java b/awsapi/src/com/cloud/bridge/util/XmlHelper.java index f22ee03d4c5..1d02101c700 100644 --- a/awsapi/src/com/cloud/bridge/util/XmlHelper.java +++ b/awsapi/src/com/cloud/bridge/util/XmlHelper.java @@ -1,175 +1,191 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.bridge.util; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; -import java.util.Properties; - -import org.apache.log4j.Logger; -import org.w3c.dom.Document; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -/** - * @author Kelven Yang - */ -public class XmlHelper { - protected static Logger logger = Logger.getLogger(XmlHelper.class); - - public static Document parse(String xmlContent) throws IOException { - ByteArrayInputStream is = new ByteArrayInputStream(xmlContent.getBytes("UTF-8")); - return parse(is); - } - - public static Document parse(File file) throws IOException { - try { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setCoalescing(true); - factory.setIgnoringComments(true); - factory.setIgnoringElementContentWhitespace(true); - factory.setNamespaceAware(true); - DocumentBuilder parser = factory.newDocumentBuilder(); - return parser.parse(file); - } catch (ParserConfigurationException e) { - throw new IOException(e); - } catch (SAXException e) { - throw new IOException(e); - } - } - - public static Document parse(InputStream is) throws IOException { - try { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setCoalescing(true); - factory.setIgnoringComments(true); - factory.setIgnoringElementContentWhitespace(true); - factory.setNamespaceAware(true); - DocumentBuilder parser = factory.newDocumentBuilder(); - InputSource in = new InputSource(is); - return parser.parse(in); - } catch (ParserConfigurationException e) { - throw new IOException(e); - } catch (SAXException e) { - throw new IOException(e); - } - } - - public static Document newDocument() { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - DocumentBuilder builder; - try { - builder = dbf.newDocumentBuilder(); - Document document = builder.newDocument(); - return document; - } catch (ParserConfigurationException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - } - - return null; - } - - public static Node getRootNode(Document doc) { - NodeList l = doc.getChildNodes(); - if(l != null && l.getLength() == 1) - return l.item(0); - - return null; - } - - public static Node getChildNode(Node parentNode, String childElementName) { - NodeList l = parentNode.getChildNodes(); - for(int i = 0; i < l.getLength(); i++) { - Node node = l.item(i); - if(node.getNodeName().equals(childElementName)) - return node; - } - return null; - } - - public static String getChildNodeTextContent(Node parentNode, String childElementName) { - Node node = getChildNode(parentNode, childElementName); - if(node != null) - return node.getTextContent(); - return null; - } - - public static String getAttribute(Node node, String name) { - NamedNodeMap attributes = node.getAttributes(); - Node attrNode = attributes.getNamedItem(name); - if(attrNode != null) - return attrNode.getNodeValue(); - return null; - } - - public static String toXML(Node node) { - if (node != null) { - Transformer transformer = newTransformer(); - try { - StringWriter sw = new StringWriter(); - transformer.transform(new DOMSource(node), new StreamResult(sw)); - return sw.toString(); - } catch (TransformerException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - } - } - return StringHelper.EMPTY_STRING; - } - - public static Transformer newTransformer() { - return newTransformer("UTF-8", false); - } - - public static Transformer newTransformer(String encoding, boolean indent) { - try { - Transformer transformer = TransformerFactory.newInstance() - .newTransformer(); - Properties properties = transformer.getOutputProperties(); - - properties.setProperty(OutputKeys.ENCODING, encoding); - properties.setProperty(OutputKeys.METHOD, "XML"); - properties.setProperty(OutputKeys.VERSION, "1.0"); - if(indent) - properties.setProperty(OutputKeys.INDENT, "YES"); - else - properties.setProperty(OutputKeys.INDENT, "NO"); - transformer.setOutputProperties(properties); - return transformer; - } catch (TransformerConfigurationException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - } - - return null; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.bridge.util; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.util.Properties; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +/** + * @author Kelven Yang + */ +public class XmlHelper { + protected static Logger logger = Logger.getLogger(XmlHelper.class); + + public static Document parse(String xmlContent) throws IOException { + ByteArrayInputStream is = new ByteArrayInputStream(xmlContent.getBytes("UTF-8")); + return parse(is); + } + + public static Document parse(File file) throws IOException { + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setCoalescing(true); + factory.setIgnoringComments(true); + factory.setIgnoringElementContentWhitespace(true); + factory.setNamespaceAware(true); + DocumentBuilder parser = factory.newDocumentBuilder(); + return parser.parse(file); + } catch (ParserConfigurationException e) { + throw new IOException(e); + } catch (SAXException e) { + throw new IOException(e); + } + } + + public static Document parse(InputStream is) throws IOException { + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setCoalescing(true); + factory.setIgnoringComments(true); + factory.setIgnoringElementContentWhitespace(true); + factory.setNamespaceAware(true); + DocumentBuilder parser = factory.newDocumentBuilder(); + InputSource in = new InputSource(is); + return parser.parse(in); + } catch (ParserConfigurationException e) { + throw new IOException(e); + } catch (SAXException e) { + throw new IOException(e); + } + } + + public static Document newDocument() { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder builder; + try { + builder = dbf.newDocumentBuilder(); + Document document = builder.newDocument(); + return document; + } catch (ParserConfigurationException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + } + + return null; + } + + public static Node getRootNode(Document doc) { + NodeList l = doc.getChildNodes(); + if(l != null && l.getLength() == 1) + return l.item(0); + + return null; + } + + public static Node getChildNode(Node parentNode, String childElementName) { + NodeList l = parentNode.getChildNodes(); + for(int i = 0; i < l.getLength(); i++) { + Node node = l.item(i); + if(node.getNodeName().equals(childElementName)) + return node; + } + return null; + } + + public static String getChildNodeTextContent(Node parentNode, String childElementName) { + Node node = getChildNode(parentNode, childElementName); + if(node != null) + return node.getTextContent(); + return null; + } + + public static String getAttribute(Node node, String name) { + NamedNodeMap attributes = node.getAttributes(); + Node attrNode = attributes.getNamedItem(name); + if(attrNode != null) + return attrNode.getNodeValue(); + return null; + } + + public static String toXML(Node node) { + if (node != null) { + Transformer transformer = newTransformer(); + try { + StringWriter sw = new StringWriter(); + transformer.transform(new DOMSource(node), new StreamResult(sw)); + return sw.toString(); + } catch (TransformerException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + } + } + return StringHelper.EMPTY_STRING; + } + + public static Transformer newTransformer() { + return newTransformer("UTF-8", false); + } + + public static Transformer newTransformer(String encoding, boolean indent) { + try { + Transformer transformer = TransformerFactory.newInstance() + .newTransformer(); + Properties properties = transformer.getOutputProperties(); + + properties.setProperty(OutputKeys.ENCODING, encoding); + properties.setProperty(OutputKeys.METHOD, "XML"); + properties.setProperty(OutputKeys.VERSION, "1.0"); + if(indent) + properties.setProperty(OutputKeys.INDENT, "YES"); + else + properties.setProperty(OutputKeys.INDENT, "NO"); + transformer.setOutputProperties(properties); + return transformer; + } catch (TransformerConfigurationException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + } + + return null; + } +} diff --git a/awsapi/src/com/cloud/stack/CloudStackApi.java b/awsapi/src/com/cloud/stack/CloudStackApi.java index e1ad5824070..095a29a009e 100644 --- a/awsapi/src/com/cloud/stack/CloudStackApi.java +++ b/awsapi/src/com/cloud/stack/CloudStackApi.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/CloudStackClient.java b/awsapi/src/com/cloud/stack/CloudStackClient.java index ed04737a2ad..a4c7c6331c2 100644 --- a/awsapi/src/com/cloud/stack/CloudStackClient.java +++ b/awsapi/src/com/cloud/stack/CloudStackClient.java @@ -1,197 +1,213 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.lang.reflect.Type; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLConnection; -import java.util.List; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.util.JsonAccessor; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; - -/** - * CloudStackClient implements a simple CloudStack client object, it can be used to execute CloudStack commands - * with JSON response - * - * @author Kelven Yang - */ -public class CloudStackClient { - protected final static Logger logger = Logger.getLogger(CloudStackClient.class); - - private String _serviceUrl; - - private long _pollIntervalMs = 2000; // 1 second polling interval - private long _pollTimeoutMs = 600000; // 10 minutes polling timeout - - public CloudStackClient(String serviceRootUrl) { - assert(serviceRootUrl != null); - - if(!serviceRootUrl.endsWith("/")) - _serviceUrl = serviceRootUrl + "/api?"; - else - _serviceUrl = serviceRootUrl + "api?"; - } - - public CloudStackClient(String cloudStackServiceHost, int port, boolean bSslEnabled) { - StringBuffer sb = new StringBuffer(); - if(!bSslEnabled) { - sb.append("http://" + cloudStackServiceHost); - if(port != 80) - sb.append(":").append(port); - } else { - sb.append("https://" + cloudStackServiceHost); - if(port != 443) - sb.append(":").append(port); - } - - // - // If the CloudStack root context path has been from /client to some other name - // use the first constructor instead - // - sb.append("/client/api"); - sb.append("?"); - _serviceUrl = sb.toString(); - } - - public CloudStackClient setPollInterval(long intervalMs) { - _pollIntervalMs = intervalMs; - return this; - } - - public CloudStackClient setPollTimeout(long pollTimeoutMs) { - _pollTimeoutMs = pollTimeoutMs; - return this; - } - - public T call(CloudStackCommand cmd, String apiKey, String secretKey, boolean followToAsyncResult, - String responseName, String responseObjName, Class responseClz) throws Exception { - - assert(responseName != null); - - JsonAccessor json = execute(cmd, apiKey, secretKey); - if(followToAsyncResult && json.tryEval(responseName + ".jobid") != null) { - long startMs = System.currentTimeMillis(); - while(System.currentTimeMillis() - startMs < _pollTimeoutMs) { - CloudStackCommand queryJobCmd = new CloudStackCommand("queryAsyncJobResult"); - queryJobCmd.setParam("jobId", json.getAsString(responseName + ".jobid")); - - JsonAccessor queryAsyncJobResponse = execute(queryJobCmd, apiKey, secretKey); - - if(queryAsyncJobResponse.tryEval("queryasyncjobresultresponse") != null) { - int jobStatus = queryAsyncJobResponse.getAsInt("queryasyncjobresultresponse.jobstatus"); - switch(jobStatus) { - case 2: - throw new Exception(queryAsyncJobResponse.getAsString("queryasyncjobresultresponse.jobresult.errorcode") + " " + - queryAsyncJobResponse.getAsString("queryasyncjobresultresponse.jobresult.errortext")); - - case 0 : - try { - Thread.sleep( _pollIntervalMs ); - } catch( Exception e ) {} - break; - - case 1 : - if(responseObjName != null) - return (T)(new Gson()).fromJson(queryAsyncJobResponse.eval("queryasyncjobresultresponse.jobresult." + responseObjName), responseClz); - else - return (T)(new Gson()).fromJson(queryAsyncJobResponse.eval("queryasyncjobresultresponse.jobresult"), responseClz); - - default : - assert(false); - throw new Exception("Operation failed - invalid job status response"); - } - } else { - throw new Exception("Operation failed - invalid JSON response"); - } - } - - throw new Exception("Operation failed - async-job query timed out"); - } else { - if (responseObjName != null) - return (T)(new Gson()).fromJson(json.eval(responseName + "." + responseObjName), responseClz); - else - return (T)(new Gson()).fromJson(json.eval(responseName), responseClz); - } - } - - // collectionType example : new TypeToken>() {}.getType(); - public List listCall(CloudStackCommand cmd, String apiKey, String secretKey, - String responseName, String responseObjName, Type collectionType) throws Exception { - - assert(responseName != null); - - JsonAccessor json = execute(cmd, apiKey, secretKey); - - - - if(responseObjName != null) - try { - return (new Gson()).fromJson(json.eval(responseName + "." + responseObjName), collectionType); - } catch(Exception e) { - // this happens because responseObjName won't exist if there are no objects in the list. - logger.debug("Unable to find responseObjName:[" + responseObjName + "]. Returning null! Exception: " + e.getMessage()); - return null; - } - return (new Gson()).fromJson(json.eval(responseName), collectionType); - } - - public JsonAccessor execute(CloudStackCommand cmd, String apiKey, String secretKey) throws Exception { - JsonParser parser = new JsonParser(); - URL url = new URL(_serviceUrl + cmd.signCommand(apiKey, secretKey)); - - if(logger.isDebugEnabled()) - logger.debug("Cloud API call + [" + url.toString() + "]"); - - URLConnection connect = url.openConnection(); - - int statusCode; - statusCode = ((HttpURLConnection)connect).getResponseCode(); - if(statusCode >= 400) { - logger.error("Cloud API call + [" + url.toString() + "] failed with status code: " + statusCode); - String errorMessage = ((HttpURLConnection)connect).getResponseMessage(); - if(errorMessage == null){ - errorMessage = connect.getHeaderField("X-Description"); - } - - if(errorMessage == null){ - errorMessage = "CloudStack API call HTTP response error, HTTP status code: " + statusCode; - } - - throw new IOException(errorMessage); - } - - InputStream inputStream = connect.getInputStream(); - JsonElement jsonElement = parser.parse(new InputStreamReader(inputStream)); - if(jsonElement == null) { - logger.error("Cloud API call + [" + url.toString() + "] failed: unable to parse expected JSON response"); - - throw new IOException("CloudStack API call error : invalid JSON response"); - } - - if(logger.isDebugEnabled()) - logger.debug("Cloud API call + [" + url.toString() + "] returned: " + jsonElement.toString()); - return new JsonAccessor(jsonElement); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLConnection; +import java.util.List; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.util.JsonAccessor; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; + +/** + * CloudStackClient implements a simple CloudStack client object, it can be used to execute CloudStack commands + * with JSON response + * + * @author Kelven Yang + */ +public class CloudStackClient { + protected final static Logger logger = Logger.getLogger(CloudStackClient.class); + + private String _serviceUrl; + + private long _pollIntervalMs = 2000; // 1 second polling interval + private long _pollTimeoutMs = 600000; // 10 minutes polling timeout + + public CloudStackClient(String serviceRootUrl) { + assert(serviceRootUrl != null); + + if(!serviceRootUrl.endsWith("/")) + _serviceUrl = serviceRootUrl + "/api?"; + else + _serviceUrl = serviceRootUrl + "api?"; + } + + public CloudStackClient(String cloudStackServiceHost, int port, boolean bSslEnabled) { + StringBuffer sb = new StringBuffer(); + if(!bSslEnabled) { + sb.append("http://" + cloudStackServiceHost); + if(port != 80) + sb.append(":").append(port); + } else { + sb.append("https://" + cloudStackServiceHost); + if(port != 443) + sb.append(":").append(port); + } + + // + // If the CloudStack root context path has been from /client to some other name + // use the first constructor instead + // + sb.append("/client/api"); + sb.append("?"); + _serviceUrl = sb.toString(); + } + + public CloudStackClient setPollInterval(long intervalMs) { + _pollIntervalMs = intervalMs; + return this; + } + + public CloudStackClient setPollTimeout(long pollTimeoutMs) { + _pollTimeoutMs = pollTimeoutMs; + return this; + } + + public T call(CloudStackCommand cmd, String apiKey, String secretKey, boolean followToAsyncResult, + String responseName, String responseObjName, Class responseClz) throws Exception { + + assert(responseName != null); + + JsonAccessor json = execute(cmd, apiKey, secretKey); + if(followToAsyncResult && json.tryEval(responseName + ".jobid") != null) { + long startMs = System.currentTimeMillis(); + while(System.currentTimeMillis() - startMs < _pollTimeoutMs) { + CloudStackCommand queryJobCmd = new CloudStackCommand("queryAsyncJobResult"); + queryJobCmd.setParam("jobId", json.getAsString(responseName + ".jobid")); + + JsonAccessor queryAsyncJobResponse = execute(queryJobCmd, apiKey, secretKey); + + if(queryAsyncJobResponse.tryEval("queryasyncjobresultresponse") != null) { + int jobStatus = queryAsyncJobResponse.getAsInt("queryasyncjobresultresponse.jobstatus"); + switch(jobStatus) { + case 2: + throw new Exception(queryAsyncJobResponse.getAsString("queryasyncjobresultresponse.jobresult.errorcode") + " " + + queryAsyncJobResponse.getAsString("queryasyncjobresultresponse.jobresult.errortext")); + + case 0 : + try { + Thread.sleep( _pollIntervalMs ); + } catch( Exception e ) {} + break; + + case 1 : + if(responseObjName != null) + return (T)(new Gson()).fromJson(queryAsyncJobResponse.eval("queryasyncjobresultresponse.jobresult." + responseObjName), responseClz); + else + return (T)(new Gson()).fromJson(queryAsyncJobResponse.eval("queryasyncjobresultresponse.jobresult"), responseClz); + + default : + assert(false); + throw new Exception("Operation failed - invalid job status response"); + } + } else { + throw new Exception("Operation failed - invalid JSON response"); + } + } + + throw new Exception("Operation failed - async-job query timed out"); + } else { + if (responseObjName != null) + return (T)(new Gson()).fromJson(json.eval(responseName + "." + responseObjName), responseClz); + else + return (T)(new Gson()).fromJson(json.eval(responseName), responseClz); + } + } + + // collectionType example : new TypeToken>() {}.getType(); + public List listCall(CloudStackCommand cmd, String apiKey, String secretKey, + String responseName, String responseObjName, Type collectionType) throws Exception { + + assert(responseName != null); + + JsonAccessor json = execute(cmd, apiKey, secretKey); + + + + if(responseObjName != null) + try { + return (new Gson()).fromJson(json.eval(responseName + "." + responseObjName), collectionType); + } catch(Exception e) { + // this happens because responseObjName won't exist if there are no objects in the list. + logger.debug("Unable to find responseObjName:[" + responseObjName + "]. Returning null! Exception: " + e.getMessage()); + return null; + } + return (new Gson()).fromJson(json.eval(responseName), collectionType); + } + + public JsonAccessor execute(CloudStackCommand cmd, String apiKey, String secretKey) throws Exception { + JsonParser parser = new JsonParser(); + URL url = new URL(_serviceUrl + cmd.signCommand(apiKey, secretKey)); + + if(logger.isDebugEnabled()) + logger.debug("Cloud API call + [" + url.toString() + "]"); + + URLConnection connect = url.openConnection(); + + int statusCode; + statusCode = ((HttpURLConnection)connect).getResponseCode(); + if(statusCode >= 400) { + logger.error("Cloud API call + [" + url.toString() + "] failed with status code: " + statusCode); + String errorMessage = ((HttpURLConnection)connect).getResponseMessage(); + if(errorMessage == null){ + errorMessage = connect.getHeaderField("X-Description"); + } + + if(errorMessage == null){ + errorMessage = "CloudStack API call HTTP response error, HTTP status code: " + statusCode; + } + + throw new IOException(errorMessage); + } + + InputStream inputStream = connect.getInputStream(); + JsonElement jsonElement = parser.parse(new InputStreamReader(inputStream)); + if(jsonElement == null) { + logger.error("Cloud API call + [" + url.toString() + "] failed: unable to parse expected JSON response"); + + throw new IOException("CloudStack API call error : invalid JSON response"); + } + + if(logger.isDebugEnabled()) + logger.debug("Cloud API call + [" + url.toString() + "] returned: " + jsonElement.toString()); + return new JsonAccessor(jsonElement); + } +} diff --git a/awsapi/src/com/cloud/stack/CloudStackCommand.java b/awsapi/src/com/cloud/stack/CloudStackCommand.java index 043b1bcddd0..492ea950fdd 100644 --- a/awsapi/src/com/cloud/stack/CloudStackCommand.java +++ b/awsapi/src/com/cloud/stack/CloudStackCommand.java @@ -1,149 +1,165 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.security.SignatureException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; - -import org.apache.commons.codec.binary.Base64; - -/** - * CloudStackCommand wraps command properties that are being sent to CloudStack - * - * @author Kelven Yang - */ -public class CloudStackCommand { - Map _params = new HashMap(); - - public CloudStackCommand(String cmdName) { - this(cmdName, "json"); - } - - public CloudStackCommand(String cmdName, String responseType) { - _params.put("command", cmdName); - if(responseType != null) - _params.put("response", responseType); - } - - public CloudStackCommand setParam(String paramName, String paramValue) { - assert(paramName != null); - assert(paramValue != null); - - _params.put(paramName, paramValue); - return this; - } - - public String signCommand(String apiKey, String secretKey) throws SignatureException { - assert(_params.get("command") != null); - - List paramNames = new ArrayList(); - for(String paramName : _params.keySet()) - paramNames.add(paramName); - - paramNames.add("apikey"); - Collections.sort(paramNames); - - StringBuffer sb = new StringBuffer(); - for(String name : paramNames) { - String value; - if("apikey".equals(name)) - value = apiKey; - else - value = _params.get(name); - - assert(value != null); - - value = urlSafe(value); - - if(sb.length() == 0) { - sb.append(name).append("=").append(value); - } else { - sb.append("&").append(name).append("=").append(value); - } - } - - String signature = calculateRFC2104HMAC(sb.toString().toLowerCase(), secretKey); - return composeQueryString(apiKey, signature); - } - - private String composeQueryString(String apiKey, String signature) { - StringBuffer sb = new StringBuffer(); - String name; - String value; - - // treat command specially (although not really necessary ) - name = "command"; - value = _params.get(name); - if(value != null) { - value = urlSafe(value); - sb.append(name).append("=").append(value); - } - - for(Map.Entry entry : _params.entrySet()) { - name = entry.getKey(); - - if(!"command".equals(name)) { - value = urlSafe(entry.getValue()); - - if(sb.length() == 0) - sb.append(name).append("=").append(value); - else - sb.append("&").append(name).append("=").append(value); - } - } - - sb.append("&apikey=").append(urlSafe(apiKey)); - sb.append("&signature=").append(urlSafe(signature)); - - return sb.toString(); - } - - private String calculateRFC2104HMAC( String signIt, String secretKey ) throws SignatureException { - String result = null; - try { - SecretKeySpec key = new SecretKeySpec( secretKey.getBytes(), "HmacSHA1" ); - Mac hmacSha1 = Mac.getInstance( "HmacSHA1" ); - hmacSha1.init( key ); - byte [] rawHmac = hmacSha1.doFinal( signIt.getBytes()); - result = new String( Base64.encodeBase64( rawHmac )); - } catch( Exception e ) { - throw new SignatureException( "Failed to generate keyed HMAC on soap request: " + e.getMessage()); - } - return result.trim(); - } - - private String urlSafe(String value) { - try { - if (value != null) - return URLEncoder.encode(value, "UTF-8").replaceAll("\\+", "%20"); - else - return null; - } catch (UnsupportedEncodingException e) { - assert(false); - } - - return value; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.security.SignatureException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.commons.codec.binary.Base64; + +/** + * CloudStackCommand wraps command properties that are being sent to CloudStack + * + * @author Kelven Yang + */ +public class CloudStackCommand { + Map _params = new HashMap(); + + public CloudStackCommand(String cmdName) { + this(cmdName, "json"); + } + + public CloudStackCommand(String cmdName, String responseType) { + _params.put("command", cmdName); + if(responseType != null) + _params.put("response", responseType); + } + + public CloudStackCommand setParam(String paramName, String paramValue) { + assert(paramName != null); + assert(paramValue != null); + + _params.put(paramName, paramValue); + return this; + } + + public String signCommand(String apiKey, String secretKey) throws SignatureException { + assert(_params.get("command") != null); + + List paramNames = new ArrayList(); + for(String paramName : _params.keySet()) + paramNames.add(paramName); + + paramNames.add("apikey"); + Collections.sort(paramNames); + + StringBuffer sb = new StringBuffer(); + for(String name : paramNames) { + String value; + if("apikey".equals(name)) + value = apiKey; + else + value = _params.get(name); + + assert(value != null); + + value = urlSafe(value); + + if(sb.length() == 0) { + sb.append(name).append("=").append(value); + } else { + sb.append("&").append(name).append("=").append(value); + } + } + + String signature = calculateRFC2104HMAC(sb.toString().toLowerCase(), secretKey); + return composeQueryString(apiKey, signature); + } + + private String composeQueryString(String apiKey, String signature) { + StringBuffer sb = new StringBuffer(); + String name; + String value; + + // treat command specially (although not really necessary ) + name = "command"; + value = _params.get(name); + if(value != null) { + value = urlSafe(value); + sb.append(name).append("=").append(value); + } + + for(Map.Entry entry : _params.entrySet()) { + name = entry.getKey(); + + if(!"command".equals(name)) { + value = urlSafe(entry.getValue()); + + if(sb.length() == 0) + sb.append(name).append("=").append(value); + else + sb.append("&").append(name).append("=").append(value); + } + } + + sb.append("&apikey=").append(urlSafe(apiKey)); + sb.append("&signature=").append(urlSafe(signature)); + + return sb.toString(); + } + + private String calculateRFC2104HMAC( String signIt, String secretKey ) throws SignatureException { + String result = null; + try { + SecretKeySpec key = new SecretKeySpec( secretKey.getBytes(), "HmacSHA1" ); + Mac hmacSha1 = Mac.getInstance( "HmacSHA1" ); + hmacSha1.init( key ); + byte [] rawHmac = hmacSha1.doFinal( signIt.getBytes()); + result = new String( Base64.encodeBase64( rawHmac )); + } catch( Exception e ) { + throw new SignatureException( "Failed to generate keyed HMAC on soap request: " + e.getMessage()); + } + return result.trim(); + } + + private String urlSafe(String value) { + try { + if (value != null) + return URLEncoder.encode(value, "UTF-8").replaceAll("\\+", "%20"); + else + return null; + } catch (UnsupportedEncodingException e) { + assert(false); + } + + return value; + } +} diff --git a/awsapi/src/com/cloud/stack/models/ApiConstants.java b/awsapi/src/com/cloud/stack/models/ApiConstants.java index 4868160a575..6a6df712a09 100644 --- a/awsapi/src/com/cloud/stack/models/ApiConstants.java +++ b/awsapi/src/com/cloud/stack/models/ApiConstants.java @@ -1,506 +1,522 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -public class ApiConstants { - public static final String ACCOUNT = "account"; - public static final String ACCOUNT_ID = "accountid"; - public static final String ACCOUNT_TYPE = "accounttype"; - public static final String ACCOUNTS = "accounts"; - public static final String ALGORITHM = "algorithm"; - public static final String ALLOCATED = "allocated"; - public static final String ALLOCATED_ONLY = "allocatedonly"; - public static final String ALLOCATION_STATE = "allocationstate"; - public static final String API_KEY = "apikey"; - public static final String APPLIED = "applied"; - public static final String ASSIGN_TO_LOAD_BALANCER_RULE = "assignToLoadBalancerRule"; - public static final String ASSIGN_TO_LOAD_BALANCER_RULE_RESPONSE = "assigntoloadbalancerruleresponse"; - public static final String ASSOCIATE_IP_ADDRESS = "associateIpAddress"; - public static final String ASSOCIATE_IP_ADDRESS_RESPONSE = "associateipaddressresponse"; - public static final String ASSOCIATED_NETWORK_ID = "associatednetworkid"; - public static final String ATTACH_ISO = "attachIso"; - public static final String ATTACH_ISO_RESPONSE = "attachisoresponse"; - public static final String ATTACH_VOLUME = "attachVolume"; - public static final String ATTACH_VOLUME_RESPONSE = "attachvolumeresponse"; - public static final String ATTACHED = "attached"; - public static final String AUTHORIZE_SECURITY_GROUP_INGRESS = "authorizeSecurityGroupIngress"; - public static final String AUTHORIZE_SECURITY_GROUP_INGRESS_RESPONSE = "authorizesecuritygroupingressresponse"; - public static final String AVAILABILITY = "availability"; - public static final String AVAILABLE = "available"; - public static final String BITS = "bits"; - public static final String BOOTABLE = "bootable"; - public static final String BROADCAST_DOMAIN_TYPE = "broadcastdomaintype"; - public static final String BROADCAST_URI = "broadcasturi"; - public static final String CAPABILITY = "capability"; - public static final String CATEGORY = "category"; - public static final String CERTIFICATE = "certificate"; - public static final String CHANGE_SERVICE_FOR_VIRTUAL_MACHINE = "changeServiceForVirtualMachine"; - public static final String CHANGE_SERVICE_FOR_VIRTUAL_MACHINE_RESPONSE = "changeserviceforvirtualmachineresponse"; - public static final String CHECKSUM="checksum"; - public static final String CIDR = "cidr"; - public static final String CIDR_LIST = "cidrlist"; - public static final String CLEANUP = "cleanup"; - public static final String CLOUD_IDENTIFIER = "cloudidentifier"; - public static final String CLOUD_STACK_VERSION = "cloudstackversion"; - public static final String CLUSTER_ID = "clusterid"; - public static final String CLUSTER_NAME = "clustername"; - public static final String CLUSTER_TYPE = "clustertype"; - public static final String COMPONENT = "component"; - public static final String COPY_ISO = "copyIso"; - public static final String COPY_ISO_RESPONSE = "copyisoresponse"; - public static final String COPY_TEMPLATE = "copyTemplate"; - public static final String COPY_TEMPLATE_RESPONSE = "copytemplateresponse"; - public static final String CPU_NUMBER = "cpunumber"; - public static final String CPU_SPEED = "cpuspeed"; - public static final String CPU_USED = "cpuused"; - public static final String CREATE_INSTANCE_GROUP = "createInstanceGroup"; - public static final String CREATE_INSTANCE_GROUP_RESPONSE = "createinstancegroupresponse"; - public static final String CREATE_IP_FORWARDING_RULE = "createIpForwardingRule"; - public static final String CREATE_IP_FORWARDING_RULE_RESPONSE = "createipforwardingruleresponse"; - public static final String CREATE_LOAD_BALANCER_RULE = "createLoadBalancerRule"; - public static final String CREATE_LOAD_BALANCER_RULE_RESPONSE = "createloadbalancerruleresponse"; - public static final String CREATE_NETWORK = "createNetwork"; - public static final String CREATE_NETWORK_RESPONSE = "createnetworkresponse"; - public static final String CREATE_PORT_FORWARDING_RULE = "createPortForwardingRule"; - public static final String CREATE_PORT_FORWARDING_RULE_RESPONSE = "createportforwardingruleresponse"; - public static final String CREATE_SECURITY_GROUP = "createSecurityGroup"; - public static final String CREATE_SECURITY_GROUP_RESPONSE = "createsecuritygroupresponse"; - public static final String CREATE_SNAPSHOT = "createSnapshot"; - public static final String CREATE_SNAPSHOT_POLICY = "createSnapshotPolicy"; - public static final String CREATE_SNAPSHOT_POLICY_RESPONSE = "createsnapshotpolicyresponse"; - public static final String CREATE_SNAPSHOT_RESPONSE = "createsnapshotresponse"; - public static final String CREATE_SSH_KEY_PAIR = "createSSHKeyPair"; - public static final String CREATE_SSH_KEY_PAIR_RESPONSE = "createsshkeypairresponse"; - public static final String CREATE_TEMPLATE = "createTemplate"; - public static final String CREATE_TEMPLATE_RESPONSE = "createtemplateresponse"; - public static final String CREATE_VOLUME = "createVolume"; - public static final String CREATE_VOLUME_RESPONSE = "createvolumeresponse"; - public static final String CREATED = "created"; - public static final String CROSS_ZONES = "crosszones"; - public static final String CUSTOMIZED = "customized"; - public static final String DEFAULT_USE = "defaultuse"; - public static final String DEFAULT_ZONE_ID= "defaultzoneid"; - public static final String DELETE_INSTANCE_GROUP = "deleteInstanceGroup"; - public static final String DELETE_INSTANCE_GROUP_RESPONSE = "deleteinstancegroupresponse"; - public static final String DELETE_IP_FORWARDING_RULE = "deleteIpForwardingRule"; - public static final String DELETE_IP_FORWARDING_RULE_RESPONSE = "deleteipforwardingruleresponse"; - public static final String DELETE_ISO = "deleteIso"; - public static final String DELETE_ISO_RESPONSE = "deleteisoresponse"; - public static final String DELETE_LOAD_BALANCER_RULE = "deleteLoadBalancerRule"; - public static final String DELETE_LOAD_BALANCER_RULE_RESPONSE = "deleteloadbalancerruleresponse"; - public static final String DELETE_NETWORK = "deleteNetwork"; - public static final String DELETE_NETWORK_RESPONSE = "deletenetworkresponse"; - public static final String DELETE_PORT_FORWARDING_RULE = "deletePortForwardingRule"; - public static final String DELETE_PORT_FORWARDING_RULE_RESPONSE = "deleteportforwardingruleresponse"; - public static final String DELETE_SECURITY_GROUP = "deleteSecurityGroup"; - public static final String DELETE_SECURITY_GROUP_RESPONSE = "deletesecuritygroupresponse"; - public static final String DELETE_SNAPSHOT = "deleteSnapshot"; - public static final String DELETE_SNAPSHOT_POLICIES = "deleteSnapshotPolicies"; - public static final String DELETE_SNAPSHOT_POLICIES_RESPONSE = "deletesnapshotpoliciesresponse"; - public static final String DELETE_SNAPSHOT_RESPONSE = "deletesnapshotresponse"; - public static final String DELETE_SSH_KEY_PAIR = "deleteSSHKeyPair"; - public static final String DELETE_SSH_KEY_PAIR_RESPONSE = "deletesshkeypairresponse"; - public static final String DELETE_TEMPLATE = "deleteTemplate"; - public static final String DELETE_TEMPLATE_RESPONSE = "deletetemplateresponse"; - public static final String DELETE_VOLUME = "deleteVolume"; - public static final String DELETE_VOLUME_RESPONSE = "deletevolumeresponse"; - public static final String DEPLOY_VIRTUAL_MACHINE = "deployVirtualMachine"; - public static final String DEPLOY_VIRTUAL_MACHINE_RESPONSE = "deployvirtualmachineresponse"; - public static final String DESCRIPTION = "description"; - public static final String DESTINATION_ZONE_ID = "destzoneid"; - public static final String DESTROY_VIRTUAL_MACHINE = "destroyVirtualMachine"; - public static final String DESTROY_VIRTUAL_MACHINE_RESPONSE = "destroyvirtualmachineresponse"; - public static final String DESTROYED = "destroyed"; - public static final String DETACH_ISO = "detachIso"; - public static final String DETACH_ISO_RESPONSE = "detachisoresponse"; - public static final String DETACH_VOLUME = "detachVolume"; - public static final String DETACH_VOLUME_RESPONSE = "detachvolumeresponse"; - public static final String DETAILS = "details"; - public static final String DEVICE_ID = "deviceid"; - public static final String DHCP_PROVIDER = "dhcpprovider"; - public static final String DHCP_SERVER_TYPE = "dhcpservertype"; - public static final String DISABLE_STATIC_NAT = "disableStaticNat"; - public static final String DISABLE_STATIC_NAT_RESPONSE = "disablestaticnatresponse"; - public static final String DISASSOCIATE_IP_ADDRESS = "disassociateIpAddress"; - public static final String DISASSOCIATE_IP_ADDRESS_RESPONSE = "disassociateipaddressresponse"; - public static final String DISK_OFFERING = "diskoffering"; - public static final String DISK_OFFERING_DISPLAY_TEXT = "diskofferingdisplaytext"; - public static final String DISK_OFFERING_ID = "diskofferingid"; - public static final String DISK_OFFERING_NAME = "diskofferingname"; - public static final String DISK_SIZE = "disksize"; - public static final String DISPLAY_NAME = "displayname"; - public static final String DISPLAY_TEXT = "displaytext"; - public static final String DNS1 = "dns1"; - public static final String DNS2 = "dns2"; - public static final String DOMAIN = "domain"; - public static final String DOMAIN_ID = "domainid"; - public static final String DURATION = "duration"; - public static final String EMAIL = "email"; - public static final String ENABLE_STATIC_NAT = "enableStaticNat"; - public static final String ENABLE_STATIC_NAT_RESPONSE = "enablestaticnatresponse"; - public static final String ENABLED = "enabled"; - public static final String ENCRYPTED_PASSWORD = "encryptedpassword"; - public static final String END_DATE = "enddate"; - public static final String END_IP = "endip"; - public static final String END_PORT = "endport"; - public static final String ENTRY_TIME = "entrytime"; - public static final String EVENT = "event"; - public static final String EVENT_TYPE = "eventtype"; - public static final String EXTRACT_ID = "extractid"; - public static final String EXTRACT_ISO = "extractIso"; - public static final String EXTRACT_ISO_RESPONSE = "extractisoresponse"; - public static final String EXTRACT_MODE = "extractmode"; - public static final String EXTRACT_TEMPLATE = "extractTemplate"; - public static final String EXTRACT_TEMPLATE_RESPONSE = "extracttemplateresponse"; - public static final String EXTRACT_VOLUME = "extractVolume"; - public static final String EXTRACT_VOLUME_RESPONSE = "extractvolumeresponse"; - public static final String FINGERPRINT = "fingerprint"; - public static final String FIRSTNAME = "firstname"; - public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork"; - public static final String FORCED = "forced"; - public static final String FORMAT = "format"; - public static final String GATEWAY = "gateway"; - public static final String GET_CLOUD_IDENTIFIER = "getCloudIdentifier"; - public static final String GET_CLOUD_IDENTIFIER_RESPONSE = "getcloudidentifierresponse"; - public static final String GET_VM_PASSWORD = "getVMPassword"; - public static final String GET_VM_PASSWORD_RESPONSE = "getvmpasswordresponse"; - public static final String GROUP = "group"; - public static final String GROUP_ID = "groupid"; - public static final String GUEST_CIDR_ADDRESS = "guestcidraddress"; - public static final String GUEST_IP_TYPE = "guestiptype"; - public static final String GUEST_OS_ID = "guestosid"; - public static final String HA_ENABLE = "haenable"; - public static final String HOST_CPU_CAPACITY = "hostcpucapacity"; - public static final String HOST_CPU_NUM = "hostcpunum"; - public static final String HOST_ID = "hostid"; - public static final String HOST_MAC = "hostmac"; - public static final String HOST_MEM_CAPACITY = "hostmemcapacity"; - public static final String HOST_NAME = "hostname"; - public static final String HOST_TAG = "hosttag"; - public static final String HOST_TAGS = "hosttags"; - public static final String HYPERVISOR = "hypervisor"; - public static final String ICMP_CODE = "icmpcode"; - public static final String ICMP_TYPE = "icmptype"; - public static final String ID = "id"; - public static final String IDS = "ids"; - public static final String INGRESS_RULE = "ingressrule"; - public static final String INSTANCE = "instance"; - public static final String INSTANCE_GROUP = "instancegroup"; - public static final String INTERNAL_DNS1 = "internaldns1"; - public static final String INTERNAL_DNS2 = "internaldns2"; - public static final String INTERVAL_TYPE = "intervaltype"; - public static final String IP_ADDRESS = "ipaddress"; - public static final String IP_ADDRESS_ID = "ipaddressid"; - public static final String IP_AVAILABLE = "ipavailable"; - public static final String IP_FORWARDING_RULE = "ipforwardingrule"; - public static final String IP_LIMIT = "iplimit"; - public static final String IP_TOTAL = "iptotal"; - public static final String IS_CLEANUP_REQUIRED = "iscleanuprequired"; - public static final String IS_CUSTOMIZED = "iscustomized"; - public static final String IS_DEFAULT = "isdefault"; - public static final String IS_EXTRACTABLE = "isextractable"; - public static final String IS_FEATURED = "isfeatured"; - public static final String IS_PUBLIC = "ispublic"; - public static final String IS_READY = "isready"; - public static final String IS_RECURSIVE = "isrecursive"; - public static final String IS_SHARED = "isshared"; - public static final String IS_SOURCE_NAT = "issourcenat"; - public static final String IS_STATIC_NAT = "isstaticnat"; - public static final String IS_SYSTEM = "issystem"; - public static final String ISO_DISPLAY_TEXT = "isodisplaytext"; - public static final String ISO_FILTER = "isofilter"; - public static final String ISO_ID = "isoid"; - public static final String ISO_NAME = "isoname"; - public static final String ISOLATION_URI = "isolationuri"; - public static final String JOB_ID = "jobid"; - public static final String JOB_STATUS = "jobstatus"; - public static final String KEY_PAIR = "keypair"; - public static final String KEYWORD = "keyword"; - public static final String LASTNAME = "lastname"; - public static final String LEVEL = "level"; - public static final String LIMIT_CPU_USE = "limitcpuuse"; - public static final String LINK_LOCAL_IP = "linklocalip"; - public static final String LINK_LOCAL_MAC_ADDRESS = "linklocalmacaddress"; - public static final String LINK_LOCAL_MAC_NETMASK = "linklocalnetmask"; - public static final String LINK_LOCAL_NETWORK_ID = "linklocalnetworkid"; - public static final String LINMIN_APID = "linminapid"; - public static final String LINMIN_PASSWORD = "linminpassword"; - public static final String LINMIN_USERNAME = "linminusername"; - public static final String LIST_ACCOUNTS = "listAccounts"; - public static final String LIST_ACCOUNTS_RESPONSE = "listaccountsresponse"; - public static final String LIST_CAPABILITIES = "listCapabilities"; - public static final String LIST_CAPABILITIES_RESPONSE = "listcapabilitiesresponse"; - public static final String LIST_DISK_OFFERINGS = "listDiskOfferings"; - public static final String LIST_DISK_OFFERINGS_RESPONSE = "listdiskofferingsresponse"; - public static final String LIST_EVENT_TYPES = "listEventTypes"; - public static final String LIST_EVENT_TYPES_RESPONSE = "listeventtypesresponse"; - public static final String LIST_EVENTS = "listEvents"; - public static final String LIST_EVENTS_RESPONSE = "listeventsresponse"; - public static final String LIST_HYPERVISORS = "listHypervisors"; - public static final String LIST_HYPERVISORS_RESPONSE = "listhypervisorsresponse"; - public static final String LIST_INSTANCE_GROUPS = "listInstanceGroups"; - public static final String LIST_INSTANCE_GROUPS_RESPONSE = "listinstancegroupsresponse"; - public static final String LIST_IP_FORWARDING_RULES = "listIpForwardingRules"; - public static final String LIST_IP_FORWARDING_RULES_RESPONSE = "listipforwardingrulesresponse"; - public static final String LIST_ISO_PERMISSIONS = "listIsoPermissions"; - public static final String LIST_ISO_PERMISSIONS_RESPONSE = "listisopermissionsresponse"; - public static final String LIST_ISOS = "listIsos"; - public static final String LIST_ISOS_RESPONSE = "listisosresponse"; - public static final String LIST_LOAD_BALANCER_RULE_INSTANCES = "listLoadBalancerRuleInstances"; - public static final String LIST_LOAD_BALANCER_RULE_INSTANCES_RESPONSE = "listloadbalancerruleinstancesresponse"; - public static final String LIST_LOAD_BALANCER_RULES = "listLoadBalancerRules"; - public static final String LIST_LOAD_BALANCER_RULES_RESPONSE = "listloadbalancerrulesresponse"; - public static final String LIST_NETWORK_OFFERINGS = "listNetworkOfferings"; - public static final String LIST_NETWORK_OFFERINGS_RESPONSE = "listnetworkofferingsresponse"; - public static final String LIST_NETWORKS = "listNetworks"; - public static final String LIST_NETWORKS_RESPONSE = "listnetworksresponse"; - public static final String LIST_OS_CATEGORIES = "listOsCategories"; - public static final String LIST_OS_CATEGORIES_RESPONSE = "listoscategoriesresponse"; - public static final String LIST_OS_TYPES = "listOsTypes"; - public static final String LIST_OS_TYPES_RESPONSE = "listostypesresponse"; - public static final String LIST_PORT_FORWARDING_RULES = "listPortForwardingRules"; - public static final String LIST_PORT_FORWARDING_RULES_RESPONSE = "listportforwardingrulesresponse"; - public static final String LIST_PUBLIC_IP_ADDRESSES = "listPublicIpAddresses"; - public static final String LIST_PUBLIC_IP_ADDRESSES_RESPONSE = "listpublicipaddressesresponse"; - public static final String LIST_RESOURCE_LIMITS = "listResourceLimits"; - public static final String LIST_RESOURCE_LIMITS_RESPONSE = "listresourcelimitsresponse"; - public static final String LIST_SECURITY_GROUPS = "listSecurityGroups"; - public static final String LIST_SECURITY_GROUPS_RESPONSE = "listsecuritygroupsresponse"; - public static final String LIST_SERVICE_OFFERINGS = "listServiceOfferings"; - public static final String LIST_SERVICE_OFFERINGS_RESPONSE = "listserviceofferingsresponse"; - public static final String LIST_SNAPSHOT_POLICIES = "listSnapshotPolicies"; - public static final String LIST_SNAPSHOT_POLICIES_RESPONSE = "listsnapshotpoliciesresponse"; - public static final String LIST_SNAPSHOTS = "listSnapshots"; - public static final String LIST_SNAPSHOTS_RESPONSE = "listsnapshotsresponse"; - public static final String LIST_SSH_KEY_PAIRS = "listSSHKeyPairs"; - public static final String LIST_SSH_KEY_PAIRS_RESPONSE = "listsshkeypairsresponse"; - public static final String LIST_TEMPLATE_PERMISSIONS = "listTemplatePermissions"; - public static final String LIST_TEMPLATE_PERMISSIONS_RESPONSE = "listtemplatepermissionsresponse"; - public static final String LIST_TEMPLATES = "listTemplates"; - public static final String LIST_TEMPLATES_RESPONSE = "listtemplatesresponse"; - public static final String LIST_VIRTUAL_MACHINES = "listVirtualMachines"; - public static final String LIST_VIRTUAL_MACHINES_RESPONSE = "listvirtualmachinesresponse"; - public static final String LIST_VOLUMES = "listVolumes"; - public static final String LIST_VOLUMES_RESPONSE = "listvolumesresponse"; - public static final String LIST_ZONES = "listZones"; - public static final String LIST_ZONES_RESPONSE = "listzonesresponse"; - public static final String LOAD_BALANCER = "loadbalancer"; - public static final String LOCK = "lock"; - public static final String LUN = "lun"; - public static final String MAC_ADDRESS = "macaddress"; - public static final String MAX = "max"; - public static final String MAX_CONNECTIONS = "maxconnections"; - public static final String MAX_SNAPS = "maxsnaps"; - public static final String MEMORY = "memory"; - public static final String MODE = "mode"; - public static final String NAME = "name"; - public static final String NETMASK = "netmask"; - public static final String NETWORK = "network"; - public static final String NETWORK_DOMAIN = "networkdomain"; - public static final String NETWORK_ID = "networkid"; - public static final String NETWORK_IDS = "networkids"; - public static final String NETWORK_KBS_READ = "networkkbsread"; - public static final String NETWORK_KBS_WRITE = "networkkbswrite"; - public static final String NETWORK_OFFERING = "networkoffering"; - public static final String NETWORK_OFFERING_AVAILABILITY = "networkofferingavailability"; - public static final String NETWORK_OFFERING_DISPLAY_TEXT = "networkofferingdisplaytext"; - public static final String NETWORK_OFFERING_ID = "networkofferingid"; - public static final String NETWORK_OFFERING_NAME = "networkofferingname"; - public static final String NETWORK_TYPE = "networktype"; - public static final String NETWORKRATE = "networkrate"; - public static final String NEW_NAME = "newname"; - public static final String NIC = "nic"; - public static final String NUM_RETRIES = "numretries"; - public static final String OFFER_HA = "offerha"; - public static final String OP = "op"; - public static final String OS_CATEGORY = "oscategory"; - public static final String OS_CATEGORY_ID = "oscategoryid"; - public static final String OS_TYPE = "ostype"; - public static final String OS_TYPE_ID = "ostypeid"; - public static final String OS_TYPE_NAME = "ostypename"; - public static final String PAGE = "page"; - public static final String PAGE_SIZE = "pagesize"; - public static final String PARENT_DOMAIN_ID = "parentdomainid"; - public static final String PARENT_ID = "parentid"; - public static final String PASSWORD = "password"; - public static final String PASSWORD_ENABLED = "passwordenabled"; - public static final String PATH = "path"; - public static final String POD_ID = "podid"; - public static final String POLICY_ID = "policyid"; - public static final String PORT_FORWARDING_RULE = "portforwardingrule"; - public static final String PORT_FORWARDING_SERVICE_ID = "portforwardingserviceid"; - public static final String PORTAL = "portal"; - public static final String PRIVATE_END_PORT = "privateendport"; - public static final String PRIVATE_INTERFACE = "privateinterface"; - public static final String PRIVATE_IP = "privateip"; - public static final String PRIVATE_KEY = "privatekey"; - public static final String PRIVATE_MAC_ADDRESS = "privatemacaddress"; - public static final String PRIVATE_NETMASK = "privatenetmask"; - public static final String PRIVATE_NETWORK_ID = "privatenetworkid"; - public static final String PRIVATE_PORT = "privateport"; - public static final String PRIVATE_ZONE = "privatezone"; - public static final String PROTOCOL = "protocol"; - public static final String PUBLIC_END_PORT = "publicendport"; - public static final String PUBLIC_INTERFACE = "publicinterface"; - public static final String PUBLIC_IP = "publicip"; - public static final String PUBLIC_IP_ADDRESS = "publicipaddress"; - public static final String PUBLIC_IP_ID = "publicipid"; - public static final String PUBLIC_KEY = "publickey"; - public static final String PUBLIC_PORT = "publicport"; - public static final String PUBLIC_ZONE = "publiczone"; - public static final String PXE_SERVER_TYPE = "pxeservertype"; - public static final String REBOOT_VIRTUAL_MACHINE = "rebootVirtualMachine"; - public static final String REBOOT_VIRTUAL_MACHINE_RESPONSE = "rebootvirtualmachineresponse"; - public static final String RECEIVED_BYTES = "receivedbytes"; - public static final String REGISTER_ISO = "registerIso"; - public static final String REGISTER_ISO_RESPONSE = "registerisoresponse"; - public static final String REGISTER_SSH_KEY_PAIR = "registerSSHKeyPair"; - public static final String REGISTER_SSH_KEY_PAIR_RESPONSE = "registersshkeypairresponse"; - public static final String REGISTER_TEMPLATE = "registerTemplate"; - public static final String REGISTER_TEMPLATE_RESPONSE = "registertemplateresponse"; - public static final String RELATED = "related"; - public static final String REMOVE_FROM_LOAD_BALANCER_RULE = "removeFromLoadBalancerRule"; - public static final String REMOVE_FROM_LOAD_BALANCER_RULE_RESPONSE = "removefromloadbalancerruleresponse"; - public static final String REMOVED = "removed"; - public static final String REQUIRES_HVM = "requireshvm"; - public static final String RESET_PASSWORD_FOR_VIRTUAL_MACHINE = "resetPasswordForVirtualMachine"; - public static final String RESET_PASSWORD_FOR_VIRTUAL_MACHINE_RESPONSE = "resetpasswordforvirtualmachineresponse"; - public static final String RESOURCE_LIMIT = "resourcelimit"; - public static final String RESOURCE_TYPE = "resourcetype"; - public static final String RESTART_NETWORK = "restartNetwork"; - public static final String RESTART_NETWORK_RESPONSE = "restartnetworkresponse"; - public static final String REVOKE_SECURITY_GROUP_INGRESS = "revokeSecurityGroupIngress"; - public static final String REVOKE_SECURITY_GROUP_INGRESS_RESPONSE = "revokesecuritygroupingress"; - public static final String ROOT_DEVICE_ID = "rootdeviceid"; - public static final String ROOT_DEVICE_TYPE = "rootdevicetype"; - public static final String RULE_ID = "ruleid"; - public static final String SCHEDULE = "schedule"; - public static final String SCOPE = "scope"; - public static final String SECRET_KEY = "secretkey"; - public static final String SECURITY_GROUP = "securitygroup"; - public static final String SECURITY_GROUP_ENABLED = "securitygroupenabled"; - public static final String SECURITY_GROUP_ID = "securitygroupid"; - public static final String SECURITY_GROUP_IDS = "securitygroupids"; - public static final String SECURITY_GROUP_NAME = "securitygroupname"; - public static final String SECURITY_GROUP_NAMES = "securitygroupnames"; - public static final String SECURITY_GROUPS_ENABLED = "securitygroupsenabled"; - public static final String SENT = "sent"; - public static final String SENT_BYTES = "sentbytes"; - public static final String SERVICE = "service"; - public static final String SERVICE_OFFERING = "serviceoffering"; - public static final String SERVICE_OFFERING_DISPLAY_TEXT = "serviceofferingdisplaytext"; - public static final String SERVICE_OFFERING_ID = "serviceofferingid"; - public static final String SERVICE_OFFERING_NAME = "serviceofferingname"; - public static final String SIGNATURE = "signature"; - public static final String SIZE = "size"; - public static final String SNAPSHOT = "snapshot"; - public static final String SNAPSHOT_AVAILABLE = "snapshotavailable"; - public static final String SNAPSHOT_ID = "snapshotid"; - public static final String SNAPSHOT_LIMIT = "snapshotlimit"; - public static final String SNAPSHOT_POLICY_ID = "snapshotpolicyid"; - public static final String SNAPSHOT_TOTAL = "snapshottotal"; - public static final String SNAPSHOT_TYPE = "snapshottype"; - public static final String SOURCE_TEMPLATE_ID = "sourcetemplateid"; - public static final String SOURCE_ZONE_ID = "sourcezoneid"; - public static final String SPECIFY_VLAN = "specifyvlan"; - public static final String SSH_KEYPAIR = "keypair"; - public static final String START_DATE = "startdate"; - public static final String START_IP = "startip"; - public static final String START_PORT = "startport"; - public static final String START_VIRTUAL_MACHINE = "startVirtualMachine"; - public static final String START_VIRTUAL_MACHINE_RESPONSE = "startvirtualmachineresponse"; - public static final String STATE = "state"; - public static final String STATUS = "status"; - public static final String STOP_VIRTUAL_MACHINE = "stopVirtualMachine"; - public static final String STOP_VIRTUAL_MACHINE_RESPONSE = "stopvirtualmachineresponse"; - public static final String STORAGE = "storage"; - public static final String STORAGE_ID="storageid"; - public static final String STORAGE_TYPE = "storagetype"; - public static final String SUCCESS = "success"; - public static final String SYSTEM_VM_TYPE = "systemvmtype"; - public static final String TAGS = "tags"; - public static final String TARGET_IQN = "targetiqn"; - public static final String TEMPLATE = "template"; - public static final String TEMPLATE_AVAILABLE = "templateavailable"; - public static final String TEMPLATE_DISPLAY_TEXT = "templatedisplaytext"; - public static final String TEMPLATE_FILTER = "templatefilter"; - public static final String TEMPLATE_ID = "templateid"; - public static final String TEMPLATE_LIMIT = "templatelimit"; - public static final String TEMPLATE_NAME = "templatename"; - public static final String TEMPLATE_PERMISSION = "templatepermission"; - public static final String TEMPLATE_TOTAL = "templatetotal"; - public static final String TEMPLATE_TYPE = "templatetype"; - public static final String TIMEOUT = "timeout"; - public static final String TIMEZONE = "timezone"; - public static final String TRAFFIC_TYPE = "traffictype"; - public static final String TYPE = "type"; - public static final String UPDATE_INSTANCE_GROUP = "updateInstanceGroup"; - public static final String UPDATE_INSTANCE_GROUP_RESPONSE = "updateinstancegroupresponse"; - public static final String UPDATE_ISO = "updateIso"; - public static final String UPDATE_ISO_PERMISSIONS = "updateIsoPermissions"; - public static final String UPDATE_ISO_PERMISSIONS_RESPONSE = "updateisopermissionsresponse"; - public static final String UPDATE_ISO_RESPONSE = "updateisoresponse"; - public static final String UPDATE_LOAD_BALANCER_RULE = "updateLoadBalancerRule"; - public static final String UPDATE_LOAD_BALANCER_RULE_RESPONSE = "updateloadbalancerruleresponse"; - public static final String UPDATE_NETWORK = "updateNetwork"; - public static final String UPDATE_NETWORK_RESPONSE = "updatenetworkresponse"; - public static final String UPDATE_TEMPLATE = "updateTemplate"; - public static final String UPDATE_TEMPLATE_PERMISSIONS = "updateTemplatePermissions"; - public static final String UPDATE_TEMPLATE_PERMISSIONS_RESPONSE = "updatetemplatepermissionsresponse"; - public static final String UPDATE_TEMPLATE_RESPONSE = "updatetemplateresponse"; - public static final String UPDATE_VIRTUAL_MACHINE = "updateVirtualMachine"; - public static final String UPDATE_VIRTUAL_MACHINE_RESPONSE = "updatevirtualmachineresponse"; - public static final String UPLOAD_PERCENTAGE = "uploadpercentage"; - public static final String URL = "url"; - public static final String USAGE_INTERFACE = "usageinterface"; - public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork"; - public static final String USER = "user"; - public static final String USER_DATA = "userdata"; - public static final String USER_ID = "userid"; - public static final String USER_PUBLIC_TEMPLATE_ENABLED = "userpublictemplateenabled"; - public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist"; - public static final String USERNAME = "username"; - public static final String VALUE = "value"; - public static final String VIRTUAL_MACHINE = "virtualmachine"; - public static final String VIRTUAL_MACHINE_DISPLAY_NAME = "virtualmachinedisplayname"; - public static final String VIRTUAL_MACHINE_ID = "virtualmachineid"; - public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids"; - public static final String VIRTUAL_MACHINE_NAME = "virtualmachinename"; - public static final String VLAN = "vlan"; - public static final String VLAN_ID = "vlanid"; - public static final String VLAN_NAME = "vlanname"; - public static final String VM_AVAILABLE = "vmavailable"; - public static final String VM_DISPLAY_NAME = "vmdisplayname"; - public static final String VM_LIMIT = "vmlimit"; - public static final String VM_NAME = "vmname"; - public static final String VM_RUNNING = "vmrunning"; - public static final String VM_STATE = "vmstate"; - public static final String VM_STOPPED = "vmstopped"; - public static final String VM_TOTAL = "vmtotal"; - public static final String VNET = "vnet"; - public static final String VOLUME = "volume"; - public static final String VOLUME_AVAILABLE = "volumeavailable"; - public static final String VOLUME_ID = "volumeid"; - public static final String VOLUME_LIMIT = "volumelimit"; - public static final String VOLUME_NAME = "volumename"; - public static final String VOLUME_TOTAL = "volumetotal"; - public static final String VOLUME_TYPE = "volumetype"; - public static final String ZONE = "zone"; - public static final String ZONE_ID = "zoneid"; - public static final String ZONE_NAME = "zonename"; - public static final String ZONE_TOKEN = "zonetoken"; - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +public class ApiConstants { + public static final String ACCOUNT = "account"; + public static final String ACCOUNT_ID = "accountid"; + public static final String ACCOUNT_TYPE = "accounttype"; + public static final String ACCOUNTS = "accounts"; + public static final String ALGORITHM = "algorithm"; + public static final String ALLOCATED = "allocated"; + public static final String ALLOCATED_ONLY = "allocatedonly"; + public static final String ALLOCATION_STATE = "allocationstate"; + public static final String API_KEY = "apikey"; + public static final String APPLIED = "applied"; + public static final String ASSIGN_TO_LOAD_BALANCER_RULE = "assignToLoadBalancerRule"; + public static final String ASSIGN_TO_LOAD_BALANCER_RULE_RESPONSE = "assigntoloadbalancerruleresponse"; + public static final String ASSOCIATE_IP_ADDRESS = "associateIpAddress"; + public static final String ASSOCIATE_IP_ADDRESS_RESPONSE = "associateipaddressresponse"; + public static final String ASSOCIATED_NETWORK_ID = "associatednetworkid"; + public static final String ATTACH_ISO = "attachIso"; + public static final String ATTACH_ISO_RESPONSE = "attachisoresponse"; + public static final String ATTACH_VOLUME = "attachVolume"; + public static final String ATTACH_VOLUME_RESPONSE = "attachvolumeresponse"; + public static final String ATTACHED = "attached"; + public static final String AUTHORIZE_SECURITY_GROUP_INGRESS = "authorizeSecurityGroupIngress"; + public static final String AUTHORIZE_SECURITY_GROUP_INGRESS_RESPONSE = "authorizesecuritygroupingressresponse"; + public static final String AVAILABILITY = "availability"; + public static final String AVAILABLE = "available"; + public static final String BITS = "bits"; + public static final String BOOTABLE = "bootable"; + public static final String BROADCAST_DOMAIN_TYPE = "broadcastdomaintype"; + public static final String BROADCAST_URI = "broadcasturi"; + public static final String CAPABILITY = "capability"; + public static final String CATEGORY = "category"; + public static final String CERTIFICATE = "certificate"; + public static final String CHANGE_SERVICE_FOR_VIRTUAL_MACHINE = "changeServiceForVirtualMachine"; + public static final String CHANGE_SERVICE_FOR_VIRTUAL_MACHINE_RESPONSE = "changeserviceforvirtualmachineresponse"; + public static final String CHECKSUM="checksum"; + public static final String CIDR = "cidr"; + public static final String CIDR_LIST = "cidrlist"; + public static final String CLEANUP = "cleanup"; + public static final String CLOUD_IDENTIFIER = "cloudidentifier"; + public static final String CLOUD_STACK_VERSION = "cloudstackversion"; + public static final String CLUSTER_ID = "clusterid"; + public static final String CLUSTER_NAME = "clustername"; + public static final String CLUSTER_TYPE = "clustertype"; + public static final String COMPONENT = "component"; + public static final String COPY_ISO = "copyIso"; + public static final String COPY_ISO_RESPONSE = "copyisoresponse"; + public static final String COPY_TEMPLATE = "copyTemplate"; + public static final String COPY_TEMPLATE_RESPONSE = "copytemplateresponse"; + public static final String CPU_NUMBER = "cpunumber"; + public static final String CPU_SPEED = "cpuspeed"; + public static final String CPU_USED = "cpuused"; + public static final String CREATE_INSTANCE_GROUP = "createInstanceGroup"; + public static final String CREATE_INSTANCE_GROUP_RESPONSE = "createinstancegroupresponse"; + public static final String CREATE_IP_FORWARDING_RULE = "createIpForwardingRule"; + public static final String CREATE_IP_FORWARDING_RULE_RESPONSE = "createipforwardingruleresponse"; + public static final String CREATE_LOAD_BALANCER_RULE = "createLoadBalancerRule"; + public static final String CREATE_LOAD_BALANCER_RULE_RESPONSE = "createloadbalancerruleresponse"; + public static final String CREATE_NETWORK = "createNetwork"; + public static final String CREATE_NETWORK_RESPONSE = "createnetworkresponse"; + public static final String CREATE_PORT_FORWARDING_RULE = "createPortForwardingRule"; + public static final String CREATE_PORT_FORWARDING_RULE_RESPONSE = "createportforwardingruleresponse"; + public static final String CREATE_SECURITY_GROUP = "createSecurityGroup"; + public static final String CREATE_SECURITY_GROUP_RESPONSE = "createsecuritygroupresponse"; + public static final String CREATE_SNAPSHOT = "createSnapshot"; + public static final String CREATE_SNAPSHOT_POLICY = "createSnapshotPolicy"; + public static final String CREATE_SNAPSHOT_POLICY_RESPONSE = "createsnapshotpolicyresponse"; + public static final String CREATE_SNAPSHOT_RESPONSE = "createsnapshotresponse"; + public static final String CREATE_SSH_KEY_PAIR = "createSSHKeyPair"; + public static final String CREATE_SSH_KEY_PAIR_RESPONSE = "createsshkeypairresponse"; + public static final String CREATE_TEMPLATE = "createTemplate"; + public static final String CREATE_TEMPLATE_RESPONSE = "createtemplateresponse"; + public static final String CREATE_VOLUME = "createVolume"; + public static final String CREATE_VOLUME_RESPONSE = "createvolumeresponse"; + public static final String CREATED = "created"; + public static final String CROSS_ZONES = "crosszones"; + public static final String CUSTOMIZED = "customized"; + public static final String DEFAULT_USE = "defaultuse"; + public static final String DEFAULT_ZONE_ID= "defaultzoneid"; + public static final String DELETE_INSTANCE_GROUP = "deleteInstanceGroup"; + public static final String DELETE_INSTANCE_GROUP_RESPONSE = "deleteinstancegroupresponse"; + public static final String DELETE_IP_FORWARDING_RULE = "deleteIpForwardingRule"; + public static final String DELETE_IP_FORWARDING_RULE_RESPONSE = "deleteipforwardingruleresponse"; + public static final String DELETE_ISO = "deleteIso"; + public static final String DELETE_ISO_RESPONSE = "deleteisoresponse"; + public static final String DELETE_LOAD_BALANCER_RULE = "deleteLoadBalancerRule"; + public static final String DELETE_LOAD_BALANCER_RULE_RESPONSE = "deleteloadbalancerruleresponse"; + public static final String DELETE_NETWORK = "deleteNetwork"; + public static final String DELETE_NETWORK_RESPONSE = "deletenetworkresponse"; + public static final String DELETE_PORT_FORWARDING_RULE = "deletePortForwardingRule"; + public static final String DELETE_PORT_FORWARDING_RULE_RESPONSE = "deleteportforwardingruleresponse"; + public static final String DELETE_SECURITY_GROUP = "deleteSecurityGroup"; + public static final String DELETE_SECURITY_GROUP_RESPONSE = "deletesecuritygroupresponse"; + public static final String DELETE_SNAPSHOT = "deleteSnapshot"; + public static final String DELETE_SNAPSHOT_POLICIES = "deleteSnapshotPolicies"; + public static final String DELETE_SNAPSHOT_POLICIES_RESPONSE = "deletesnapshotpoliciesresponse"; + public static final String DELETE_SNAPSHOT_RESPONSE = "deletesnapshotresponse"; + public static final String DELETE_SSH_KEY_PAIR = "deleteSSHKeyPair"; + public static final String DELETE_SSH_KEY_PAIR_RESPONSE = "deletesshkeypairresponse"; + public static final String DELETE_TEMPLATE = "deleteTemplate"; + public static final String DELETE_TEMPLATE_RESPONSE = "deletetemplateresponse"; + public static final String DELETE_VOLUME = "deleteVolume"; + public static final String DELETE_VOLUME_RESPONSE = "deletevolumeresponse"; + public static final String DEPLOY_VIRTUAL_MACHINE = "deployVirtualMachine"; + public static final String DEPLOY_VIRTUAL_MACHINE_RESPONSE = "deployvirtualmachineresponse"; + public static final String DESCRIPTION = "description"; + public static final String DESTINATION_ZONE_ID = "destzoneid"; + public static final String DESTROY_VIRTUAL_MACHINE = "destroyVirtualMachine"; + public static final String DESTROY_VIRTUAL_MACHINE_RESPONSE = "destroyvirtualmachineresponse"; + public static final String DESTROYED = "destroyed"; + public static final String DETACH_ISO = "detachIso"; + public static final String DETACH_ISO_RESPONSE = "detachisoresponse"; + public static final String DETACH_VOLUME = "detachVolume"; + public static final String DETACH_VOLUME_RESPONSE = "detachvolumeresponse"; + public static final String DETAILS = "details"; + public static final String DEVICE_ID = "deviceid"; + public static final String DHCP_PROVIDER = "dhcpprovider"; + public static final String DHCP_SERVER_TYPE = "dhcpservertype"; + public static final String DISABLE_STATIC_NAT = "disableStaticNat"; + public static final String DISABLE_STATIC_NAT_RESPONSE = "disablestaticnatresponse"; + public static final String DISASSOCIATE_IP_ADDRESS = "disassociateIpAddress"; + public static final String DISASSOCIATE_IP_ADDRESS_RESPONSE = "disassociateipaddressresponse"; + public static final String DISK_OFFERING = "diskoffering"; + public static final String DISK_OFFERING_DISPLAY_TEXT = "diskofferingdisplaytext"; + public static final String DISK_OFFERING_ID = "diskofferingid"; + public static final String DISK_OFFERING_NAME = "diskofferingname"; + public static final String DISK_SIZE = "disksize"; + public static final String DISPLAY_NAME = "displayname"; + public static final String DISPLAY_TEXT = "displaytext"; + public static final String DNS1 = "dns1"; + public static final String DNS2 = "dns2"; + public static final String DOMAIN = "domain"; + public static final String DOMAIN_ID = "domainid"; + public static final String DURATION = "duration"; + public static final String EMAIL = "email"; + public static final String ENABLE_STATIC_NAT = "enableStaticNat"; + public static final String ENABLE_STATIC_NAT_RESPONSE = "enablestaticnatresponse"; + public static final String ENABLED = "enabled"; + public static final String ENCRYPTED_PASSWORD = "encryptedpassword"; + public static final String END_DATE = "enddate"; + public static final String END_IP = "endip"; + public static final String END_PORT = "endport"; + public static final String ENTRY_TIME = "entrytime"; + public static final String EVENT = "event"; + public static final String EVENT_TYPE = "eventtype"; + public static final String EXTRACT_ID = "extractid"; + public static final String EXTRACT_ISO = "extractIso"; + public static final String EXTRACT_ISO_RESPONSE = "extractisoresponse"; + public static final String EXTRACT_MODE = "extractmode"; + public static final String EXTRACT_TEMPLATE = "extractTemplate"; + public static final String EXTRACT_TEMPLATE_RESPONSE = "extracttemplateresponse"; + public static final String EXTRACT_VOLUME = "extractVolume"; + public static final String EXTRACT_VOLUME_RESPONSE = "extractvolumeresponse"; + public static final String FINGERPRINT = "fingerprint"; + public static final String FIRSTNAME = "firstname"; + public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork"; + public static final String FORCED = "forced"; + public static final String FORMAT = "format"; + public static final String GATEWAY = "gateway"; + public static final String GET_CLOUD_IDENTIFIER = "getCloudIdentifier"; + public static final String GET_CLOUD_IDENTIFIER_RESPONSE = "getcloudidentifierresponse"; + public static final String GET_VM_PASSWORD = "getVMPassword"; + public static final String GET_VM_PASSWORD_RESPONSE = "getvmpasswordresponse"; + public static final String GROUP = "group"; + public static final String GROUP_ID = "groupid"; + public static final String GUEST_CIDR_ADDRESS = "guestcidraddress"; + public static final String GUEST_IP_TYPE = "guestiptype"; + public static final String GUEST_OS_ID = "guestosid"; + public static final String HA_ENABLE = "haenable"; + public static final String HOST_CPU_CAPACITY = "hostcpucapacity"; + public static final String HOST_CPU_NUM = "hostcpunum"; + public static final String HOST_ID = "hostid"; + public static final String HOST_MAC = "hostmac"; + public static final String HOST_MEM_CAPACITY = "hostmemcapacity"; + public static final String HOST_NAME = "hostname"; + public static final String HOST_TAG = "hosttag"; + public static final String HOST_TAGS = "hosttags"; + public static final String HYPERVISOR = "hypervisor"; + public static final String ICMP_CODE = "icmpcode"; + public static final String ICMP_TYPE = "icmptype"; + public static final String ID = "id"; + public static final String IDS = "ids"; + public static final String INGRESS_RULE = "ingressrule"; + public static final String INSTANCE = "instance"; + public static final String INSTANCE_GROUP = "instancegroup"; + public static final String INTERNAL_DNS1 = "internaldns1"; + public static final String INTERNAL_DNS2 = "internaldns2"; + public static final String INTERVAL_TYPE = "intervaltype"; + public static final String IP_ADDRESS = "ipaddress"; + public static final String IP_ADDRESS_ID = "ipaddressid"; + public static final String IP_AVAILABLE = "ipavailable"; + public static final String IP_FORWARDING_RULE = "ipforwardingrule"; + public static final String IP_LIMIT = "iplimit"; + public static final String IP_TOTAL = "iptotal"; + public static final String IS_CLEANUP_REQUIRED = "iscleanuprequired"; + public static final String IS_CUSTOMIZED = "iscustomized"; + public static final String IS_DEFAULT = "isdefault"; + public static final String IS_EXTRACTABLE = "isextractable"; + public static final String IS_FEATURED = "isfeatured"; + public static final String IS_PUBLIC = "ispublic"; + public static final String IS_READY = "isready"; + public static final String IS_RECURSIVE = "isrecursive"; + public static final String IS_SHARED = "isshared"; + public static final String IS_SOURCE_NAT = "issourcenat"; + public static final String IS_STATIC_NAT = "isstaticnat"; + public static final String IS_SYSTEM = "issystem"; + public static final String ISO_DISPLAY_TEXT = "isodisplaytext"; + public static final String ISO_FILTER = "isofilter"; + public static final String ISO_ID = "isoid"; + public static final String ISO_NAME = "isoname"; + public static final String ISOLATION_URI = "isolationuri"; + public static final String JOB_ID = "jobid"; + public static final String JOB_STATUS = "jobstatus"; + public static final String KEY_PAIR = "keypair"; + public static final String KEYWORD = "keyword"; + public static final String LASTNAME = "lastname"; + public static final String LEVEL = "level"; + public static final String LIMIT_CPU_USE = "limitcpuuse"; + public static final String LINK_LOCAL_IP = "linklocalip"; + public static final String LINK_LOCAL_MAC_ADDRESS = "linklocalmacaddress"; + public static final String LINK_LOCAL_MAC_NETMASK = "linklocalnetmask"; + public static final String LINK_LOCAL_NETWORK_ID = "linklocalnetworkid"; + public static final String LINMIN_APID = "linminapid"; + public static final String LINMIN_PASSWORD = "linminpassword"; + public static final String LINMIN_USERNAME = "linminusername"; + public static final String LIST_ACCOUNTS = "listAccounts"; + public static final String LIST_ACCOUNTS_RESPONSE = "listaccountsresponse"; + public static final String LIST_CAPABILITIES = "listCapabilities"; + public static final String LIST_CAPABILITIES_RESPONSE = "listcapabilitiesresponse"; + public static final String LIST_DISK_OFFERINGS = "listDiskOfferings"; + public static final String LIST_DISK_OFFERINGS_RESPONSE = "listdiskofferingsresponse"; + public static final String LIST_EVENT_TYPES = "listEventTypes"; + public static final String LIST_EVENT_TYPES_RESPONSE = "listeventtypesresponse"; + public static final String LIST_EVENTS = "listEvents"; + public static final String LIST_EVENTS_RESPONSE = "listeventsresponse"; + public static final String LIST_HYPERVISORS = "listHypervisors"; + public static final String LIST_HYPERVISORS_RESPONSE = "listhypervisorsresponse"; + public static final String LIST_INSTANCE_GROUPS = "listInstanceGroups"; + public static final String LIST_INSTANCE_GROUPS_RESPONSE = "listinstancegroupsresponse"; + public static final String LIST_IP_FORWARDING_RULES = "listIpForwardingRules"; + public static final String LIST_IP_FORWARDING_RULES_RESPONSE = "listipforwardingrulesresponse"; + public static final String LIST_ISO_PERMISSIONS = "listIsoPermissions"; + public static final String LIST_ISO_PERMISSIONS_RESPONSE = "listisopermissionsresponse"; + public static final String LIST_ISOS = "listIsos"; + public static final String LIST_ISOS_RESPONSE = "listisosresponse"; + public static final String LIST_LOAD_BALANCER_RULE_INSTANCES = "listLoadBalancerRuleInstances"; + public static final String LIST_LOAD_BALANCER_RULE_INSTANCES_RESPONSE = "listloadbalancerruleinstancesresponse"; + public static final String LIST_LOAD_BALANCER_RULES = "listLoadBalancerRules"; + public static final String LIST_LOAD_BALANCER_RULES_RESPONSE = "listloadbalancerrulesresponse"; + public static final String LIST_NETWORK_OFFERINGS = "listNetworkOfferings"; + public static final String LIST_NETWORK_OFFERINGS_RESPONSE = "listnetworkofferingsresponse"; + public static final String LIST_NETWORKS = "listNetworks"; + public static final String LIST_NETWORKS_RESPONSE = "listnetworksresponse"; + public static final String LIST_OS_CATEGORIES = "listOsCategories"; + public static final String LIST_OS_CATEGORIES_RESPONSE = "listoscategoriesresponse"; + public static final String LIST_OS_TYPES = "listOsTypes"; + public static final String LIST_OS_TYPES_RESPONSE = "listostypesresponse"; + public static final String LIST_PORT_FORWARDING_RULES = "listPortForwardingRules"; + public static final String LIST_PORT_FORWARDING_RULES_RESPONSE = "listportforwardingrulesresponse"; + public static final String LIST_PUBLIC_IP_ADDRESSES = "listPublicIpAddresses"; + public static final String LIST_PUBLIC_IP_ADDRESSES_RESPONSE = "listpublicipaddressesresponse"; + public static final String LIST_RESOURCE_LIMITS = "listResourceLimits"; + public static final String LIST_RESOURCE_LIMITS_RESPONSE = "listresourcelimitsresponse"; + public static final String LIST_SECURITY_GROUPS = "listSecurityGroups"; + public static final String LIST_SECURITY_GROUPS_RESPONSE = "listsecuritygroupsresponse"; + public static final String LIST_SERVICE_OFFERINGS = "listServiceOfferings"; + public static final String LIST_SERVICE_OFFERINGS_RESPONSE = "listserviceofferingsresponse"; + public static final String LIST_SNAPSHOT_POLICIES = "listSnapshotPolicies"; + public static final String LIST_SNAPSHOT_POLICIES_RESPONSE = "listsnapshotpoliciesresponse"; + public static final String LIST_SNAPSHOTS = "listSnapshots"; + public static final String LIST_SNAPSHOTS_RESPONSE = "listsnapshotsresponse"; + public static final String LIST_SSH_KEY_PAIRS = "listSSHKeyPairs"; + public static final String LIST_SSH_KEY_PAIRS_RESPONSE = "listsshkeypairsresponse"; + public static final String LIST_TEMPLATE_PERMISSIONS = "listTemplatePermissions"; + public static final String LIST_TEMPLATE_PERMISSIONS_RESPONSE = "listtemplatepermissionsresponse"; + public static final String LIST_TEMPLATES = "listTemplates"; + public static final String LIST_TEMPLATES_RESPONSE = "listtemplatesresponse"; + public static final String LIST_VIRTUAL_MACHINES = "listVirtualMachines"; + public static final String LIST_VIRTUAL_MACHINES_RESPONSE = "listvirtualmachinesresponse"; + public static final String LIST_VOLUMES = "listVolumes"; + public static final String LIST_VOLUMES_RESPONSE = "listvolumesresponse"; + public static final String LIST_ZONES = "listZones"; + public static final String LIST_ZONES_RESPONSE = "listzonesresponse"; + public static final String LOAD_BALANCER = "loadbalancer"; + public static final String LOCK = "lock"; + public static final String LUN = "lun"; + public static final String MAC_ADDRESS = "macaddress"; + public static final String MAX = "max"; + public static final String MAX_CONNECTIONS = "maxconnections"; + public static final String MAX_SNAPS = "maxsnaps"; + public static final String MEMORY = "memory"; + public static final String MODE = "mode"; + public static final String NAME = "name"; + public static final String NETMASK = "netmask"; + public static final String NETWORK = "network"; + public static final String NETWORK_DOMAIN = "networkdomain"; + public static final String NETWORK_ID = "networkid"; + public static final String NETWORK_IDS = "networkids"; + public static final String NETWORK_KBS_READ = "networkkbsread"; + public static final String NETWORK_KBS_WRITE = "networkkbswrite"; + public static final String NETWORK_OFFERING = "networkoffering"; + public static final String NETWORK_OFFERING_AVAILABILITY = "networkofferingavailability"; + public static final String NETWORK_OFFERING_DISPLAY_TEXT = "networkofferingdisplaytext"; + public static final String NETWORK_OFFERING_ID = "networkofferingid"; + public static final String NETWORK_OFFERING_NAME = "networkofferingname"; + public static final String NETWORK_TYPE = "networktype"; + public static final String NETWORKRATE = "networkrate"; + public static final String NEW_NAME = "newname"; + public static final String NIC = "nic"; + public static final String NUM_RETRIES = "numretries"; + public static final String OFFER_HA = "offerha"; + public static final String OP = "op"; + public static final String OS_CATEGORY = "oscategory"; + public static final String OS_CATEGORY_ID = "oscategoryid"; + public static final String OS_TYPE = "ostype"; + public static final String OS_TYPE_ID = "ostypeid"; + public static final String OS_TYPE_NAME = "ostypename"; + public static final String PAGE = "page"; + public static final String PAGE_SIZE = "pagesize"; + public static final String PARENT_DOMAIN_ID = "parentdomainid"; + public static final String PARENT_ID = "parentid"; + public static final String PASSWORD = "password"; + public static final String PASSWORD_ENABLED = "passwordenabled"; + public static final String PATH = "path"; + public static final String POD_ID = "podid"; + public static final String POLICY_ID = "policyid"; + public static final String PORT_FORWARDING_RULE = "portforwardingrule"; + public static final String PORT_FORWARDING_SERVICE_ID = "portforwardingserviceid"; + public static final String PORTAL = "portal"; + public static final String PRIVATE_END_PORT = "privateendport"; + public static final String PRIVATE_INTERFACE = "privateinterface"; + public static final String PRIVATE_IP = "privateip"; + public static final String PRIVATE_KEY = "privatekey"; + public static final String PRIVATE_MAC_ADDRESS = "privatemacaddress"; + public static final String PRIVATE_NETMASK = "privatenetmask"; + public static final String PRIVATE_NETWORK_ID = "privatenetworkid"; + public static final String PRIVATE_PORT = "privateport"; + public static final String PRIVATE_ZONE = "privatezone"; + public static final String PROTOCOL = "protocol"; + public static final String PUBLIC_END_PORT = "publicendport"; + public static final String PUBLIC_INTERFACE = "publicinterface"; + public static final String PUBLIC_IP = "publicip"; + public static final String PUBLIC_IP_ADDRESS = "publicipaddress"; + public static final String PUBLIC_IP_ID = "publicipid"; + public static final String PUBLIC_KEY = "publickey"; + public static final String PUBLIC_PORT = "publicport"; + public static final String PUBLIC_ZONE = "publiczone"; + public static final String PXE_SERVER_TYPE = "pxeservertype"; + public static final String REBOOT_VIRTUAL_MACHINE = "rebootVirtualMachine"; + public static final String REBOOT_VIRTUAL_MACHINE_RESPONSE = "rebootvirtualmachineresponse"; + public static final String RECEIVED_BYTES = "receivedbytes"; + public static final String REGISTER_ISO = "registerIso"; + public static final String REGISTER_ISO_RESPONSE = "registerisoresponse"; + public static final String REGISTER_SSH_KEY_PAIR = "registerSSHKeyPair"; + public static final String REGISTER_SSH_KEY_PAIR_RESPONSE = "registersshkeypairresponse"; + public static final String REGISTER_TEMPLATE = "registerTemplate"; + public static final String REGISTER_TEMPLATE_RESPONSE = "registertemplateresponse"; + public static final String RELATED = "related"; + public static final String REMOVE_FROM_LOAD_BALANCER_RULE = "removeFromLoadBalancerRule"; + public static final String REMOVE_FROM_LOAD_BALANCER_RULE_RESPONSE = "removefromloadbalancerruleresponse"; + public static final String REMOVED = "removed"; + public static final String REQUIRES_HVM = "requireshvm"; + public static final String RESET_PASSWORD_FOR_VIRTUAL_MACHINE = "resetPasswordForVirtualMachine"; + public static final String RESET_PASSWORD_FOR_VIRTUAL_MACHINE_RESPONSE = "resetpasswordforvirtualmachineresponse"; + public static final String RESOURCE_LIMIT = "resourcelimit"; + public static final String RESOURCE_TYPE = "resourcetype"; + public static final String RESTART_NETWORK = "restartNetwork"; + public static final String RESTART_NETWORK_RESPONSE = "restartnetworkresponse"; + public static final String REVOKE_SECURITY_GROUP_INGRESS = "revokeSecurityGroupIngress"; + public static final String REVOKE_SECURITY_GROUP_INGRESS_RESPONSE = "revokesecuritygroupingress"; + public static final String ROOT_DEVICE_ID = "rootdeviceid"; + public static final String ROOT_DEVICE_TYPE = "rootdevicetype"; + public static final String RULE_ID = "ruleid"; + public static final String SCHEDULE = "schedule"; + public static final String SCOPE = "scope"; + public static final String SECRET_KEY = "secretkey"; + public static final String SECURITY_GROUP = "securitygroup"; + public static final String SECURITY_GROUP_ENABLED = "securitygroupenabled"; + public static final String SECURITY_GROUP_ID = "securitygroupid"; + public static final String SECURITY_GROUP_IDS = "securitygroupids"; + public static final String SECURITY_GROUP_NAME = "securitygroupname"; + public static final String SECURITY_GROUP_NAMES = "securitygroupnames"; + public static final String SECURITY_GROUPS_ENABLED = "securitygroupsenabled"; + public static final String SENT = "sent"; + public static final String SENT_BYTES = "sentbytes"; + public static final String SERVICE = "service"; + public static final String SERVICE_OFFERING = "serviceoffering"; + public static final String SERVICE_OFFERING_DISPLAY_TEXT = "serviceofferingdisplaytext"; + public static final String SERVICE_OFFERING_ID = "serviceofferingid"; + public static final String SERVICE_OFFERING_NAME = "serviceofferingname"; + public static final String SIGNATURE = "signature"; + public static final String SIZE = "size"; + public static final String SNAPSHOT = "snapshot"; + public static final String SNAPSHOT_AVAILABLE = "snapshotavailable"; + public static final String SNAPSHOT_ID = "snapshotid"; + public static final String SNAPSHOT_LIMIT = "snapshotlimit"; + public static final String SNAPSHOT_POLICY_ID = "snapshotpolicyid"; + public static final String SNAPSHOT_TOTAL = "snapshottotal"; + public static final String SNAPSHOT_TYPE = "snapshottype"; + public static final String SOURCE_TEMPLATE_ID = "sourcetemplateid"; + public static final String SOURCE_ZONE_ID = "sourcezoneid"; + public static final String SPECIFY_VLAN = "specifyvlan"; + public static final String SSH_KEYPAIR = "keypair"; + public static final String START_DATE = "startdate"; + public static final String START_IP = "startip"; + public static final String START_PORT = "startport"; + public static final String START_VIRTUAL_MACHINE = "startVirtualMachine"; + public static final String START_VIRTUAL_MACHINE_RESPONSE = "startvirtualmachineresponse"; + public static final String STATE = "state"; + public static final String STATUS = "status"; + public static final String STOP_VIRTUAL_MACHINE = "stopVirtualMachine"; + public static final String STOP_VIRTUAL_MACHINE_RESPONSE = "stopvirtualmachineresponse"; + public static final String STORAGE = "storage"; + public static final String STORAGE_ID="storageid"; + public static final String STORAGE_TYPE = "storagetype"; + public static final String SUCCESS = "success"; + public static final String SYSTEM_VM_TYPE = "systemvmtype"; + public static final String TAGS = "tags"; + public static final String TARGET_IQN = "targetiqn"; + public static final String TEMPLATE = "template"; + public static final String TEMPLATE_AVAILABLE = "templateavailable"; + public static final String TEMPLATE_DISPLAY_TEXT = "templatedisplaytext"; + public static final String TEMPLATE_FILTER = "templatefilter"; + public static final String TEMPLATE_ID = "templateid"; + public static final String TEMPLATE_LIMIT = "templatelimit"; + public static final String TEMPLATE_NAME = "templatename"; + public static final String TEMPLATE_PERMISSION = "templatepermission"; + public static final String TEMPLATE_TOTAL = "templatetotal"; + public static final String TEMPLATE_TYPE = "templatetype"; + public static final String TIMEOUT = "timeout"; + public static final String TIMEZONE = "timezone"; + public static final String TRAFFIC_TYPE = "traffictype"; + public static final String TYPE = "type"; + public static final String UPDATE_INSTANCE_GROUP = "updateInstanceGroup"; + public static final String UPDATE_INSTANCE_GROUP_RESPONSE = "updateinstancegroupresponse"; + public static final String UPDATE_ISO = "updateIso"; + public static final String UPDATE_ISO_PERMISSIONS = "updateIsoPermissions"; + public static final String UPDATE_ISO_PERMISSIONS_RESPONSE = "updateisopermissionsresponse"; + public static final String UPDATE_ISO_RESPONSE = "updateisoresponse"; + public static final String UPDATE_LOAD_BALANCER_RULE = "updateLoadBalancerRule"; + public static final String UPDATE_LOAD_BALANCER_RULE_RESPONSE = "updateloadbalancerruleresponse"; + public static final String UPDATE_NETWORK = "updateNetwork"; + public static final String UPDATE_NETWORK_RESPONSE = "updatenetworkresponse"; + public static final String UPDATE_TEMPLATE = "updateTemplate"; + public static final String UPDATE_TEMPLATE_PERMISSIONS = "updateTemplatePermissions"; + public static final String UPDATE_TEMPLATE_PERMISSIONS_RESPONSE = "updatetemplatepermissionsresponse"; + public static final String UPDATE_TEMPLATE_RESPONSE = "updatetemplateresponse"; + public static final String UPDATE_VIRTUAL_MACHINE = "updateVirtualMachine"; + public static final String UPDATE_VIRTUAL_MACHINE_RESPONSE = "updatevirtualmachineresponse"; + public static final String UPLOAD_PERCENTAGE = "uploadpercentage"; + public static final String URL = "url"; + public static final String USAGE_INTERFACE = "usageinterface"; + public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork"; + public static final String USER = "user"; + public static final String USER_DATA = "userdata"; + public static final String USER_ID = "userid"; + public static final String USER_PUBLIC_TEMPLATE_ENABLED = "userpublictemplateenabled"; + public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist"; + public static final String USERNAME = "username"; + public static final String VALUE = "value"; + public static final String VIRTUAL_MACHINE = "virtualmachine"; + public static final String VIRTUAL_MACHINE_DISPLAY_NAME = "virtualmachinedisplayname"; + public static final String VIRTUAL_MACHINE_ID = "virtualmachineid"; + public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids"; + public static final String VIRTUAL_MACHINE_NAME = "virtualmachinename"; + public static final String VLAN = "vlan"; + public static final String VLAN_ID = "vlanid"; + public static final String VLAN_NAME = "vlanname"; + public static final String VM_AVAILABLE = "vmavailable"; + public static final String VM_DISPLAY_NAME = "vmdisplayname"; + public static final String VM_LIMIT = "vmlimit"; + public static final String VM_NAME = "vmname"; + public static final String VM_RUNNING = "vmrunning"; + public static final String VM_STATE = "vmstate"; + public static final String VM_STOPPED = "vmstopped"; + public static final String VM_TOTAL = "vmtotal"; + public static final String VNET = "vnet"; + public static final String VOLUME = "volume"; + public static final String VOLUME_AVAILABLE = "volumeavailable"; + public static final String VOLUME_ID = "volumeid"; + public static final String VOLUME_LIMIT = "volumelimit"; + public static final String VOLUME_NAME = "volumename"; + public static final String VOLUME_TOTAL = "volumetotal"; + public static final String VOLUME_TYPE = "volumetype"; + public static final String ZONE = "zone"; + public static final String ZONE_ID = "zoneid"; + public static final String ZONE_NAME = "zonename"; + public static final String ZONE_TOKEN = "zonetoken"; + +} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackAccount.hbm.xml b/awsapi/src/com/cloud/stack/models/CloudStackAccount.hbm.xml index 9e3c005d77a..781c677986c 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackAccount.hbm.xml +++ b/awsapi/src/com/cloud/stack/models/CloudStackAccount.hbm.xml @@ -1,16 +1,16 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/stack/models/CloudStackAccount.java b/awsapi/src/com/cloud/stack/models/CloudStackAccount.java index a9e35cbfaad..633337bf3a0 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackAccount.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackAccount.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackCapabilities.java b/awsapi/src/com/cloud/stack/models/CloudStackCapabilities.java index dd75f43d192..c4dbff9f2a8 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackCapabilities.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackCapabilities.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.hbm.xml b/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.hbm.xml index e644eb0da56..33f84e1c1d7 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.hbm.xml +++ b/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.hbm.xml @@ -1,19 +1,19 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.java b/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.java index 99237f4c70e..323a85fd229 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.java @@ -1,56 +1,72 @@ -package com.cloud.stack.models; - -import java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackConfiguration implements Serializable { - - private static final long serialVersionUID = 1L; - - @SerializedName(ApiConstants.CATEGORY) - private String category; - - @SerializedName(ApiConstants.NAME) - private String name; - - @SerializedName(ApiConstants.VALUE) - private String value; - - @SerializedName(ApiConstants.DESCRIPTION) - private String description; - - public String getCategory() { - return category; - } - - public void setCategory(String category) { - this.category = category; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.stack.models; + +import java.io.Serializable; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackConfiguration implements Serializable { + + private static final long serialVersionUID = 1L; + + @SerializedName(ApiConstants.CATEGORY) + private String category; + + @SerializedName(ApiConstants.NAME) + private String name; + + @SerializedName(ApiConstants.VALUE) + private String value; + + @SerializedName(ApiConstants.DESCRIPTION) + private String description; + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + +} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackDiskOffering.java b/awsapi/src/com/cloud/stack/models/CloudStackDiskOffering.java index 489a88799ec..9c51070e06d 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackDiskOffering.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackDiskOffering.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackEvent.java b/awsapi/src/com/cloud/stack/models/CloudStackEvent.java index 6897c5d43bd..96073a271d4 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackEvent.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackEvent.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackEventType.java b/awsapi/src/com/cloud/stack/models/CloudStackEventType.java index aa076b1a74d..b01fba8592d 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackEventType.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackEventType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackExtractTemplate.java b/awsapi/src/com/cloud/stack/models/CloudStackExtractTemplate.java index f0ce590bb2d..5841572dba7 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackExtractTemplate.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackExtractTemplate.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackIdentifier.java b/awsapi/src/com/cloud/stack/models/CloudStackIdentifier.java index 2370ce6edc6..e893c5d6f49 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackIdentifier.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackIdentifier.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackInfoResponse.java b/awsapi/src/com/cloud/stack/models/CloudStackInfoResponse.java index 580f75c63e1..147bfa92232 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackInfoResponse.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackInfoResponse.java @@ -1,58 +1,74 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackInfoResponse { - @SerializedName(ApiConstants.SUCCESS) - private Boolean success; - - @SerializedName(ApiConstants.DISPLAY_TEXT) - private String displayText; - - @SerializedName(ApiConstants.STATUS) - private Boolean status; - - @SerializedName(ApiConstants.JOB_ID) - private Long jobId; - - @SerializedName(ApiConstants.ID) - private Long id; - - public CloudStackInfoResponse() { - } - - public Boolean getSuccess() { - return success; - } - - public String getDisplayText() { - return displayText; - } - - public Boolean getStatus() { - return status; - } - - public Long getJobId() { - return jobId; - } - - public Long getId() { - return id; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackInfoResponse { + @SerializedName(ApiConstants.SUCCESS) + private Boolean success; + + @SerializedName(ApiConstants.DISPLAY_TEXT) + private String displayText; + + @SerializedName(ApiConstants.STATUS) + private Boolean status; + + @SerializedName(ApiConstants.JOB_ID) + private Long jobId; + + @SerializedName(ApiConstants.ID) + private Long id; + + public CloudStackInfoResponse() { + } + + public Boolean getSuccess() { + return success; + } + + public String getDisplayText() { + return displayText; + } + + public Boolean getStatus() { + return status; + } + + public Long getJobId() { + return jobId; + } + + public Long getId() { + return id; + } +} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackIngressRule.java b/awsapi/src/com/cloud/stack/models/CloudStackIngressRule.java index 4f54114e8fc..de6e1021f79 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackIngressRule.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackIngressRule.java @@ -1,87 +1,103 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackIngressRule { - - @SerializedName(ApiConstants.RULE_ID) - private String ruleId; - - @SerializedName(ApiConstants.PROTOCOL) - private String protocol; - - @SerializedName(ApiConstants.ICMP_TYPE) - private Integer icmpType; - - @SerializedName(ApiConstants.ICMP_CODE) - private Integer icmpCode; - - @SerializedName(ApiConstants.START_PORT) - private Integer startPort; - - @SerializedName(ApiConstants.END_PORT) - private Integer endPort; - - @SerializedName(ApiConstants.SECURITY_GROUP_NAME) - private String securityGroupName; - - @SerializedName(ApiConstants.ACCOUNT) - private String accountName; - - @SerializedName(ApiConstants.CIDR) - private String cidr; - - public CloudStackIngressRule() { - } - - public String getRuleId() { - return ruleId; - } - - public String getProtocol() { - return protocol; - } - - public Integer getIcmpType() { - return icmpType; - } - - public Integer getIcmpCode() { - return icmpCode; - } - - public Integer getStartPort() { - return startPort; - } - - public Integer getEndPort() { - return endPort; - } - - public String getSecurityGroupName() { - return securityGroupName; - } - - public String getAccountName() { - return accountName; - } - - public String getCidr() { - return cidr; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackIngressRule { + + @SerializedName(ApiConstants.RULE_ID) + private String ruleId; + + @SerializedName(ApiConstants.PROTOCOL) + private String protocol; + + @SerializedName(ApiConstants.ICMP_TYPE) + private Integer icmpType; + + @SerializedName(ApiConstants.ICMP_CODE) + private Integer icmpCode; + + @SerializedName(ApiConstants.START_PORT) + private Integer startPort; + + @SerializedName(ApiConstants.END_PORT) + private Integer endPort; + + @SerializedName(ApiConstants.SECURITY_GROUP_NAME) + private String securityGroupName; + + @SerializedName(ApiConstants.ACCOUNT) + private String accountName; + + @SerializedName(ApiConstants.CIDR) + private String cidr; + + public CloudStackIngressRule() { + } + + public String getRuleId() { + return ruleId; + } + + public String getProtocol() { + return protocol; + } + + public Integer getIcmpType() { + return icmpType; + } + + public Integer getIcmpCode() { + return icmpCode; + } + + public Integer getStartPort() { + return startPort; + } + + public Integer getEndPort() { + return endPort; + } + + public String getSecurityGroupName() { + return securityGroupName; + } + + public String getAccountName() { + return accountName; + } + + public String getCidr() { + return cidr; + } +} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackInstanceGroup.java b/awsapi/src/com/cloud/stack/models/CloudStackInstanceGroup.java index 8793434ce09..b42a776ef15 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackInstanceGroup.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackInstanceGroup.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackIpAddress.java b/awsapi/src/com/cloud/stack/models/CloudStackIpAddress.java index d89e2a62fbf..f02817d9349 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackIpAddress.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackIpAddress.java @@ -1,151 +1,167 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackIpAddress { - - @SerializedName(ApiConstants.ID) - private String id; - @SerializedName(ApiConstants.ACCOUNT) - private String accountName; - @SerializedName(ApiConstants.ALLOCATED) - private String allocated; - @SerializedName(ApiConstants.ASSOCIATED_NETWORK_ID) - private String associatedNetworkId; - @SerializedName(ApiConstants.DOMAIN) - private String domainName; - @SerializedName(ApiConstants.DOMAIN_ID) - private String domainId; - @SerializedName(ApiConstants.FOR_VIRTUAL_NETWORK) - private Boolean forVirtualNetwork; - @SerializedName(ApiConstants.IP_ADDRESS) - private String ipAddress; - @SerializedName(ApiConstants.IS_SOURCE_NAT) - private Boolean sourceNat; - @SerializedName(ApiConstants.IS_STATIC_NAT) - private Boolean staticNat; - @SerializedName(ApiConstants.JOB_ID) - private String jobId; - @SerializedName(ApiConstants.JOB_STATUS) - private Integer jobStatus; - @SerializedName(ApiConstants.NETWORK_ID) - private String networkId; - @SerializedName(ApiConstants.STATE) - private String state; - @SerializedName(ApiConstants.VIRTUAL_MACHINE_DISPLAY_NAME) - private String virtualMachineDisplayName; - @SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) - private String virtualMachineId; - @SerializedName(ApiConstants.VIRTUAL_MACHINE_NAME) - private String virtualMachineName; - @SerializedName(ApiConstants.VLAN_ID) - private String vlanId; - @SerializedName(ApiConstants.VLAN_NAME) - private String vlanName; - @SerializedName(ApiConstants.ZONE_ID) - private String zoneId; - @SerializedName(ApiConstants.ZONE_NAME) - private String zoneName; - - public CloudStackIpAddress() { - } - - public String getId() { - return id; - } - - public String getIpAddress() { - return ipAddress; - } - - public String getAllocated() { - return allocated; - } - - public String getZoneId() { - return zoneId; - } - - public String getZoneName() { - return zoneName; - } - - public Boolean getSourceNat() { - return sourceNat; - } - - public String getAccountName() { - return accountName; - } - - public String getDomainId() { - return domainId; - } - - public String getDomainName() { - return domainName; - } - - public Boolean getForVirtualNetwork() { - return forVirtualNetwork; - } - - public String getVlanId() { - return vlanId; - } - - public String getVlanName() { - return vlanName; - } - - public Boolean getStaticNat() { - return staticNat; - } - - public String getVirtualMachineId() { - return virtualMachineId; - } - - public String getVirtualMachineName() { - return virtualMachineName; - } - - public String getVirtualMachineDisplayName() { - return virtualMachineDisplayName; - } - - public String getAssociatedNetworkId() { - return associatedNetworkId; - } - - public String getNetworkId() { - return networkId; - } - - public String getState() { - return state; - } - - public String getJobId() { - return jobId; - } - - public Integer getJobStatus() { - return jobStatus; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackIpAddress { + + @SerializedName(ApiConstants.ID) + private String id; + @SerializedName(ApiConstants.ACCOUNT) + private String accountName; + @SerializedName(ApiConstants.ALLOCATED) + private String allocated; + @SerializedName(ApiConstants.ASSOCIATED_NETWORK_ID) + private String associatedNetworkId; + @SerializedName(ApiConstants.DOMAIN) + private String domainName; + @SerializedName(ApiConstants.DOMAIN_ID) + private String domainId; + @SerializedName(ApiConstants.FOR_VIRTUAL_NETWORK) + private Boolean forVirtualNetwork; + @SerializedName(ApiConstants.IP_ADDRESS) + private String ipAddress; + @SerializedName(ApiConstants.IS_SOURCE_NAT) + private Boolean sourceNat; + @SerializedName(ApiConstants.IS_STATIC_NAT) + private Boolean staticNat; + @SerializedName(ApiConstants.JOB_ID) + private String jobId; + @SerializedName(ApiConstants.JOB_STATUS) + private Integer jobStatus; + @SerializedName(ApiConstants.NETWORK_ID) + private String networkId; + @SerializedName(ApiConstants.STATE) + private String state; + @SerializedName(ApiConstants.VIRTUAL_MACHINE_DISPLAY_NAME) + private String virtualMachineDisplayName; + @SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) + private String virtualMachineId; + @SerializedName(ApiConstants.VIRTUAL_MACHINE_NAME) + private String virtualMachineName; + @SerializedName(ApiConstants.VLAN_ID) + private String vlanId; + @SerializedName(ApiConstants.VLAN_NAME) + private String vlanName; + @SerializedName(ApiConstants.ZONE_ID) + private String zoneId; + @SerializedName(ApiConstants.ZONE_NAME) + private String zoneName; + + public CloudStackIpAddress() { + } + + public String getId() { + return id; + } + + public String getIpAddress() { + return ipAddress; + } + + public String getAllocated() { + return allocated; + } + + public String getZoneId() { + return zoneId; + } + + public String getZoneName() { + return zoneName; + } + + public Boolean getSourceNat() { + return sourceNat; + } + + public String getAccountName() { + return accountName; + } + + public String getDomainId() { + return domainId; + } + + public String getDomainName() { + return domainName; + } + + public Boolean getForVirtualNetwork() { + return forVirtualNetwork; + } + + public String getVlanId() { + return vlanId; + } + + public String getVlanName() { + return vlanName; + } + + public Boolean getStaticNat() { + return staticNat; + } + + public String getVirtualMachineId() { + return virtualMachineId; + } + + public String getVirtualMachineName() { + return virtualMachineName; + } + + public String getVirtualMachineDisplayName() { + return virtualMachineDisplayName; + } + + public String getAssociatedNetworkId() { + return associatedNetworkId; + } + + public String getNetworkId() { + return networkId; + } + + public String getState() { + return state; + } + + public String getJobId() { + return jobId; + } + + public Integer getJobStatus() { + return jobStatus; + } +} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackKeyPair.java b/awsapi/src/com/cloud/stack/models/CloudStackKeyPair.java index 5f3c20af81e..cadf46fc983 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackKeyPair.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackKeyPair.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackKeyValue.java b/awsapi/src/com/cloud/stack/models/CloudStackKeyValue.java index 98d422caf3d..132d830eb6b 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackKeyValue.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackKeyValue.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackLoadBalancerRule.java b/awsapi/src/com/cloud/stack/models/CloudStackLoadBalancerRule.java index 1a95e060078..180eafacc82 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackLoadBalancerRule.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackLoadBalancerRule.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackNetwork.java b/awsapi/src/com/cloud/stack/models/CloudStackNetwork.java index 978d77e3c42..e175065fc7a 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackNetwork.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackNetwork.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackNetworkOffering.java b/awsapi/src/com/cloud/stack/models/CloudStackNetworkOffering.java index d1c6f961513..e9f41ceec3a 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackNetworkOffering.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackNetworkOffering.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackNetworkService.java b/awsapi/src/com/cloud/stack/models/CloudStackNetworkService.java index b2e21f2abec..e4ee48bf050 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackNetworkService.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackNetworkService.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackNetworkServiceCapability.java b/awsapi/src/com/cloud/stack/models/CloudStackNetworkServiceCapability.java index 573e91512ec..c9781308350 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackNetworkServiceCapability.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackNetworkServiceCapability.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackNic.java b/awsapi/src/com/cloud/stack/models/CloudStackNic.java index f6156eec2d9..e910e903600 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackNic.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackNic.java @@ -1,104 +1,120 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackNic { - - @SerializedName(ApiConstants.ID) - private String id; - - @SerializedName(ApiConstants.BROADCAST_URI) - private String broadcastUri; - - @SerializedName(ApiConstants.GATEWAY) - private String gateway; - - @SerializedName(ApiConstants.IP_ADDRESS) - private String ipaddress; - - @SerializedName(ApiConstants.IS_DEFAULT) - private Boolean isDefault; - - @SerializedName(ApiConstants.ISOLATION_URI) - private String isolationUri; - - @SerializedName(ApiConstants.MAC_ADDRESS) - private String macAddress; - - @SerializedName(ApiConstants.NETMASK) - private String netmask; - - @SerializedName(ApiConstants.NETWORK_ID) - private String networkid; - - @SerializedName(ApiConstants.TRAFFIC_TYPE) - private String trafficType; - - @SerializedName(ApiConstants.TYPE) - private String type; - - public CloudStackNic() { - } - - public String getId() { - return id; - } - - public String getNetworkid() { - return networkid; - } - - public String getNetmask() { - return netmask; - } - - public String getGateway() { - return gateway; - } - - public String getIpaddress() { - return ipaddress; - } - - public String getIsolationUri() { - return isolationUri; - } - - public String getBroadcastUri() { - return broadcastUri; - } - - public String getTrafficType() { - return trafficType; - } - - public String getType() { - return type; - } - - public Boolean getIsDefault() { - return isDefault; - } - - /** - * @return the macAddress - */ - public String getMacAddress() { - return macAddress; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackNic { + + @SerializedName(ApiConstants.ID) + private String id; + + @SerializedName(ApiConstants.BROADCAST_URI) + private String broadcastUri; + + @SerializedName(ApiConstants.GATEWAY) + private String gateway; + + @SerializedName(ApiConstants.IP_ADDRESS) + private String ipaddress; + + @SerializedName(ApiConstants.IS_DEFAULT) + private Boolean isDefault; + + @SerializedName(ApiConstants.ISOLATION_URI) + private String isolationUri; + + @SerializedName(ApiConstants.MAC_ADDRESS) + private String macAddress; + + @SerializedName(ApiConstants.NETMASK) + private String netmask; + + @SerializedName(ApiConstants.NETWORK_ID) + private String networkid; + + @SerializedName(ApiConstants.TRAFFIC_TYPE) + private String trafficType; + + @SerializedName(ApiConstants.TYPE) + private String type; + + public CloudStackNic() { + } + + public String getId() { + return id; + } + + public String getNetworkid() { + return networkid; + } + + public String getNetmask() { + return netmask; + } + + public String getGateway() { + return gateway; + } + + public String getIpaddress() { + return ipaddress; + } + + public String getIsolationUri() { + return isolationUri; + } + + public String getBroadcastUri() { + return broadcastUri; + } + + public String getTrafficType() { + return trafficType; + } + + public String getType() { + return type; + } + + public Boolean getIsDefault() { + return isDefault; + } + + /** + * @return the macAddress + */ + public String getMacAddress() { + return macAddress; + } +} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackOsCategory.java b/awsapi/src/com/cloud/stack/models/CloudStackOsCategory.java index ffefa83bfd7..2f441020378 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackOsCategory.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackOsCategory.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackOsType.java b/awsapi/src/com/cloud/stack/models/CloudStackOsType.java index 29ca6d0db7a..9a74ade87e7 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackOsType.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackOsType.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackPasswordData.java b/awsapi/src/com/cloud/stack/models/CloudStackPasswordData.java index 434d70bd6b3..49d506c79a1 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackPasswordData.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackPasswordData.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackPortForwardingRule.java b/awsapi/src/com/cloud/stack/models/CloudStackPortForwardingRule.java index 208f32dae07..3f57952b074 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackPortForwardingRule.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackPortForwardingRule.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackResourceLimit.java b/awsapi/src/com/cloud/stack/models/CloudStackResourceLimit.java index 1f9bd677d6c..6a654806fea 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackResourceLimit.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackResourceLimit.java @@ -1,55 +1,71 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackResourceLimit { - @SerializedName(ApiConstants.ACCOUNT) - private String accountName; - @SerializedName(ApiConstants.DOMAIN_ID) - private String domainId; - @SerializedName(ApiConstants.DOMAIN) - private String domainName; - @SerializedName(ApiConstants.RESOURCE_TYPE) - private String resourceType; - @SerializedName(ApiConstants.MAX) - private Long max; - - - public CloudStackResourceLimit() { - } - - public String getAccountName() { - return accountName; - } - - public String getDomainId() { - return domainId; - } - - public String getDomainName() { - return domainName; - } - - public String getResourceType() { - return resourceType; - } - - public Long getMax() { - return max; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackResourceLimit { + @SerializedName(ApiConstants.ACCOUNT) + private String accountName; + @SerializedName(ApiConstants.DOMAIN_ID) + private String domainId; + @SerializedName(ApiConstants.DOMAIN) + private String domainName; + @SerializedName(ApiConstants.RESOURCE_TYPE) + private String resourceType; + @SerializedName(ApiConstants.MAX) + private Long max; + + + public CloudStackResourceLimit() { + } + + public String getAccountName() { + return accountName; + } + + public String getDomainId() { + return domainId; + } + + public String getDomainName() { + return domainName; + } + + public String getResourceType() { + return resourceType; + } + + public Long getMax() { + return max; + } +} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroup.java b/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroup.java index b978ef8f56a..c0922068675 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroup.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroup.java @@ -1,81 +1,97 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -import java.util.List; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackSecurityGroup { - @SerializedName(ApiConstants.ID) - private String id; - @SerializedName(ApiConstants.ACCOUNT) - private String accountName; - @SerializedName(ApiConstants.DESCRIPTION) - private String description; - @SerializedName(ApiConstants.DOMAIN) - private String domainName; - @SerializedName(ApiConstants.DOMAIN_ID) - private String domainId; - @SerializedName(ApiConstants.JOB_ID) - private String jobId; - @SerializedName(ApiConstants.JOB_STATUS) - private Integer jobStatus; - @SerializedName(ApiConstants.NAME) - private String name; - @SerializedName(ApiConstants.INGRESS_RULE) - private List ingressRules; - - - public CloudStackSecurityGroup() { - } - - public String getId() { - return id; - } - - public String getName() { - return name; - } - - public String getDescription() { - return description; - } - - public String getAccountName() { - return accountName; - } - - public String getDomainId() { - return domainId; - } - - public String getDomainName() { - return domainName; - } - - public String getJobId() { - return jobId; - } - - public Integer getJobStatus() { - return jobStatus; - } - - public List getIngressRules() { - return ingressRules; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackSecurityGroup { + @SerializedName(ApiConstants.ID) + private String id; + @SerializedName(ApiConstants.ACCOUNT) + private String accountName; + @SerializedName(ApiConstants.DESCRIPTION) + private String description; + @SerializedName(ApiConstants.DOMAIN) + private String domainName; + @SerializedName(ApiConstants.DOMAIN_ID) + private String domainId; + @SerializedName(ApiConstants.JOB_ID) + private String jobId; + @SerializedName(ApiConstants.JOB_STATUS) + private Integer jobStatus; + @SerializedName(ApiConstants.NAME) + private String name; + @SerializedName(ApiConstants.INGRESS_RULE) + private List ingressRules; + + + public CloudStackSecurityGroup() { + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getAccountName() { + return accountName; + } + + public String getDomainId() { + return domainId; + } + + public String getDomainName() { + return domainName; + } + + public String getJobId() { + return jobId; + } + + public Integer getJobStatus() { + return jobStatus; + } + + public List getIngressRules() { + return ingressRules; + } +} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroupIngress.java b/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroupIngress.java index f4d4291637a..987e608045f 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroupIngress.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackSecurityGroupIngress.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.hbm.xml b/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.hbm.xml index f3c5d4d17f3..f8c9eed270f 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.hbm.xml +++ b/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.hbm.xml @@ -1,16 +1,16 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.java b/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.java index 9dde25a553a..b914184b338 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackSnapshot.java b/awsapi/src/com/cloud/stack/models/CloudStackSnapshot.java index a43ff55409a..1a2e53fbdf3 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackSnapshot.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackSnapshot.java @@ -1,108 +1,124 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackSnapshot { - @SerializedName(ApiConstants.ID) - private String id; - @SerializedName(ApiConstants.ACCOUNT) - private String accountName; - @SerializedName(ApiConstants.CREATED) - private String created; - @SerializedName(ApiConstants.DOMAIN) - private String domainName; - @SerializedName(ApiConstants.DOMAIN_ID) - private String domainId; - @SerializedName(ApiConstants.INTERVAL_TYPE) - private String intervalType; - @SerializedName(ApiConstants.JOB_ID) - private String jobId; - @SerializedName(ApiConstants.JOB_STATUS) - private Integer jobStatus; - @SerializedName(ApiConstants.NAME) - private String name; - @SerializedName(ApiConstants.SNAPSHOT_TYPE) - private String snapshotType; - @SerializedName(ApiConstants.STATE) - private String state; - @SerializedName(ApiConstants.VOLUME_ID) - private String volumeId; - @SerializedName(ApiConstants.VOLUME_NAME) - private String volumeName; - @SerializedName(ApiConstants.VOLUME_TYPE) - private String volumeType; - - public CloudStackSnapshot() { - } - - public String getId() { - return id; - } - - public String getAccountName() { - return accountName; - } - - public String getDomainId() { - return domainId; - } - - public String getDomainName() { - return domainName; - } - - public String getSnapshotType() { - return snapshotType; - } - - public String getVolumeId() { - return volumeId; - } - - public String getVolumeName() { - return volumeName; - } - - public String getVolumeType() { - return volumeType; - } - - public String getCreated() { - return created; - } - - public String getName() { - return name; - } - - public String getJobId() { - return jobId; - } - - public Integer getJobStatus() { - return jobStatus; - } - - public String getIntervalType() { - return intervalType; - } - - public String getState() { - return state; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackSnapshot { + @SerializedName(ApiConstants.ID) + private String id; + @SerializedName(ApiConstants.ACCOUNT) + private String accountName; + @SerializedName(ApiConstants.CREATED) + private String created; + @SerializedName(ApiConstants.DOMAIN) + private String domainName; + @SerializedName(ApiConstants.DOMAIN_ID) + private String domainId; + @SerializedName(ApiConstants.INTERVAL_TYPE) + private String intervalType; + @SerializedName(ApiConstants.JOB_ID) + private String jobId; + @SerializedName(ApiConstants.JOB_STATUS) + private Integer jobStatus; + @SerializedName(ApiConstants.NAME) + private String name; + @SerializedName(ApiConstants.SNAPSHOT_TYPE) + private String snapshotType; + @SerializedName(ApiConstants.STATE) + private String state; + @SerializedName(ApiConstants.VOLUME_ID) + private String volumeId; + @SerializedName(ApiConstants.VOLUME_NAME) + private String volumeName; + @SerializedName(ApiConstants.VOLUME_TYPE) + private String volumeType; + + public CloudStackSnapshot() { + } + + public String getId() { + return id; + } + + public String getAccountName() { + return accountName; + } + + public String getDomainId() { + return domainId; + } + + public String getDomainName() { + return domainName; + } + + public String getSnapshotType() { + return snapshotType; + } + + public String getVolumeId() { + return volumeId; + } + + public String getVolumeName() { + return volumeName; + } + + public String getVolumeType() { + return volumeType; + } + + public String getCreated() { + return created; + } + + public String getName() { + return name; + } + + public String getJobId() { + return jobId; + } + + public Integer getJobStatus() { + return jobStatus; + } + + public String getIntervalType() { + return intervalType; + } + + public String getState() { + return state; + } +} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackSnapshotPolicy.java b/awsapi/src/com/cloud/stack/models/CloudStackSnapshotPolicy.java index 664c9fbccec..a9f883a72c2 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackSnapshotPolicy.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackSnapshotPolicy.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackTemplate.java b/awsapi/src/com/cloud/stack/models/CloudStackTemplate.java index 9cd8e84e753..a0f65e6eeb9 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackTemplate.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackTemplate.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackTemplatePermission.java b/awsapi/src/com/cloud/stack/models/CloudStackTemplatePermission.java index d627dadfaed..aab8774459a 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackTemplatePermission.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackTemplatePermission.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackUser.java b/awsapi/src/com/cloud/stack/models/CloudStackUser.java index d93cb2b10be..f8852b94e34 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackUser.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackUser.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. /* * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. * diff --git a/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java b/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java index bc27e49ff7b..ac8915a2fb6 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java @@ -1,397 +1,413 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -import java.util.List; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackUserVm { - @SerializedName(ApiConstants.ID) - private String id; - @SerializedName(ApiConstants.ACCOUNT) - private String accountName; - @SerializedName(ApiConstants.CPU_NUMBER) - private Integer cpuNumber; - @SerializedName(ApiConstants.CPU_SPEED) - private Integer cpuSpeed; - @SerializedName(ApiConstants.CPU_USED) - private String cpuUsed; - @SerializedName(ApiConstants.CREATED) - private String created; - @SerializedName(ApiConstants.DISPLAY_NAME) - private String displayName; - @SerializedName(ApiConstants.DOMAIN) - private String domainName; - @SerializedName(ApiConstants.DOMAIN_ID) - private String domainId; - @SerializedName(ApiConstants.FOR_VIRTUAL_NETWORK) - private Boolean forVirtualNetwork; - @SerializedName(ApiConstants.GROUP) - private String group; - @SerializedName(ApiConstants.GROUP_ID) - private String groupId; - @SerializedName(ApiConstants.GUEST_OS_ID) - private String guestOsId; - @SerializedName(ApiConstants.HA_ENABLE) - private Boolean haEnable; - @SerializedName(ApiConstants.HOST_ID) - private String hostId; - @SerializedName(ApiConstants.HOST_NAME) - private String hostName; - @SerializedName(ApiConstants.HYPERVISOR) - private String hypervisor; - @SerializedName(ApiConstants.PUBLIC_IP) - private String ipAddress; - @SerializedName(ApiConstants.ISO_DISPLAY_TEXT) - private String isoDisplayText; - @SerializedName(ApiConstants.ISO_ID) - private String isoId; - @SerializedName(ApiConstants.ISO_NAME) - private String isoName; - @SerializedName(ApiConstants.JOB_ID) - private String jobId; - @SerializedName(ApiConstants.JOB_STATUS) - private Integer jobStatus; - @SerializedName(ApiConstants.MEMORY) - private Integer memory; - @SerializedName(ApiConstants.NAME) - private String name; - @SerializedName(ApiConstants.NETWORK_KBS_READ) - private Long networkKbsRead; - @SerializedName(ApiConstants.NETWORK_KBS_WRITE) - private Long networkKbsWrite; - @SerializedName(ApiConstants.PASSWORD) - private String password; - @SerializedName(ApiConstants.PASSWORD_ENABLED) - private Boolean passwordEnabled; - @SerializedName(ApiConstants.ROOT_DEVICE_ID) - private String rootDeviceId; - @SerializedName(ApiConstants.ROOT_DEVICE_TYPE) - private String rootDeviceType; - @SerializedName(ApiConstants.SERVICE_OFFERING_ID) - private String serviceOfferingId; - @SerializedName(ApiConstants.SERVICE_OFFERING_NAME) - private String serviceOfferingName; - @SerializedName(ApiConstants.STATE) - private String state; - @SerializedName(ApiConstants.TEMPLATE_DISPLAY_TEXT) - private String templateDisplayText; - @SerializedName(ApiConstants.TEMPLATE_ID) - private String templateId; - @SerializedName(ApiConstants.TEMPLATE_NAME) - private String templateName; - @SerializedName(ApiConstants.ZONE_ID) - private String zoneId; - @SerializedName(ApiConstants.ZONE_NAME) - private String zoneName; - @SerializedName(ApiConstants.NIC) - private List nics; - @SerializedName(ApiConstants.SECURITY_GROUP) - private List securityGroupList; - - public CloudStackUserVm() { - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @return the accountName - */ - public String getAccountName() { - return accountName; - } - - /** - * @return the cpuNumber - */ - public Integer getCpuNumber() { - return cpuNumber; - } - - /** - * @return the cpuSpeed - */ - public Integer getCpuSpeed() { - return cpuSpeed; - } - - /** - * @return the cpuUsed - */ - public String getCpuUsed() { - return cpuUsed; - } - - /** - * @return the created - */ - public String getCreated() { - return created; - } - - /** - * @return the displayName - */ - public String getDisplayName() { - return displayName; - } - - /** - * @return the domainName - */ - public String getDomainName() { - return domainName; - } - - /** - * @return the domainId - */ - public String getDomainId() { - return domainId; - } - - /** - * @return the forVirtualNetwork - */ - public Boolean getForVirtualNetwork() { - return forVirtualNetwork; - } - - /** - * @return the group - */ - public String getGroup() { - return group; - } - - /** - * @return the groupId - */ - public String getGroupId() { - return groupId; - } - - /** - * @return the guestOsId - */ - public String getGuestOsId() { - return guestOsId; - } - - /** - * @return the haEnable - */ - public Boolean getHaEnable() { - return haEnable; - } - - /** - * @return the hostId - */ - public String getHostId() { - return hostId; - } - - /** - * @return the hostName - */ - public String getHostName() { - return hostName; - } - - /** - * @return the hypervisor - */ - public String getHypervisor() { - return hypervisor; - } - - /** - * @return the ipAddress - */ - public String getIpAddress() { - return ipAddress; - } - - /** - * @return the isoDisplayText - */ - public String getIsoDisplayText() { - return isoDisplayText; - } - - /** - * @return the isoId - */ - public String getIsoId() { - return isoId; - } - - /** - * @return the isoName - */ - public String getIsoName() { - return isoName; - } - - /** - * @return the jobId - */ - public String getJobId() { - return jobId; - } - - /** - * @return the jobStatus - */ - public Integer getJobStatus() { - return jobStatus; - } - - /** - * @return the memory - */ - public Integer getMemory() { - return memory; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @return the networkKbsRead - */ - public Long getNetworkKbsRead() { - return networkKbsRead; - } - - /** - * @return the networkKbsWrite - */ - public Long getNetworkKbsWrite() { - return networkKbsWrite; - } - - /** - * @return the password - */ - public String getPassword() { - return password; - } - - /** - * @return the passwordEnabled - */ - public Boolean getPasswordEnabled() { - return passwordEnabled; - } - - /** - * @return the rootDeviceId - */ - public String getRootDeviceId() { - return rootDeviceId; - } - - /** - * @return the rootDeviceType - */ - public String getRootDeviceType() { - return rootDeviceType; - } - - /** - * @return the serviceOfferingId - */ - public String getServiceOfferingId() { - return serviceOfferingId; - } - - /** - * @return the serviceOfferingName - */ - public String getServiceOfferingName() { - return serviceOfferingName; - } - - /** - * @return the state - */ - public String getState() { - return state; - } - - /** - * @return the templateDisplayText - */ - public String getTemplateDisplayText() { - return templateDisplayText; - } - - /** - * @return the templateId - */ - public String getTemplateId() { - return templateId; - } - - /** - * @return the templateName - */ - public String getTemplateName() { - return templateName; - } - - /** - * @return the zoneId - */ - public String getZoneId() { - return zoneId; - } - - /** - * @return the zoneName - */ - public String getZoneName() { - return zoneName; - } - - /** - * @return the nics - */ - public List getNics() { - return nics; - } - - /** - * @return the securityGroupList - */ - public List getSecurityGroupList() { - return securityGroupList; - } - -} - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackUserVm { + @SerializedName(ApiConstants.ID) + private String id; + @SerializedName(ApiConstants.ACCOUNT) + private String accountName; + @SerializedName(ApiConstants.CPU_NUMBER) + private Integer cpuNumber; + @SerializedName(ApiConstants.CPU_SPEED) + private Integer cpuSpeed; + @SerializedName(ApiConstants.CPU_USED) + private String cpuUsed; + @SerializedName(ApiConstants.CREATED) + private String created; + @SerializedName(ApiConstants.DISPLAY_NAME) + private String displayName; + @SerializedName(ApiConstants.DOMAIN) + private String domainName; + @SerializedName(ApiConstants.DOMAIN_ID) + private String domainId; + @SerializedName(ApiConstants.FOR_VIRTUAL_NETWORK) + private Boolean forVirtualNetwork; + @SerializedName(ApiConstants.GROUP) + private String group; + @SerializedName(ApiConstants.GROUP_ID) + private String groupId; + @SerializedName(ApiConstants.GUEST_OS_ID) + private String guestOsId; + @SerializedName(ApiConstants.HA_ENABLE) + private Boolean haEnable; + @SerializedName(ApiConstants.HOST_ID) + private String hostId; + @SerializedName(ApiConstants.HOST_NAME) + private String hostName; + @SerializedName(ApiConstants.HYPERVISOR) + private String hypervisor; + @SerializedName(ApiConstants.PUBLIC_IP) + private String ipAddress; + @SerializedName(ApiConstants.ISO_DISPLAY_TEXT) + private String isoDisplayText; + @SerializedName(ApiConstants.ISO_ID) + private String isoId; + @SerializedName(ApiConstants.ISO_NAME) + private String isoName; + @SerializedName(ApiConstants.JOB_ID) + private String jobId; + @SerializedName(ApiConstants.JOB_STATUS) + private Integer jobStatus; + @SerializedName(ApiConstants.MEMORY) + private Integer memory; + @SerializedName(ApiConstants.NAME) + private String name; + @SerializedName(ApiConstants.NETWORK_KBS_READ) + private Long networkKbsRead; + @SerializedName(ApiConstants.NETWORK_KBS_WRITE) + private Long networkKbsWrite; + @SerializedName(ApiConstants.PASSWORD) + private String password; + @SerializedName(ApiConstants.PASSWORD_ENABLED) + private Boolean passwordEnabled; + @SerializedName(ApiConstants.ROOT_DEVICE_ID) + private String rootDeviceId; + @SerializedName(ApiConstants.ROOT_DEVICE_TYPE) + private String rootDeviceType; + @SerializedName(ApiConstants.SERVICE_OFFERING_ID) + private String serviceOfferingId; + @SerializedName(ApiConstants.SERVICE_OFFERING_NAME) + private String serviceOfferingName; + @SerializedName(ApiConstants.STATE) + private String state; + @SerializedName(ApiConstants.TEMPLATE_DISPLAY_TEXT) + private String templateDisplayText; + @SerializedName(ApiConstants.TEMPLATE_ID) + private String templateId; + @SerializedName(ApiConstants.TEMPLATE_NAME) + private String templateName; + @SerializedName(ApiConstants.ZONE_ID) + private String zoneId; + @SerializedName(ApiConstants.ZONE_NAME) + private String zoneName; + @SerializedName(ApiConstants.NIC) + private List nics; + @SerializedName(ApiConstants.SECURITY_GROUP) + private List securityGroupList; + + public CloudStackUserVm() { + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the accountName + */ + public String getAccountName() { + return accountName; + } + + /** + * @return the cpuNumber + */ + public Integer getCpuNumber() { + return cpuNumber; + } + + /** + * @return the cpuSpeed + */ + public Integer getCpuSpeed() { + return cpuSpeed; + } + + /** + * @return the cpuUsed + */ + public String getCpuUsed() { + return cpuUsed; + } + + /** + * @return the created + */ + public String getCreated() { + return created; + } + + /** + * @return the displayName + */ + public String getDisplayName() { + return displayName; + } + + /** + * @return the domainName + */ + public String getDomainName() { + return domainName; + } + + /** + * @return the domainId + */ + public String getDomainId() { + return domainId; + } + + /** + * @return the forVirtualNetwork + */ + public Boolean getForVirtualNetwork() { + return forVirtualNetwork; + } + + /** + * @return the group + */ + public String getGroup() { + return group; + } + + /** + * @return the groupId + */ + public String getGroupId() { + return groupId; + } + + /** + * @return the guestOsId + */ + public String getGuestOsId() { + return guestOsId; + } + + /** + * @return the haEnable + */ + public Boolean getHaEnable() { + return haEnable; + } + + /** + * @return the hostId + */ + public String getHostId() { + return hostId; + } + + /** + * @return the hostName + */ + public String getHostName() { + return hostName; + } + + /** + * @return the hypervisor + */ + public String getHypervisor() { + return hypervisor; + } + + /** + * @return the ipAddress + */ + public String getIpAddress() { + return ipAddress; + } + + /** + * @return the isoDisplayText + */ + public String getIsoDisplayText() { + return isoDisplayText; + } + + /** + * @return the isoId + */ + public String getIsoId() { + return isoId; + } + + /** + * @return the isoName + */ + public String getIsoName() { + return isoName; + } + + /** + * @return the jobId + */ + public String getJobId() { + return jobId; + } + + /** + * @return the jobStatus + */ + public Integer getJobStatus() { + return jobStatus; + } + + /** + * @return the memory + */ + public Integer getMemory() { + return memory; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the networkKbsRead + */ + public Long getNetworkKbsRead() { + return networkKbsRead; + } + + /** + * @return the networkKbsWrite + */ + public Long getNetworkKbsWrite() { + return networkKbsWrite; + } + + /** + * @return the password + */ + public String getPassword() { + return password; + } + + /** + * @return the passwordEnabled + */ + public Boolean getPasswordEnabled() { + return passwordEnabled; + } + + /** + * @return the rootDeviceId + */ + public String getRootDeviceId() { + return rootDeviceId; + } + + /** + * @return the rootDeviceType + */ + public String getRootDeviceType() { + return rootDeviceType; + } + + /** + * @return the serviceOfferingId + */ + public String getServiceOfferingId() { + return serviceOfferingId; + } + + /** + * @return the serviceOfferingName + */ + public String getServiceOfferingName() { + return serviceOfferingName; + } + + /** + * @return the state + */ + public String getState() { + return state; + } + + /** + * @return the templateDisplayText + */ + public String getTemplateDisplayText() { + return templateDisplayText; + } + + /** + * @return the templateId + */ + public String getTemplateId() { + return templateId; + } + + /** + * @return the templateName + */ + public String getTemplateName() { + return templateName; + } + + /** + * @return the zoneId + */ + public String getZoneId() { + return zoneId; + } + + /** + * @return the zoneName + */ + public String getZoneName() { + return zoneName; + } + + /** + * @return the nics + */ + public List getNics() { + return nics; + } + + /** + * @return the securityGroupList + */ + public List getSecurityGroupList() { + return securityGroupList; + } + +} + diff --git a/awsapi/src/com/cloud/stack/models/CloudStackVolume.java b/awsapi/src/com/cloud/stack/models/CloudStackVolume.java index bf3992225c6..dabd6359823 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackVolume.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackVolume.java @@ -1,336 +1,352 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackVolume { - @SerializedName(ApiConstants.ID) - private String id; - @SerializedName(ApiConstants.ACCOUNT) - private String accountName; - @SerializedName(ApiConstants.ATTACHED) - private String attached; - @SerializedName(ApiConstants.CREATED) - private String created; - @SerializedName(ApiConstants.DESTROYED) - private Boolean destroyed; - @SerializedName(ApiConstants.DEVICE_ID) - private String deviceId; - @SerializedName(ApiConstants.DISK_OFFERING_DISPLAY_TEXT) - private String diskOfferingDisplayText; - @SerializedName(ApiConstants.DISK_OFFERING_ID) - private String diskOfferingId; - @SerializedName(ApiConstants.DISK_OFFERING_NAME) - private String diskOfferingName; - @SerializedName(ApiConstants.DOMAIN) - private String domainName; - @SerializedName(ApiConstants.DOMAIN_ID) - private String domainId; - @SerializedName(ApiConstants.HYPERVISOR) - private String hypervisor; - @SerializedName(ApiConstants.IS_EXTRACTABLE) - private Boolean extractable; - @SerializedName(ApiConstants.JOB_ID) - private String jobId; - @SerializedName(ApiConstants.JOB_STATUS) - private Integer jobStatus; - @SerializedName(ApiConstants.NAME) - private String name; - @SerializedName(ApiConstants.SERVICE_OFFERING_DISPLAY_TEXT) - private String serviceOfferingDisplayText; - @SerializedName(ApiConstants.SERVICE_OFFERING_ID) - private String serviceOfferingId; - @SerializedName(ApiConstants.SERVICE_OFFERING_NAME) - private String serviceOfferingName; - @SerializedName(ApiConstants.SIZE) - private Long size; - @SerializedName(ApiConstants.SNAPSHOT_ID) - private String snapshotId; - @SerializedName(ApiConstants.STATE) - private String state; - @SerializedName(ApiConstants.STORAGE) - private String storagePoolName; - @SerializedName(ApiConstants.STORAGE_TYPE) - private String storageType; - @SerializedName(ApiConstants.TYPE) - private String volumeType; - @SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) - private String virtualMachineId; - @SerializedName(ApiConstants.VM_DISPLAY_NAME) - private String virtualMachineDisplayName; - @SerializedName(ApiConstants.VM_NAME) - private String virtualMachineName; - @SerializedName(ApiConstants.VM_STATE) - private String virtualMachineState; - @SerializedName(ApiConstants.ZONE_ID) - private String zoneId; - @SerializedName(ApiConstants.ZONE_NAME) - private String zoneName; - - - public CloudStackVolume() { - } - - - /** - * @return the id - */ - public String getId() { - return id; - } - - - /** - * @return the accountName - */ - public String getAccountName() { - return accountName; - } - - - /** - * @return the attached - */ - public String getAttached() { - return attached; - } - - - /** - * @return the created - */ - public String getCreated() { - return created; - } - - - /** - * @return the destroyed - */ - public Boolean getDestroyed() { - return destroyed; - } - - - /** - * @return the deviceId - */ - public String getDeviceId() { - return deviceId; - } - - - /** - * @return the diskOfferingDisplayText - */ - public String getDiskOfferingDisplayText() { - return diskOfferingDisplayText; - } - - - /** - * @return the diskOfferingId - */ - public String getDiskOfferingId() { - return diskOfferingId; - } - - - /** - * @return the diskOfferingName - */ - public String getDiskOfferingName() { - return diskOfferingName; - } - - - /** - * @return the domainName - */ - public String getDomainName() { - return domainName; - } - - - /** - * @return the domainId - */ - public String getDomainId() { - return domainId; - } - - - /** - * @return the hypervisor - */ - public String getHypervisor() { - return hypervisor; - } - - - /** - * @return the extractable - */ - public Boolean getExtractable() { - return extractable; - } - - - /** - * @return the jobId - */ - public String getJobId() { - return jobId; - } - - - /** - * @return the jobStatus - */ - public Integer getJobStatus() { - return jobStatus; - } - - - /** - * @return the name - */ - public String getName() { - return name; - } - - - /** - * @return the serviceOfferingDisplayText - */ - public String getServiceOfferingDisplayText() { - return serviceOfferingDisplayText; - } - - - /** - * @return the serviceOfferingId - */ - public String getServiceOfferingId() { - return serviceOfferingId; - } - - - /** - * @return the serviceOfferingName - */ - public String getServiceOfferingName() { - return serviceOfferingName; - } - - - /** - * @return the size - */ - public Long getSize() { - return size; - } - - - /** - * @return the snapshotId - */ - public String getSnapshotId() { - return snapshotId; - } - - - /** - * @return the state - */ - public String getState() { - return state; - } - - - /** - * @return the storagePoolName - */ - public String getStoragePoolName() { - return storagePoolName; - } - - - /** - * @return the storageType - */ - public String getStorageType() { - return storageType; - } - - - /** - * @return the volumeType - */ - public String getVolumeType() { - return volumeType; - } - - - /** - * @return the virtualMachineId - */ - public String getVirtualMachineId() { - return virtualMachineId; - } - - - /** - * @return the virtualMachineDisplayName - */ - public String getVirtualMachineDisplayName() { - return virtualMachineDisplayName; - } - - - /** - * @return the virtualMachineName - */ - public String getVirtualMachineName() { - return virtualMachineName; - } - - - /** - * @return the virtualMachineState - */ - public String getVirtualMachineState() { - return virtualMachineState; - } - - - /** - * @return the zoneId - */ - public String getZoneId() { - return zoneId; - } - - - /** - * @return the zoneName - */ - public String getZoneName() { - return zoneName; - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackVolume { + @SerializedName(ApiConstants.ID) + private String id; + @SerializedName(ApiConstants.ACCOUNT) + private String accountName; + @SerializedName(ApiConstants.ATTACHED) + private String attached; + @SerializedName(ApiConstants.CREATED) + private String created; + @SerializedName(ApiConstants.DESTROYED) + private Boolean destroyed; + @SerializedName(ApiConstants.DEVICE_ID) + private String deviceId; + @SerializedName(ApiConstants.DISK_OFFERING_DISPLAY_TEXT) + private String diskOfferingDisplayText; + @SerializedName(ApiConstants.DISK_OFFERING_ID) + private String diskOfferingId; + @SerializedName(ApiConstants.DISK_OFFERING_NAME) + private String diskOfferingName; + @SerializedName(ApiConstants.DOMAIN) + private String domainName; + @SerializedName(ApiConstants.DOMAIN_ID) + private String domainId; + @SerializedName(ApiConstants.HYPERVISOR) + private String hypervisor; + @SerializedName(ApiConstants.IS_EXTRACTABLE) + private Boolean extractable; + @SerializedName(ApiConstants.JOB_ID) + private String jobId; + @SerializedName(ApiConstants.JOB_STATUS) + private Integer jobStatus; + @SerializedName(ApiConstants.NAME) + private String name; + @SerializedName(ApiConstants.SERVICE_OFFERING_DISPLAY_TEXT) + private String serviceOfferingDisplayText; + @SerializedName(ApiConstants.SERVICE_OFFERING_ID) + private String serviceOfferingId; + @SerializedName(ApiConstants.SERVICE_OFFERING_NAME) + private String serviceOfferingName; + @SerializedName(ApiConstants.SIZE) + private Long size; + @SerializedName(ApiConstants.SNAPSHOT_ID) + private String snapshotId; + @SerializedName(ApiConstants.STATE) + private String state; + @SerializedName(ApiConstants.STORAGE) + private String storagePoolName; + @SerializedName(ApiConstants.STORAGE_TYPE) + private String storageType; + @SerializedName(ApiConstants.TYPE) + private String volumeType; + @SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) + private String virtualMachineId; + @SerializedName(ApiConstants.VM_DISPLAY_NAME) + private String virtualMachineDisplayName; + @SerializedName(ApiConstants.VM_NAME) + private String virtualMachineName; + @SerializedName(ApiConstants.VM_STATE) + private String virtualMachineState; + @SerializedName(ApiConstants.ZONE_ID) + private String zoneId; + @SerializedName(ApiConstants.ZONE_NAME) + private String zoneName; + + + public CloudStackVolume() { + } + + + /** + * @return the id + */ + public String getId() { + return id; + } + + + /** + * @return the accountName + */ + public String getAccountName() { + return accountName; + } + + + /** + * @return the attached + */ + public String getAttached() { + return attached; + } + + + /** + * @return the created + */ + public String getCreated() { + return created; + } + + + /** + * @return the destroyed + */ + public Boolean getDestroyed() { + return destroyed; + } + + + /** + * @return the deviceId + */ + public String getDeviceId() { + return deviceId; + } + + + /** + * @return the diskOfferingDisplayText + */ + public String getDiskOfferingDisplayText() { + return diskOfferingDisplayText; + } + + + /** + * @return the diskOfferingId + */ + public String getDiskOfferingId() { + return diskOfferingId; + } + + + /** + * @return the diskOfferingName + */ + public String getDiskOfferingName() { + return diskOfferingName; + } + + + /** + * @return the domainName + */ + public String getDomainName() { + return domainName; + } + + + /** + * @return the domainId + */ + public String getDomainId() { + return domainId; + } + + + /** + * @return the hypervisor + */ + public String getHypervisor() { + return hypervisor; + } + + + /** + * @return the extractable + */ + public Boolean getExtractable() { + return extractable; + } + + + /** + * @return the jobId + */ + public String getJobId() { + return jobId; + } + + + /** + * @return the jobStatus + */ + public Integer getJobStatus() { + return jobStatus; + } + + + /** + * @return the name + */ + public String getName() { + return name; + } + + + /** + * @return the serviceOfferingDisplayText + */ + public String getServiceOfferingDisplayText() { + return serviceOfferingDisplayText; + } + + + /** + * @return the serviceOfferingId + */ + public String getServiceOfferingId() { + return serviceOfferingId; + } + + + /** + * @return the serviceOfferingName + */ + public String getServiceOfferingName() { + return serviceOfferingName; + } + + + /** + * @return the size + */ + public Long getSize() { + return size; + } + + + /** + * @return the snapshotId + */ + public String getSnapshotId() { + return snapshotId; + } + + + /** + * @return the state + */ + public String getState() { + return state; + } + + + /** + * @return the storagePoolName + */ + public String getStoragePoolName() { + return storagePoolName; + } + + + /** + * @return the storageType + */ + public String getStorageType() { + return storageType; + } + + + /** + * @return the volumeType + */ + public String getVolumeType() { + return volumeType; + } + + + /** + * @return the virtualMachineId + */ + public String getVirtualMachineId() { + return virtualMachineId; + } + + + /** + * @return the virtualMachineDisplayName + */ + public String getVirtualMachineDisplayName() { + return virtualMachineDisplayName; + } + + + /** + * @return the virtualMachineName + */ + public String getVirtualMachineName() { + return virtualMachineName; + } + + + /** + * @return the virtualMachineState + */ + public String getVirtualMachineState() { + return virtualMachineState; + } + + + /** + * @return the zoneId + */ + public String getZoneId() { + return zoneId; + } + + + /** + * @return the zoneName + */ + public String getZoneName() { + return zoneName; + } + +} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackZone.java b/awsapi/src/com/cloud/stack/models/CloudStackZone.java index 10ba81671d1..1388a278bc5 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackZone.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackZone.java @@ -1,177 +1,193 @@ -/* - * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cloud.stack.models; - -import com.google.gson.annotations.SerializedName; - -public class CloudStackZone { - @SerializedName(ApiConstants.ID) - private String id; - @SerializedName(ApiConstants.ALLOCATION_STATE) - private String allocationState; - @SerializedName(ApiConstants.DESCRIPTION) - private String description; - @SerializedName(ApiConstants.DHCP_PROVIDER) - private String dhcpProvider; - @SerializedName(ApiConstants.DISPLAY_TEXT) - private String displayText; - @SerializedName(ApiConstants.DNS1) - private String dns1; - @SerializedName(ApiConstants.DNS2) - private String dns2; - @SerializedName(ApiConstants.DOMAIN) - private String domain; - @SerializedName(ApiConstants.DOMAIN_ID) - private Long domainId; - @SerializedName(ApiConstants.GUEST_CIDR_ADDRESS) - private String guestCidrAddress; - @SerializedName(ApiConstants.INTERNAL_DNS1) - private String internalDns1; - @SerializedName(ApiConstants.INTERNAL_DNS2) - private String internalDns2; - @SerializedName(ApiConstants.NAME) - private String name; - @SerializedName(ApiConstants.NETWORK_TYPE) - private String networkType; - @SerializedName(ApiConstants.SECURITY_GROUPS_ENABLED) - private Boolean securityGroupsEnabled; - @SerializedName(ApiConstants.VLAN) - private String vlan; - @SerializedName(ApiConstants.ZONE_TOKEN) - private String zoneToken; - - public CloudStackZone() { - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @return the allocationState - */ - public String getAllocationState() { - return allocationState; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @return the dhcpProvider - */ - public String getDhcpProvider() { - return dhcpProvider; - } - - /** - * @return the displayText - */ - public String getDisplayText() { - return displayText; - } - - /** - * @return the dns1 - */ - public String getDns1() { - return dns1; - } - - /** - * @return the dns2 - */ - public String getDns2() { - return dns2; - } - - /** - * @return the domain - */ - public String getDomain() { - return domain; - } - - /** - * @return the domainId - */ - public Long getDomainId() { - return domainId; - } - - /** - * @return the guestCidrAddress - */ - public String getGuestCidrAddress() { - return guestCidrAddress; - } - - /** - * @return the internalDns1 - */ - public String getInternalDns1() { - return internalDns1; - } - - /** - * @return the internalDns2 - */ - public String getInternalDns2() { - return internalDns2; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @return the networkType - */ - public String getNetworkType() { - return networkType; - } - - /** - * @return the securityGroupsEnabled - */ - public Boolean getSecurityGroupsEnabled() { - return securityGroupsEnabled; - } - - /** - * @return the vlan - */ - public String getVlan() { - return vlan; - } - - /** - * @return the zoneToken - */ - public String getZoneToken() { - return zoneToken; - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +/* + * Copyright (C) 2011 Citrix Systems, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cloud.stack.models; + +import com.google.gson.annotations.SerializedName; + +public class CloudStackZone { + @SerializedName(ApiConstants.ID) + private String id; + @SerializedName(ApiConstants.ALLOCATION_STATE) + private String allocationState; + @SerializedName(ApiConstants.DESCRIPTION) + private String description; + @SerializedName(ApiConstants.DHCP_PROVIDER) + private String dhcpProvider; + @SerializedName(ApiConstants.DISPLAY_TEXT) + private String displayText; + @SerializedName(ApiConstants.DNS1) + private String dns1; + @SerializedName(ApiConstants.DNS2) + private String dns2; + @SerializedName(ApiConstants.DOMAIN) + private String domain; + @SerializedName(ApiConstants.DOMAIN_ID) + private Long domainId; + @SerializedName(ApiConstants.GUEST_CIDR_ADDRESS) + private String guestCidrAddress; + @SerializedName(ApiConstants.INTERNAL_DNS1) + private String internalDns1; + @SerializedName(ApiConstants.INTERNAL_DNS2) + private String internalDns2; + @SerializedName(ApiConstants.NAME) + private String name; + @SerializedName(ApiConstants.NETWORK_TYPE) + private String networkType; + @SerializedName(ApiConstants.SECURITY_GROUPS_ENABLED) + private Boolean securityGroupsEnabled; + @SerializedName(ApiConstants.VLAN) + private String vlan; + @SerializedName(ApiConstants.ZONE_TOKEN) + private String zoneToken; + + public CloudStackZone() { + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the allocationState + */ + public String getAllocationState() { + return allocationState; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @return the dhcpProvider + */ + public String getDhcpProvider() { + return dhcpProvider; + } + + /** + * @return the displayText + */ + public String getDisplayText() { + return displayText; + } + + /** + * @return the dns1 + */ + public String getDns1() { + return dns1; + } + + /** + * @return the dns2 + */ + public String getDns2() { + return dns2; + } + + /** + * @return the domain + */ + public String getDomain() { + return domain; + } + + /** + * @return the domainId + */ + public Long getDomainId() { + return domainId; + } + + /** + * @return the guestCidrAddress + */ + public String getGuestCidrAddress() { + return guestCidrAddress; + } + + /** + * @return the internalDns1 + */ + public String getInternalDns1() { + return internalDns1; + } + + /** + * @return the internalDns2 + */ + public String getInternalDns2() { + return internalDns2; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the networkType + */ + public String getNetworkType() { + return networkType; + } + + /** + * @return the securityGroupsEnabled + */ + public Boolean getSecurityGroupsEnabled() { + return securityGroupsEnabled; + } + + /** + * @return the vlan + */ + public String getVlan() { + return vlan; + } + + /** + * @return the zoneToken + */ + public String getZoneToken() { + return zoneToken; + } +} diff --git a/awsapi/test/com/cloud/gate/model/ModelTestCase.java b/awsapi/test/com/cloud/gate/model/ModelTestCase.java index 85da3543d76..91aeaa75215 100644 --- a/awsapi/test/com/cloud/gate/model/ModelTestCase.java +++ b/awsapi/test/com/cloud/gate/model/ModelTestCase.java @@ -1,352 +1,368 @@ -package com.cloud.gate.model; - -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import org.apache.log4j.Logger; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.Transaction; -import org.junit.Assert; - -import com.cloud.bridge.model.MHost; -import com.cloud.bridge.model.MHostMount; -import com.cloud.bridge.model.SBucket; -import com.cloud.bridge.model.SHost; -import com.cloud.bridge.model.SMeta; -import com.cloud.bridge.model.SObject; -import com.cloud.bridge.util.CloudSessionFactory; -import com.cloud.bridge.util.QueryHelper; -import com.cloud.gate.testcase.BaseTestCase; - -public class ModelTestCase extends BaseTestCase { - protected final static Logger logger = Logger.getLogger(ModelTestCase.class); - - public void testSHost() { - SHost host; - - // create the record - Session session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - host = new SHost(); - host.setHost("localhost"); - host.setExportRoot("/"); - host.setUserOnHost("root"); - host.setUserPassword("password"); - session.saveOrUpdate(host); - txn.commit(); - } finally { - session.close(); - } - Assert.assertTrue(host.getId() != 0); - - // retrive the record - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - host = (SHost)session.get(SHost.class, (long)host.getId()); - txn.commit(); - - Assert.assertTrue(host.getHost().equals("localhost")); - Assert.assertTrue(host.getUserOnHost().equals("root")); - Assert.assertTrue(host.getUserPassword().equals("password")); - - logger.info("Retrived record, host:" + host.getHost() - + ", user: " + host.getUserOnHost() - + ", password: " + host.getUserPassword()); - - } finally { - session.close(); - } - - // delete the record - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - host = (SHost)session.get(SHost.class, (long)host.getId()); - session.delete(host); - txn.commit(); - } finally { - session.close(); - } - - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - host = (SHost)session.get(SHost.class, (long)host.getId()); - txn.commit(); - - Assert.assertTrue(host == null); - } finally { - session.close(); - } - } - - public void testSBucket() { - SHost host; - SBucket bucket; - Session session; - - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - host = new SHost(); - host.setHost("localhost"); - host.setUserOnHost("root"); - host.setUserPassword("password"); - host.setExportRoot("/"); - - bucket = new SBucket(); - bucket.setName("Bucket"); - bucket.setOwnerCanonicalId("OwnerId-dummy"); - bucket.setCreateTime(new Date()); - - host.getBuckets().add(bucket); - bucket.setShost(host); - - session.save(host); - session.save(bucket); - txn.commit(); - } finally { - session.close(); - } - - long bucketId = bucket.getId(); - - // load bucket - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - bucket = (SBucket)session.get(SBucket.class, bucketId); - txn.commit(); - - Assert.assertTrue(bucket.getShost().getHost().equals("localhost")); - Assert.assertTrue(bucket.getName().equals("Bucket")); - Assert.assertTrue(bucket.getOwnerCanonicalId().equals("OwnerId-dummy")); - } finally { - session.close(); - } - - // delete the bucket - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - bucket = (SBucket)session.get(SBucket.class, bucketId); - session.delete(bucket); - - host = (SHost)session.get(SHost.class, host.getId()); - session.delete(host); - txn.commit(); - } finally { - session.close(); - } - - // verify the deletion - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - bucket = (SBucket)session.get(SBucket.class, bucketId); - txn.commit(); - - Assert.assertTrue(bucket == null); - } finally { - session.close(); - } - } - - public void testSObject() { - SHost host; - SBucket bucket; - Session session; - SObject sobject; - - // setup - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - host = new SHost(); - host.setHost("localhost"); - host.setUserOnHost("root"); - host.setUserPassword("password"); - host.setExportRoot("/"); - - bucket = new SBucket(); - bucket.setName("Bucket"); - bucket.setOwnerCanonicalId("OwnerId-dummy"); - bucket.setCreateTime(new Date()); - bucket.setShost(host); - host.getBuckets().add(bucket); - - sobject = new SObject(); - sobject.setNameKey("ObjectNameKey"); - sobject.setOwnerCanonicalId("OwnerId-dummy"); - sobject.setCreateTime(new Date()); - sobject.setBucket(bucket); - bucket.getObjectsInBucket().add(sobject); - - session.save(host); - session.save(bucket); - session.save(sobject); - txn.commit(); - - } finally { - session.close(); - } - - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - sobject = (SObject)session.get(SObject.class, sobject.getId()); - txn.commit(); - Assert.assertTrue(sobject.getBucket().getName().equals("Bucket")); - Assert.assertTrue(sobject.getNameKey().equals("ObjectNameKey")); - Assert.assertTrue(sobject.getOwnerCanonicalId().equals("OwnerId-dummy")); - } finally { - session.close(); - } - - // test delete cascade - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - bucket = (SBucket)session.get(SBucket.class, bucket.getId()); - session.delete(bucket); - - host = (SHost)session.get(SHost.class, host.getId()); - session.delete(host); - txn.commit(); - } finally { - session.close(); - } - } - - public void testMeta() { - Session session; - - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - SMeta meta = new SMeta(); - meta.setTarget("SObject"); - meta.setTargetId(1); - meta.setName("param1"); - meta.setValue("value1"); - session.save(meta); - - logger.info("Meta 1: " + meta.getId()); - - meta = new SMeta(); - meta.setTarget("SObject"); - meta.setTargetId(1); - meta.setName("param2"); - meta.setValue("value2"); - session.save(meta); - - logger.info("Meta 2: " + meta.getId()); - - txn.commit(); - } finally { - session.close(); - } - - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - Query query = session.createQuery("from SMeta where target=? and targetId=?"); - QueryHelper.bindParameters(query, new Object[] { - "SObject", new Long(1) - }); - List l = QueryHelper.executeQuery(query); - txn.commit(); - - for(SMeta meta: l) { - logger.info("" + meta.getName() + "=" + meta.getValue()); - } - } finally { - session.close(); - } - - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - Query query = session.createQuery("delete from SMeta where target=?"); - QueryHelper.bindParameters(query, new Object[] {"SObject"}); - query.executeUpdate(); - txn.commit(); - } finally { - session.close(); - } - } - - public void testHosts() { - Session session; - SHost shost; - MHost mhost; - MHostMount hostMount; - - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - shost = new SHost(); - shost.setHost("Storage host1"); - shost.setUserOnHost("root"); - shost.setUserPassword("password"); - shost.setExportRoot("/"); - session.save(shost); - - mhost = new MHost(); - mhost.setHostKey("1"); - mhost.setHost("management host1"); - mhost.setVersion("v1"); - session.save(mhost); - - hostMount = new MHostMount(); - hostMount.setMhost(mhost); - hostMount.setShost(shost); - hostMount.setMountPath("/mnt"); - session.save(hostMount); - txn.commit(); - } finally { - session.close(); - } - - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - mhost = (MHost)session.createQuery("from MHost where hostKey=?"). - setLong(0, new Long(1)).uniqueResult(); - - if(mhost != null) { - Iterator it = mhost.getMounts().iterator(); - while(it.hasNext()) { - MHostMount mount = (MHostMount)it.next(); - Assert.assertTrue(mount.getMountPath().equals("/mnt")); - - logger.info(mount.getMountPath()); - } - } - txn.commit(); - } finally { - session.close(); - } - - session = CloudSessionFactory.getInstance().openSession(); - try { - Transaction txn = session.beginTransaction(); - mhost = (MHost)session.createQuery("from MHost where hostKey=?"). - setLong(0, new Long(1)).uniqueResult(); - if(mhost != null) - session.delete(mhost); - - shost = (SHost)session.createQuery("from SHost where host=?"). - setString(0, "Storage host1").uniqueResult(); - if(shost != null) - session.delete(shost); - txn.commit(); - } finally { - session.close(); - } - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.gate.model; + +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import org.apache.log4j.Logger; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.junit.Assert; + +import com.cloud.bridge.model.MHost; +import com.cloud.bridge.model.MHostMount; +import com.cloud.bridge.model.SBucket; +import com.cloud.bridge.model.SHost; +import com.cloud.bridge.model.SMeta; +import com.cloud.bridge.model.SObject; +import com.cloud.bridge.util.CloudSessionFactory; +import com.cloud.bridge.util.QueryHelper; +import com.cloud.gate.testcase.BaseTestCase; + +public class ModelTestCase extends BaseTestCase { + protected final static Logger logger = Logger.getLogger(ModelTestCase.class); + + public void testSHost() { + SHost host; + + // create the record + Session session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + host = new SHost(); + host.setHost("localhost"); + host.setExportRoot("/"); + host.setUserOnHost("root"); + host.setUserPassword("password"); + session.saveOrUpdate(host); + txn.commit(); + } finally { + session.close(); + } + Assert.assertTrue(host.getId() != 0); + + // retrive the record + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + host = (SHost)session.get(SHost.class, (long)host.getId()); + txn.commit(); + + Assert.assertTrue(host.getHost().equals("localhost")); + Assert.assertTrue(host.getUserOnHost().equals("root")); + Assert.assertTrue(host.getUserPassword().equals("password")); + + logger.info("Retrived record, host:" + host.getHost() + + ", user: " + host.getUserOnHost() + + ", password: " + host.getUserPassword()); + + } finally { + session.close(); + } + + // delete the record + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + host = (SHost)session.get(SHost.class, (long)host.getId()); + session.delete(host); + txn.commit(); + } finally { + session.close(); + } + + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + host = (SHost)session.get(SHost.class, (long)host.getId()); + txn.commit(); + + Assert.assertTrue(host == null); + } finally { + session.close(); + } + } + + public void testSBucket() { + SHost host; + SBucket bucket; + Session session; + + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + host = new SHost(); + host.setHost("localhost"); + host.setUserOnHost("root"); + host.setUserPassword("password"); + host.setExportRoot("/"); + + bucket = new SBucket(); + bucket.setName("Bucket"); + bucket.setOwnerCanonicalId("OwnerId-dummy"); + bucket.setCreateTime(new Date()); + + host.getBuckets().add(bucket); + bucket.setShost(host); + + session.save(host); + session.save(bucket); + txn.commit(); + } finally { + session.close(); + } + + long bucketId = bucket.getId(); + + // load bucket + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + bucket = (SBucket)session.get(SBucket.class, bucketId); + txn.commit(); + + Assert.assertTrue(bucket.getShost().getHost().equals("localhost")); + Assert.assertTrue(bucket.getName().equals("Bucket")); + Assert.assertTrue(bucket.getOwnerCanonicalId().equals("OwnerId-dummy")); + } finally { + session.close(); + } + + // delete the bucket + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + bucket = (SBucket)session.get(SBucket.class, bucketId); + session.delete(bucket); + + host = (SHost)session.get(SHost.class, host.getId()); + session.delete(host); + txn.commit(); + } finally { + session.close(); + } + + // verify the deletion + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + bucket = (SBucket)session.get(SBucket.class, bucketId); + txn.commit(); + + Assert.assertTrue(bucket == null); + } finally { + session.close(); + } + } + + public void testSObject() { + SHost host; + SBucket bucket; + Session session; + SObject sobject; + + // setup + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + host = new SHost(); + host.setHost("localhost"); + host.setUserOnHost("root"); + host.setUserPassword("password"); + host.setExportRoot("/"); + + bucket = new SBucket(); + bucket.setName("Bucket"); + bucket.setOwnerCanonicalId("OwnerId-dummy"); + bucket.setCreateTime(new Date()); + bucket.setShost(host); + host.getBuckets().add(bucket); + + sobject = new SObject(); + sobject.setNameKey("ObjectNameKey"); + sobject.setOwnerCanonicalId("OwnerId-dummy"); + sobject.setCreateTime(new Date()); + sobject.setBucket(bucket); + bucket.getObjectsInBucket().add(sobject); + + session.save(host); + session.save(bucket); + session.save(sobject); + txn.commit(); + + } finally { + session.close(); + } + + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + sobject = (SObject)session.get(SObject.class, sobject.getId()); + txn.commit(); + Assert.assertTrue(sobject.getBucket().getName().equals("Bucket")); + Assert.assertTrue(sobject.getNameKey().equals("ObjectNameKey")); + Assert.assertTrue(sobject.getOwnerCanonicalId().equals("OwnerId-dummy")); + } finally { + session.close(); + } + + // test delete cascade + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + bucket = (SBucket)session.get(SBucket.class, bucket.getId()); + session.delete(bucket); + + host = (SHost)session.get(SHost.class, host.getId()); + session.delete(host); + txn.commit(); + } finally { + session.close(); + } + } + + public void testMeta() { + Session session; + + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + SMeta meta = new SMeta(); + meta.setTarget("SObject"); + meta.setTargetId(1); + meta.setName("param1"); + meta.setValue("value1"); + session.save(meta); + + logger.info("Meta 1: " + meta.getId()); + + meta = new SMeta(); + meta.setTarget("SObject"); + meta.setTargetId(1); + meta.setName("param2"); + meta.setValue("value2"); + session.save(meta); + + logger.info("Meta 2: " + meta.getId()); + + txn.commit(); + } finally { + session.close(); + } + + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + Query query = session.createQuery("from SMeta where target=? and targetId=?"); + QueryHelper.bindParameters(query, new Object[] { + "SObject", new Long(1) + }); + List l = QueryHelper.executeQuery(query); + txn.commit(); + + for(SMeta meta: l) { + logger.info("" + meta.getName() + "=" + meta.getValue()); + } + } finally { + session.close(); + } + + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + Query query = session.createQuery("delete from SMeta where target=?"); + QueryHelper.bindParameters(query, new Object[] {"SObject"}); + query.executeUpdate(); + txn.commit(); + } finally { + session.close(); + } + } + + public void testHosts() { + Session session; + SHost shost; + MHost mhost; + MHostMount hostMount; + + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + shost = new SHost(); + shost.setHost("Storage host1"); + shost.setUserOnHost("root"); + shost.setUserPassword("password"); + shost.setExportRoot("/"); + session.save(shost); + + mhost = new MHost(); + mhost.setHostKey("1"); + mhost.setHost("management host1"); + mhost.setVersion("v1"); + session.save(mhost); + + hostMount = new MHostMount(); + hostMount.setMhost(mhost); + hostMount.setShost(shost); + hostMount.setMountPath("/mnt"); + session.save(hostMount); + txn.commit(); + } finally { + session.close(); + } + + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + mhost = (MHost)session.createQuery("from MHost where hostKey=?"). + setLong(0, new Long(1)).uniqueResult(); + + if(mhost != null) { + Iterator it = mhost.getMounts().iterator(); + while(it.hasNext()) { + MHostMount mount = (MHostMount)it.next(); + Assert.assertTrue(mount.getMountPath().equals("/mnt")); + + logger.info(mount.getMountPath()); + } + } + txn.commit(); + } finally { + session.close(); + } + + session = CloudSessionFactory.getInstance().openSession(); + try { + Transaction txn = session.beginTransaction(); + mhost = (MHost)session.createQuery("from MHost where hostKey=?"). + setLong(0, new Long(1)).uniqueResult(); + if(mhost != null) + session.delete(mhost); + + shost = (SHost)session.createQuery("from SHost where host=?"). + setString(0, "Storage host1").uniqueResult(); + if(shost != null) + session.delete(shost); + txn.commit(); + } finally { + session.close(); + } + } +} diff --git a/awsapi/test/com/cloud/gate/persist/PersitTestCase.java b/awsapi/test/com/cloud/gate/persist/PersitTestCase.java index a8d2b19881c..4961d932682 100644 --- a/awsapi/test/com/cloud/gate/persist/PersitTestCase.java +++ b/awsapi/test/com/cloud/gate/persist/PersitTestCase.java @@ -1,57 +1,73 @@ -package com.cloud.gate.persist; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.persist.PersistContext; -import com.cloud.gate.testcase.BaseTestCase; - -public class PersitTestCase extends BaseTestCase { - protected final static Logger logger = Logger.getLogger(PersitTestCase.class); - - public void testNamedLock() { - Thread t1 = new Thread(new Runnable() { - public void run() { - for(int i = 0; i < 10; i++) { - if(PersistContext.acquireNamedLock("TestLock", 3)) { - logger.info("Thread 1 acquired lock"); - try { - Thread.currentThread().sleep(BaseTestCase.getRandomMilliseconds(5000, 10000)); - } catch (InterruptedException e) { - } - logger.info("Thread 1 to release lock"); - PersistContext.releaseNamedLock("TestLock"); - } else { - logger.info("Thread 1 is unable to acquire lock"); - } - } - } - }); - - Thread t2 = new Thread(new Runnable() { - public void run() { - for(int i = 0; i < 10; i++) { - if(PersistContext.acquireNamedLock("TestLock", 3)) { - logger.info("Thread 2 acquired lock"); - try { - Thread.currentThread().sleep(BaseTestCase.getRandomMilliseconds(1000, 5000)); - } catch (InterruptedException e) { - } - logger.info("Thread 2 to release lock"); - PersistContext.releaseNamedLock("TestLock"); - } else { - logger.info("Thread 2 is unable to acquire lock"); - } - } - } - }); - - t1.start(); - t2.start(); - - try { - t1.join(); - t2.join(); - } catch(InterruptedException e) { - } - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.gate.persist; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.persist.PersistContext; +import com.cloud.gate.testcase.BaseTestCase; + +public class PersitTestCase extends BaseTestCase { + protected final static Logger logger = Logger.getLogger(PersitTestCase.class); + + public void testNamedLock() { + Thread t1 = new Thread(new Runnable() { + public void run() { + for(int i = 0; i < 10; i++) { + if(PersistContext.acquireNamedLock("TestLock", 3)) { + logger.info("Thread 1 acquired lock"); + try { + Thread.currentThread().sleep(BaseTestCase.getRandomMilliseconds(5000, 10000)); + } catch (InterruptedException e) { + } + logger.info("Thread 1 to release lock"); + PersistContext.releaseNamedLock("TestLock"); + } else { + logger.info("Thread 1 is unable to acquire lock"); + } + } + } + }); + + Thread t2 = new Thread(new Runnable() { + public void run() { + for(int i = 0; i < 10; i++) { + if(PersistContext.acquireNamedLock("TestLock", 3)) { + logger.info("Thread 2 acquired lock"); + try { + Thread.currentThread().sleep(BaseTestCase.getRandomMilliseconds(1000, 5000)); + } catch (InterruptedException e) { + } + logger.info("Thread 2 to release lock"); + PersistContext.releaseNamedLock("TestLock"); + } else { + logger.info("Thread 2 is unable to acquire lock"); + } + } + } + }); + + t1.start(); + t2.start(); + + try { + t1.join(); + t2.join(); + } catch(InterruptedException e) { + } + } +} diff --git a/awsapi/test/com/cloud/gate/service/ServiceTestCase.java b/awsapi/test/com/cloud/gate/service/ServiceTestCase.java index 5429bab2814..826979a40d9 100644 --- a/awsapi/test/com/cloud/gate/service/ServiceTestCase.java +++ b/awsapi/test/com/cloud/gate/service/ServiceTestCase.java @@ -1,62 +1,78 @@ -package com.cloud.gate.service; - -import java.util.Calendar; - -import junit.framework.Assert; - -import org.apache.log4j.Logger; - -import com.amazon.s3.client.AmazonS3Stub; -import com.amazon.s3.client.AmazonS3Stub.CreateBucket; -import com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse; -import com.amazon.s3.client.AmazonS3Stub.DeleteBucket; -import com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse; -import com.cloud.gate.testcase.BaseTestCase; - -public class ServiceTestCase extends BaseTestCase { - protected final static Logger logger = Logger.getLogger(ServiceTestCase.class); - - private AmazonS3Stub serviceStub; - - protected void setUp() { - super.setUp(); - - try { - serviceStub = new AmazonS3Stub("http://localhost:8080/gate/services/AmazonS3"); - } catch (Exception e) { - logger.error("Exception " + e.getMessage(), e); - } - } - - public void testCreateBucket() { - Assert.assertTrue(serviceStub != null); - - try { - CreateBucket bucket = new CreateBucket(); - bucket.setBucket("Test bucket 3"); - bucket.setSignature("My signature 3"); - bucket.setTimestamp(Calendar.getInstance()); - - CreateBucketResponse response = serviceStub.createBucket(bucket); - } catch(Exception e) { - logger.error("Exception " + e.getMessage(), e); - Assert.assertTrue(false); - } - } - - public void testDeleteBucket() { - Assert.assertTrue(serviceStub != null); - - try { - DeleteBucket bucket = new DeleteBucket(); - bucket.setBucket("Test bucket 3"); - bucket.setSignature("My signature 3"); - bucket.setTimestamp(Calendar.getInstance()); - - DeleteBucketResponse response = serviceStub.deleteBucket(bucket); - } catch(Exception e) { - logger.error("Exception " + e.getMessage(), e); - Assert.assertTrue(false); - } - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.gate.service; + +import java.util.Calendar; + +import junit.framework.Assert; + +import org.apache.log4j.Logger; + +import com.amazon.s3.client.AmazonS3Stub; +import com.amazon.s3.client.AmazonS3Stub.CreateBucket; +import com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse; +import com.amazon.s3.client.AmazonS3Stub.DeleteBucket; +import com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse; +import com.cloud.gate.testcase.BaseTestCase; + +public class ServiceTestCase extends BaseTestCase { + protected final static Logger logger = Logger.getLogger(ServiceTestCase.class); + + private AmazonS3Stub serviceStub; + + protected void setUp() { + super.setUp(); + + try { + serviceStub = new AmazonS3Stub("http://localhost:8080/gate/services/AmazonS3"); + } catch (Exception e) { + logger.error("Exception " + e.getMessage(), e); + } + } + + public void testCreateBucket() { + Assert.assertTrue(serviceStub != null); + + try { + CreateBucket bucket = new CreateBucket(); + bucket.setBucket("Test bucket 3"); + bucket.setSignature("My signature 3"); + bucket.setTimestamp(Calendar.getInstance()); + + CreateBucketResponse response = serviceStub.createBucket(bucket); + } catch(Exception e) { + logger.error("Exception " + e.getMessage(), e); + Assert.assertTrue(false); + } + } + + public void testDeleteBucket() { + Assert.assertTrue(serviceStub != null); + + try { + DeleteBucket bucket = new DeleteBucket(); + bucket.setBucket("Test bucket 3"); + bucket.setSignature("My signature 3"); + bucket.setTimestamp(Calendar.getInstance()); + + DeleteBucketResponse response = serviceStub.deleteBucket(bucket); + } catch(Exception e) { + logger.error("Exception " + e.getMessage(), e); + Assert.assertTrue(false); + } + } +} diff --git a/awsapi/test/com/cloud/gate/testcase/BaseTestCase.java b/awsapi/test/com/cloud/gate/testcase/BaseTestCase.java index 28631a3f922..f97991bdbd2 100644 --- a/awsapi/test/com/cloud/gate/testcase/BaseTestCase.java +++ b/awsapi/test/com/cloud/gate/testcase/BaseTestCase.java @@ -1,42 +1,58 @@ -package com.cloud.gate.testcase; - - -import java.io.File; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Random; - -import junit.framework.TestCase; - -import org.apache.log4j.xml.DOMConfigurator; - -public class BaseTestCase extends TestCase { - protected void setUp() { - URL configUrl = System.class.getResource("/conf/log4j-cloud-bridge.xml"); - if(configUrl != null) { - System.out.println("Configure log4j using log4j-cloud-bridge.xml"); - - try { - File file = new File(configUrl.toURI()); - - System.out.println("Log4j configuration from : " + file.getAbsolutePath()); - DOMConfigurator.configureAndWatch(file.getAbsolutePath(), 10000); - } catch (URISyntaxException e) { - System.out.println("Unable to convert log4j configuration Url to URI"); - } - } else { - System.out.println("Configure log4j with default properties"); - } - } - - public void testDummy() { - } - - public static int getRandomMilliseconds(int rangeLo, int rangeHi) { - int i = new Random().nextInt(); - - long pos = (long)i - (long)Integer.MIN_VALUE; - long iRange = (long)Integer.MAX_VALUE - (long)Integer.MIN_VALUE; - return rangeLo + (int)((rangeHi - rangeLo)*pos/iRange); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.gate.testcase; + + +import java.io.File; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Random; + +import junit.framework.TestCase; + +import org.apache.log4j.xml.DOMConfigurator; + +public class BaseTestCase extends TestCase { + protected void setUp() { + URL configUrl = System.class.getResource("/conf/log4j-cloud-bridge.xml"); + if(configUrl != null) { + System.out.println("Configure log4j using log4j-cloud-bridge.xml"); + + try { + File file = new File(configUrl.toURI()); + + System.out.println("Log4j configuration from : " + file.getAbsolutePath()); + DOMConfigurator.configureAndWatch(file.getAbsolutePath(), 10000); + } catch (URISyntaxException e) { + System.out.println("Unable to convert log4j configuration Url to URI"); + } + } else { + System.out.println("Configure log4j with default properties"); + } + } + + public void testDummy() { + } + + public static int getRandomMilliseconds(int rangeLo, int rangeHi) { + int i = new Random().nextInt(); + + long pos = (long)i - (long)Integer.MIN_VALUE; + long iRange = (long)Integer.MAX_VALUE - (long)Integer.MIN_VALUE; + return rangeLo + (int)((rangeHi - rangeLo)*pos/iRange); + } +} diff --git a/awsapi/test/com/cloud/gate/util/CloudStackClientTestCase.java b/awsapi/test/com/cloud/gate/util/CloudStackClientTestCase.java index 8e3b18a6d1a..127aa5e9117 100644 --- a/awsapi/test/com/cloud/gate/util/CloudStackClientTestCase.java +++ b/awsapi/test/com/cloud/gate/util/CloudStackClientTestCase.java @@ -1,54 +1,70 @@ -package com.cloud.gate.util; - -import java.util.List; - -import junit.framework.Assert; - -import org.apache.log4j.Logger; - -import com.cloud.gate.testcase.BaseTestCase; -import com.cloud.stack.CloudStackClient; -import com.cloud.stack.CloudStackCommand; -import com.cloud.stack.models.CloudStackUserVm; -import com.google.gson.reflect.TypeToken; - -public class CloudStackClientTestCase extends BaseTestCase { - protected final static Logger logger = Logger.getLogger(CloudStackClientTestCase.class); - - // remember to replace with a valid key-pair in test - private final static String API_KEY = "kVMfr1iE0KlKKOUPD-H4GburZHo4KLxIczbl5CM_ilcKFXkmsIfZjWIkCY5QpuKpDvu-DyFud44VfVvXmPKMkw"; - private final static String SECRET_KEY = "a5Y0ysvVHZ0cuffaV26wRm_vvsV5VQldRq9udC21AE8Kwsk0JG8-pz6YSp3bbc3rC0kK5q3_B9QBBzjHafVicw"; - - public void testCall() { - CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false); - - CloudStackCommand command = new CloudStackCommand("startVirtualMachine"); - command.setParam("id", "246446"); - try { - CloudStackUserVm vm = client.call(command, API_KEY, SECRET_KEY, true, "startvirtualmachineresponse", "virtualmachine", CloudStackUserVm.class); - Assert.assertTrue(vm.getId() == "246446"); - } catch(Exception e) { - logger.error("Unexpected exception ", e); - } - } - - public void testListCall() { - CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false); - - CloudStackCommand command = new CloudStackCommand("listVirtualMachines"); - command.setParam("domainid", "1"); - command.setParam("account", "admin"); - command.setParam("page", "1"); - command.setParam("pagesize", "20"); - try { - List vms = client.listCall(command, API_KEY, SECRET_KEY, - "listvirtualmachinesresponse", "virtualmachine", new TypeToken>() {}.getType()); - - for(CloudStackUserVm vm : vms) { - logger.info("id: " + vm.getId() + ", name: " + vm.getName()); - } - } catch(Exception e) { - logger.error("Unexpected exception ", e); - } - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.gate.util; + +import java.util.List; + +import junit.framework.Assert; + +import org.apache.log4j.Logger; + +import com.cloud.gate.testcase.BaseTestCase; +import com.cloud.stack.CloudStackClient; +import com.cloud.stack.CloudStackCommand; +import com.cloud.stack.models.CloudStackUserVm; +import com.google.gson.reflect.TypeToken; + +public class CloudStackClientTestCase extends BaseTestCase { + protected final static Logger logger = Logger.getLogger(CloudStackClientTestCase.class); + + // remember to replace with a valid key-pair in test + private final static String API_KEY = "kVMfr1iE0KlKKOUPD-H4GburZHo4KLxIczbl5CM_ilcKFXkmsIfZjWIkCY5QpuKpDvu-DyFud44VfVvXmPKMkw"; + private final static String SECRET_KEY = "a5Y0ysvVHZ0cuffaV26wRm_vvsV5VQldRq9udC21AE8Kwsk0JG8-pz6YSp3bbc3rC0kK5q3_B9QBBzjHafVicw"; + + public void testCall() { + CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false); + + CloudStackCommand command = new CloudStackCommand("startVirtualMachine"); + command.setParam("id", "246446"); + try { + CloudStackUserVm vm = client.call(command, API_KEY, SECRET_KEY, true, "startvirtualmachineresponse", "virtualmachine", CloudStackUserVm.class); + Assert.assertTrue(vm.getId() == "246446"); + } catch(Exception e) { + logger.error("Unexpected exception ", e); + } + } + + public void testListCall() { + CloudStackClient client = new CloudStackClient("192.168.130.22", 8080, false); + + CloudStackCommand command = new CloudStackCommand("listVirtualMachines"); + command.setParam("domainid", "1"); + command.setParam("account", "admin"); + command.setParam("page", "1"); + command.setParam("pagesize", "20"); + try { + List vms = client.listCall(command, API_KEY, SECRET_KEY, + "listvirtualmachinesresponse", "virtualmachine", new TypeToken>() {}.getType()); + + for(CloudStackUserVm vm : vms) { + logger.info("id: " + vm.getId() + ", name: " + vm.getName()); + } + } catch(Exception e) { + logger.error("Unexpected exception ", e); + } + } +} diff --git a/awsapi/test/com/cloud/gate/util/JsonAccessorTestCase.java b/awsapi/test/com/cloud/gate/util/JsonAccessorTestCase.java index 6e9d4881582..ab3781382f6 100644 --- a/awsapi/test/com/cloud/gate/util/JsonAccessorTestCase.java +++ b/awsapi/test/com/cloud/gate/util/JsonAccessorTestCase.java @@ -1,51 +1,67 @@ -package com.cloud.gate.util; - -import junit.framework.Assert; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.util.JsonAccessor; -import com.cloud.gate.testcase.BaseTestCase; -import com.cloud.stack.models.CloudStackSnapshot; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; - -public class JsonAccessorTestCase extends BaseTestCase { - protected final static Logger logger = Logger.getLogger(UtilTestCase.class); - - public void testJsonAccessor() { - JsonParser parser = new JsonParser(); - JsonElement json = parser.parse("{firstName: 'Kelven', lastName: 'Yang', arrayObj: [{name: 'elem1'}, {name: 'elem2'}]}"); - JsonAccessor jsonAccessor = new JsonAccessor(json); - - Assert.assertTrue("Kelven".equals(jsonAccessor.getAsString("firstName"))); - Assert.assertTrue("Kelven".equals(jsonAccessor.getAsString("this.firstName"))); - Assert.assertTrue("Yang".equals(jsonAccessor.getAsString("lastName"))); - Assert.assertTrue("Yang".equals(jsonAccessor.getAsString("this.lastName"))); - - Assert.assertTrue("elem1".equals(jsonAccessor.getAsString("arrayObj[0].name"))); - Assert.assertTrue("elem2".equals(jsonAccessor.getAsString("arrayObj[1].name"))); - - Assert.assertTrue("elem1".equals(jsonAccessor.getAsString("this.arrayObj.this[0].name"))); - Assert.assertTrue("elem2".equals(jsonAccessor.getAsString("this.arrayObj.this[1].name"))); - - Assert.assertTrue(jsonAccessor.getMatchCount("firstName") == 1); - Assert.assertTrue(jsonAccessor.getMatchCount("middleName") == -1); - Assert.assertTrue(jsonAccessor.getMatchCount("arrayObj") == 2); - Assert.assertTrue(jsonAccessor.getMatchCount("arrayObj[0]") == 1); - } - - public void testGson() { - String response = "{ \"queryasyncjobresultresponse\" : {\"jobid\":5868,\"jobstatus\":1,\"jobprocstatus\":0,\"jobresultcode\":0,\"jobresulttype\":\"object\",\"jobresult\":{\"snapshot\":{\"id\":3161,\"account\":\"admin\",\"domainid\":1,\"domain\":\"ROOT\",\"snapshottype\":\"MANUAL\",\"volumeid\":186928,\"volumename\":\"KY-DATA-VOL\",\"volumetype\":\"DATADISK\",\"created\":\"2011-06-02T05:05:41-0700\",\"name\":\"i-2-246446-VM_KY-DATA-VOL_20110602120541\",\"intervaltype\":\"MANUAL\",\"state\":\"BackedUp\"}}}}"; - - JsonParser parser = new JsonParser(); - JsonElement json = parser.parse(response); - JsonAccessor jsonAccessor = new JsonAccessor(json); - - Gson gson = new Gson(); - CloudStackSnapshot snapshot = gson.fromJson(jsonAccessor.eval("queryasyncjobresultresponse.jobresult.snapshot"), CloudStackSnapshot.class); - - Assert.assertTrue("BackedUp".equals(snapshot.getState())); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.gate.util; + +import junit.framework.Assert; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.util.JsonAccessor; +import com.cloud.gate.testcase.BaseTestCase; +import com.cloud.stack.models.CloudStackSnapshot; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; + +public class JsonAccessorTestCase extends BaseTestCase { + protected final static Logger logger = Logger.getLogger(UtilTestCase.class); + + public void testJsonAccessor() { + JsonParser parser = new JsonParser(); + JsonElement json = parser.parse("{firstName: 'Kelven', lastName: 'Yang', arrayObj: [{name: 'elem1'}, {name: 'elem2'}]}"); + JsonAccessor jsonAccessor = new JsonAccessor(json); + + Assert.assertTrue("Kelven".equals(jsonAccessor.getAsString("firstName"))); + Assert.assertTrue("Kelven".equals(jsonAccessor.getAsString("this.firstName"))); + Assert.assertTrue("Yang".equals(jsonAccessor.getAsString("lastName"))); + Assert.assertTrue("Yang".equals(jsonAccessor.getAsString("this.lastName"))); + + Assert.assertTrue("elem1".equals(jsonAccessor.getAsString("arrayObj[0].name"))); + Assert.assertTrue("elem2".equals(jsonAccessor.getAsString("arrayObj[1].name"))); + + Assert.assertTrue("elem1".equals(jsonAccessor.getAsString("this.arrayObj.this[0].name"))); + Assert.assertTrue("elem2".equals(jsonAccessor.getAsString("this.arrayObj.this[1].name"))); + + Assert.assertTrue(jsonAccessor.getMatchCount("firstName") == 1); + Assert.assertTrue(jsonAccessor.getMatchCount("middleName") == -1); + Assert.assertTrue(jsonAccessor.getMatchCount("arrayObj") == 2); + Assert.assertTrue(jsonAccessor.getMatchCount("arrayObj[0]") == 1); + } + + public void testGson() { + String response = "{ \"queryasyncjobresultresponse\" : {\"jobid\":5868,\"jobstatus\":1,\"jobprocstatus\":0,\"jobresultcode\":0,\"jobresulttype\":\"object\",\"jobresult\":{\"snapshot\":{\"id\":3161,\"account\":\"admin\",\"domainid\":1,\"domain\":\"ROOT\",\"snapshottype\":\"MANUAL\",\"volumeid\":186928,\"volumename\":\"KY-DATA-VOL\",\"volumetype\":\"DATADISK\",\"created\":\"2011-06-02T05:05:41-0700\",\"name\":\"i-2-246446-VM_KY-DATA-VOL_20110602120541\",\"intervaltype\":\"MANUAL\",\"state\":\"BackedUp\"}}}}"; + + JsonParser parser = new JsonParser(); + JsonElement json = parser.parse(response); + JsonAccessor jsonAccessor = new JsonAccessor(json); + + Gson gson = new Gson(); + CloudStackSnapshot snapshot = gson.fromJson(jsonAccessor.eval("queryasyncjobresultresponse.jobresult.snapshot"), CloudStackSnapshot.class); + + Assert.assertTrue("BackedUp".equals(snapshot.getState())); + } +} diff --git a/awsapi/test/com/cloud/gate/util/UtilTestCase.java b/awsapi/test/com/cloud/gate/util/UtilTestCase.java index 7e192e9af35..f0bc0e72dc5 100644 --- a/awsapi/test/com/cloud/gate/util/UtilTestCase.java +++ b/awsapi/test/com/cloud/gate/util/UtilTestCase.java @@ -1,173 +1,189 @@ -package com.cloud.gate.util; - - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import org.apache.log4j.Logger; - -import com.cloud.bridge.util.DateHelper; -import com.cloud.bridge.util.StringHelper; -import com.cloud.bridge.util.XElement; -import com.cloud.bridge.util.XSerializer; -import com.cloud.bridge.util.XSerializerJsonAdapter; -import com.cloud.bridge.util.XSerializerXmlAdapter; -import com.cloud.gate.testcase.BaseTestCase; - -import junit.framework.Assert; - -class SubFoo { - @XElement(name="Name") - private String name; - - @XElement(name="Value") - private String value; - - public SubFoo() { - } - - public SubFoo(String n, String v) { - name = n; - value = v; - } -} - -class BaseFoo { - @XElement(name="BaseName") - private String baseName; - - @XElement(name="BaseValue") - private String baseValue; - - public BaseFoo() { - baseName="baseName"; - baseValue="baseValue"; - } -} - -class Foo extends BaseFoo { - @XElement(name="Name") - private String name; - - @XElement(name="Value") - private String value; - - @XElement(name="ByteValue") - private byte bValue; - - @XElement(name="ShortValue") - private short sValue; - - @XElement(name="LongValue") - private long lValue; - - @XElement(name="NullValue") - private String nullValue; - - @XElement(name="TimeValue") - private Date dt = new Date(); - - @XElement(name="CalendarValue") - private Calendar cal = Calendar.getInstance(); - - @XElement(name="SubObject") - public SubFoo sub; - - @XElement(name="SubObjects", item="ListItem", itemClass="com.cloud.gate.util.SubFoo") - public List subs; - - @XElement(name="ArrayObjects", item="ArrayItem", itemClass="com.cloud.gate.util.SubFoo") - public SubFoo[] subArray; - - public Foo() { - subs = new ArrayList(); - } - - public Foo(String name, String value) { - this.name = name; - this.value = value; - - subs = new ArrayList(); - } -} - -public class UtilTestCase extends BaseTestCase { - protected final static Logger logger = Logger.getLogger(UtilTestCase.class); - - public void testStringHelper() { - String value = StringHelper.substringInBetween("archive/doc1.doc", "archive", "/"); - Assert.assertTrue(value == null); - - value = StringHelper.substringInBetween("archive/sub1/doc1.doc", "archive", "/"); - Assert.assertTrue(value.equals("sub1")); - - value = StringHelper.substringInBetween("archive/sub2/doc1.doc", "archive", "/"); - Assert.assertTrue(value.equals("sub2")); - - value = StringHelper.substringInBetween("archive/sub3/subb/doc1.doc", "archive", "/"); - Assert.assertTrue(value.equals("sub3")); - - value = StringHelper.substringInBetween("archive/sub3/subb/doc1.doc", "archive/sub3", "/"); - Assert.assertTrue(value.equals("subb")); - - value = StringHelper.substringInBetween("archive/sub3/subb/doc1.doc", null, "/"); - Assert.assertTrue(value.equals("archive")); - } - - public void testJava2XmlJson() { - XSerializer serializer = new XSerializer(new XSerializerXmlAdapter()); - serializer.setFlattenCollection(true); - serializer.setOmitNull(true); - Foo foo = new Foo("dummyName", "dummyValue"); - foo.sub = new SubFoo("subName", "subValue"); - foo.subs.add(new SubFoo("Sub1", "Sub1-value")); - foo.subs.add(new SubFoo("Sub2", "Sub2-value")); - - foo.subArray = new SubFoo[3]; - foo.subArray[0] = new SubFoo("Array-sub1", "Sub1-value"); - foo.subArray[1] = new SubFoo("Array-sub2", "Sub1-value"); - foo.subArray[2] = new SubFoo("Array-sub3", "Sub1-value"); - - String output = serializer.serializeTo(foo, "Foo", "http://www.cloud.com/S3", 0); - logger.info(output); - - serializer = new XSerializer(new XSerializerJsonAdapter()); - output = serializer.serializeTo(foo, "Foo", "http://www.cloud.com/S3", 0); - logger.info(output); - } - - public void testXml2Java() { - XSerializer serializer = new XSerializer(new XSerializerXmlAdapter()); - serializer.setFlattenCollection(true); - XSerializer.registerRootType("Foo", Foo.class); - - try { - InputStream is = this.getClass().getResourceAsStream("/com/cloud/gate/util/Xml2JavaTestData.xml"); - String xml = StringHelper.stringFromStream(is); - Object object = serializer.serializeFrom(xml); - if(object != null) { - String output = serializer.serializeTo(object, "Foo", "http://www.cloud.com/S3", 0); - logger.info("Redump parsed java object"); - logger.info(output); - } - is.close(); - } catch(IOException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - } - } - - public void testMisc() { - String[] tokens = "/".split("/"); - logger.info("length : " + tokens.length); - for(int i = 0; i < tokens.length; i++) { - logger.info("token " + i + ": " + tokens[i]); - } - - logger.info(DateHelper.getDateDisplayString( - DateHelper.GMT_TIMEZONE, new Date(), "E, d MMM yyyy HH:mm:ss z")); - } -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.gate.util; + + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.util.DateHelper; +import com.cloud.bridge.util.StringHelper; +import com.cloud.bridge.util.XElement; +import com.cloud.bridge.util.XSerializer; +import com.cloud.bridge.util.XSerializerJsonAdapter; +import com.cloud.bridge.util.XSerializerXmlAdapter; +import com.cloud.gate.testcase.BaseTestCase; + +import junit.framework.Assert; + +class SubFoo { + @XElement(name="Name") + private String name; + + @XElement(name="Value") + private String value; + + public SubFoo() { + } + + public SubFoo(String n, String v) { + name = n; + value = v; + } +} + +class BaseFoo { + @XElement(name="BaseName") + private String baseName; + + @XElement(name="BaseValue") + private String baseValue; + + public BaseFoo() { + baseName="baseName"; + baseValue="baseValue"; + } +} + +class Foo extends BaseFoo { + @XElement(name="Name") + private String name; + + @XElement(name="Value") + private String value; + + @XElement(name="ByteValue") + private byte bValue; + + @XElement(name="ShortValue") + private short sValue; + + @XElement(name="LongValue") + private long lValue; + + @XElement(name="NullValue") + private String nullValue; + + @XElement(name="TimeValue") + private Date dt = new Date(); + + @XElement(name="CalendarValue") + private Calendar cal = Calendar.getInstance(); + + @XElement(name="SubObject") + public SubFoo sub; + + @XElement(name="SubObjects", item="ListItem", itemClass="com.cloud.gate.util.SubFoo") + public List subs; + + @XElement(name="ArrayObjects", item="ArrayItem", itemClass="com.cloud.gate.util.SubFoo") + public SubFoo[] subArray; + + public Foo() { + subs = new ArrayList(); + } + + public Foo(String name, String value) { + this.name = name; + this.value = value; + + subs = new ArrayList(); + } +} + +public class UtilTestCase extends BaseTestCase { + protected final static Logger logger = Logger.getLogger(UtilTestCase.class); + + public void testStringHelper() { + String value = StringHelper.substringInBetween("archive/doc1.doc", "archive", "/"); + Assert.assertTrue(value == null); + + value = StringHelper.substringInBetween("archive/sub1/doc1.doc", "archive", "/"); + Assert.assertTrue(value.equals("sub1")); + + value = StringHelper.substringInBetween("archive/sub2/doc1.doc", "archive", "/"); + Assert.assertTrue(value.equals("sub2")); + + value = StringHelper.substringInBetween("archive/sub3/subb/doc1.doc", "archive", "/"); + Assert.assertTrue(value.equals("sub3")); + + value = StringHelper.substringInBetween("archive/sub3/subb/doc1.doc", "archive/sub3", "/"); + Assert.assertTrue(value.equals("subb")); + + value = StringHelper.substringInBetween("archive/sub3/subb/doc1.doc", null, "/"); + Assert.assertTrue(value.equals("archive")); + } + + public void testJava2XmlJson() { + XSerializer serializer = new XSerializer(new XSerializerXmlAdapter()); + serializer.setFlattenCollection(true); + serializer.setOmitNull(true); + Foo foo = new Foo("dummyName", "dummyValue"); + foo.sub = new SubFoo("subName", "subValue"); + foo.subs.add(new SubFoo("Sub1", "Sub1-value")); + foo.subs.add(new SubFoo("Sub2", "Sub2-value")); + + foo.subArray = new SubFoo[3]; + foo.subArray[0] = new SubFoo("Array-sub1", "Sub1-value"); + foo.subArray[1] = new SubFoo("Array-sub2", "Sub1-value"); + foo.subArray[2] = new SubFoo("Array-sub3", "Sub1-value"); + + String output = serializer.serializeTo(foo, "Foo", "http://www.cloud.com/S3", 0); + logger.info(output); + + serializer = new XSerializer(new XSerializerJsonAdapter()); + output = serializer.serializeTo(foo, "Foo", "http://www.cloud.com/S3", 0); + logger.info(output); + } + + public void testXml2Java() { + XSerializer serializer = new XSerializer(new XSerializerXmlAdapter()); + serializer.setFlattenCollection(true); + XSerializer.registerRootType("Foo", Foo.class); + + try { + InputStream is = this.getClass().getResourceAsStream("/com/cloud/gate/util/Xml2JavaTestData.xml"); + String xml = StringHelper.stringFromStream(is); + Object object = serializer.serializeFrom(xml); + if(object != null) { + String output = serializer.serializeTo(object, "Foo", "http://www.cloud.com/S3", 0); + logger.info("Redump parsed java object"); + logger.info(output); + } + is.close(); + } catch(IOException e) { + logger.error("Unexpected exception " + e.getMessage(), e); + } + } + + public void testMisc() { + String[] tokens = "/".split("/"); + logger.info("length : " + tokens.length); + for(int i = 0; i < tokens.length; i++) { + logger.info("token " + i + ": " + tokens[i]); + } + + logger.info(DateHelper.getDateDisplayString( + DateHelper.GMT_TIMEZONE, new Date(), "E, d MMM yyyy HH:mm:ss z")); + } +} diff --git a/awsapi/test/com/cloud/gate/util/Xml2JavaTestData.xml b/awsapi/test/com/cloud/gate/util/Xml2JavaTestData.xml index 4101574bd8c..f8883839ef1 100644 --- a/awsapi/test/com/cloud/gate/util/Xml2JavaTestData.xml +++ b/awsapi/test/com/cloud/gate/util/Xml2JavaTestData.xml @@ -1,36 +1,36 @@ - - baseName - baseValue - dummyName - dummyValue - 0 - 0 - 0 - - 2010-06-11T05:18:46.000Z - 2010-06-11T05:18:46.000Z - - subName - subValue - - - Sub1 - Sub1-value - - - Sub2 - Sub2-value - - - Array-sub1 - Sub1-value - - - Array-sub2 - Sub1-value - - - Array-sub3 - Sub1-value - - + + baseName + baseValue + dummyName + dummyValue + 0 + 0 + 0 + + 2010-06-11T05:18:46.000Z + 2010-06-11T05:18:46.000Z + + subName + subValue + + + Sub1 + Sub1-value + + + Sub2 + Sub2-value + + + Array-sub1 + Sub1-value + + + Array-sub2 + Sub1-value + + + Array-sub3 + Sub1-value + + From dcceb9d59b7fc711ef15173b6b766a539e9f7f7a Mon Sep 17 00:00:00 2001 From: David Nalley Date: Tue, 26 Jun 2012 11:19:19 -0400 Subject: [PATCH 07/37] fixing a bunch of line endings in the test directory --- test/scripts/checkOutOfMemory.sh | 30 +- .../cloud/sample/UserCloudAPIExecutor.java | 338 +- .../cloud/test/longrun/BuildGuestNetwork.java | 224 +- .../test/longrun/PerformanceWithAPI.java | 382 +-- test/src/com/cloud/test/longrun/User.java | 442 +-- .../cloud/test/longrun/VirtualMachine.java | 198 +- .../com/cloud/test/longrun/guestNetwork.java | 182 +- .../test/regression/DelegatedAdminTest.java | 232 +- .../src/com/cloud/test/regression/Deploy.java | 188 +- .../cloud/test/regression/EventsApiTest.java | 322 +- test/src/com/cloud/test/regression/HA.java | 124 +- .../test/regression/LoadBalancingTest.java | 258 +- .../test/regression/PortForwardingTest.java | 244 +- .../com/cloud/test/regression/SanityTest.java | 136 +- test/src/com/cloud/test/regression/Test.java | 140 +- .../com/cloud/test/regression/TestCase.java | 134 +- .../com/cloud/test/regression/VMApiTest.java | 136 +- .../test/stress/StressTestDirectAttach.java | 3024 ++++++++--------- test/src/com/cloud/test/stress/WgetTest.java | 290 +- .../com/cloud/test/ui/AddAndDeleteAISO.java | 200 +- .../cloud/test/ui/AddAndDeleteATemplate.java | 196 +- .../com/cloud/test/utils/ConsoleProxy.java | 192 +- .../com/cloud/test/utils/IpSqlGenerator.java | 144 +- .../com/cloud/test/utils/ProxyLoadTemp.java | 210 +- .../src/com/cloud/test/utils/SignRequest.java | 176 +- .../cloud/test/utils/SqlDataGenerator.java | 64 +- test/src/com/cloud/test/utils/TestClient.java | 730 ++-- .../com/cloud/test/utils/UtilsForTest.java | 392 +-- 28 files changed, 4664 insertions(+), 4664 deletions(-) diff --git a/test/scripts/checkOutOfMemory.sh b/test/scripts/checkOutOfMemory.sh index 9baf0df1a07..a3c04928676 100755 --- a/test/scripts/checkOutOfMemory.sh +++ b/test/scripts/checkOutOfMemory.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash # Copyright 2012 Citrix Systems, Inc. Licensed under the # Apache License, Version 2.0 (the "License"); you may not use this # file except in compliance with the License. Citrix Systems, Inc. @@ -16,18 +16,18 @@ - -while true -do -sleep 600 -pid=`ps -ef | grep 'management.jmxremote' | grep -v 'cloud-management' | grep -v grep | awk '{print \$2}'` -if grep -q java.lang.OutOfMemoryError /var/log/vmops/vmops.log -then -while true -do -t=$(date +"%h%d_%H_%M_%S") -jmap -dump:format=b,file=/root/dump/heap.bin.$t $pid -sleep 1800 -done -fi + +while true +do +sleep 600 +pid=`ps -ef | grep 'management.jmxremote' | grep -v 'cloud-management' | grep -v grep | awk '{print \$2}'` +if grep -q java.lang.OutOfMemoryError /var/log/vmops/vmops.log +then +while true +do +t=$(date +"%h%d_%H_%M_%S") +jmap -dump:format=b,file=/root/dump/heap.bin.$t $pid +sleep 1800 +done +fi done \ No newline at end of file diff --git a/test/src/com/cloud/sample/UserCloudAPIExecutor.java b/test/src/com/cloud/sample/UserCloudAPIExecutor.java index d558ac25f3d..7a2880860fb 100644 --- a/test/src/com/cloud/sample/UserCloudAPIExecutor.java +++ b/test/src/com/cloud/sample/UserCloudAPIExecutor.java @@ -10,176 +10,176 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.sample; - -import java.io.FileInputStream; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Properties; -import java.util.StringTokenizer; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpMethod; -import org.apache.commons.httpclient.methods.GetMethod; - -import com.cloud.utils.encoding.Base64; - -/** +package com.cloud.sample; + +import java.io.FileInputStream; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Properties; +import java.util.StringTokenizer; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.HttpMethod; +import org.apache.commons.httpclient.methods.GetMethod; + +import com.cloud.utils.encoding.Base64; + +/** * * * * - * - * - * - * - * - */ - -/** - * Sample CloudStack Management User API Executor. - * - * Prerequisites: - Edit usercloud.properties to include your host, apiUrl, apiKey, and secretKey - Use ./executeUserAPI.sh to - * execute this test class - * - * @author will - * - */ -public class UserCloudAPIExecutor { - public static void main(String[] args) { - // Host - String host = null; - - // Fully qualified URL with http(s)://host:port - String apiUrl = null; - - // ApiKey and secretKey as given by your CloudStack vendor - String apiKey = null; - String secretKey = null; - - try { - Properties prop = new Properties(); - prop.load(new FileInputStream("usercloud.properties")); - - // host - host = prop.getProperty("host"); - if (host == null) { - System.out.println("Please specify a valid host in the format of http(s)://:/client/api in your usercloud.properties file."); - } - - // apiUrl - apiUrl = prop.getProperty("apiUrl"); - if (apiUrl == null) { - System.out.println("Please specify a valid API URL in the format of command=¶m1=¶m2=... in your usercloud.properties file."); - } - - // apiKey - apiKey = prop.getProperty("apiKey"); - if (apiKey == null) { - System.out.println("Please specify your API Key as provided by your CloudStack vendor in your usercloud.properties file."); - } - - // secretKey - secretKey = prop.getProperty("secretKey"); - if (secretKey == null) { - System.out.println("Please specify your secret Key as provided by your CloudStack vendor in your usercloud.properties file."); - } - - if (apiUrl == null || apiKey == null || secretKey == null) { - return; - } - - System.out.println("Constructing API call to host = '" + host + "' with API command = '" + apiUrl + "' using apiKey = '" + apiKey + "' and secretKey = '" + secretKey + "'"); - - // Step 1: Make sure your APIKey is URL encoded - String encodedApiKey = URLEncoder.encode(apiKey, "UTF-8"); - - // Step 2: URL encode each parameter value, then sort the parameters and apiKey in - // alphabetical order, and then toLowerCase all the parameters, parameter values and apiKey. - // Please note that if any parameters with a '&' as a value will cause this test client to fail since we are using - // '&' to delimit - // the string - List sortedParams = new ArrayList(); - sortedParams.add("apikey=" + encodedApiKey.toLowerCase()); - StringTokenizer st = new StringTokenizer(apiUrl, "&"); - String url = null; - boolean first = true; - while (st.hasMoreTokens()) { - String paramValue = st.nextToken(); - String param = paramValue.substring(0, paramValue.indexOf("=")); - String value = URLEncoder.encode(paramValue.substring(paramValue.indexOf("=") + 1, paramValue.length()), "UTF-8"); - if (first) { - url = param + "=" + value; - first = false; - } else { - url = url + "&" + param + "=" + value; - } - sortedParams.add(param.toLowerCase() + "=" + value.toLowerCase()); - } - Collections.sort(sortedParams); - - System.out.println("Sorted Parameters: " + sortedParams); - - // Step 3: Construct the sorted URL and sign and URL encode the sorted URL with your secret key - String sortedUrl = null; - first = true; - for (String param : sortedParams) { - if (first) { - sortedUrl = param; - first = false; - } else { - sortedUrl = sortedUrl + "&" + param; - } - } - System.out.println("sorted URL : " + sortedUrl); - String encodedSignature = signRequest(sortedUrl, secretKey); - - // Step 4: Construct the final URL we want to send to the CloudStack Management Server - // Final result should look like: - // http(s)://://client/api?&apiKey=&signature= - String finalUrl = host + "?" + url + "&apiKey=" + apiKey + "&signature=" + encodedSignature; - System.out.println("final URL : " + finalUrl); - - // Step 5: Perform a HTTP GET on this URL to execute the command - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(finalUrl); - int responseCode = client.executeMethod(method); - if (responseCode == 200) { - // SUCCESS! - System.out.println("Successfully executed command"); - } else { - // FAILED! - System.out.println("Unable to execute command with response code: " + responseCode); - } - - } catch (Throwable t) { - System.out.println(t); - } - } - - /** - * 1. Signs a string with a secret key using SHA-1 2. Base64 encode the result 3. URL encode the final result - * - * @param request - * @param key - * @return - */ - public static String signRequest(String request, String key) { - try { - Mac mac = Mac.getInstance("HmacSHA1"); - SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "HmacSHA1"); - mac.init(keySpec); - mac.update(request.getBytes()); - byte[] encryptedBytes = mac.doFinal(); - return URLEncoder.encode(Base64.encodeBytes(encryptedBytes), "UTF-8"); - } catch (Exception ex) { - System.out.println(ex); - } - return null; - } -} + * + * + * + * + * + */ + +/** + * Sample CloudStack Management User API Executor. + * + * Prerequisites: - Edit usercloud.properties to include your host, apiUrl, apiKey, and secretKey - Use ./executeUserAPI.sh to + * execute this test class + * + * @author will + * + */ +public class UserCloudAPIExecutor { + public static void main(String[] args) { + // Host + String host = null; + + // Fully qualified URL with http(s)://host:port + String apiUrl = null; + + // ApiKey and secretKey as given by your CloudStack vendor + String apiKey = null; + String secretKey = null; + + try { + Properties prop = new Properties(); + prop.load(new FileInputStream("usercloud.properties")); + + // host + host = prop.getProperty("host"); + if (host == null) { + System.out.println("Please specify a valid host in the format of http(s)://:/client/api in your usercloud.properties file."); + } + + // apiUrl + apiUrl = prop.getProperty("apiUrl"); + if (apiUrl == null) { + System.out.println("Please specify a valid API URL in the format of command=¶m1=¶m2=... in your usercloud.properties file."); + } + + // apiKey + apiKey = prop.getProperty("apiKey"); + if (apiKey == null) { + System.out.println("Please specify your API Key as provided by your CloudStack vendor in your usercloud.properties file."); + } + + // secretKey + secretKey = prop.getProperty("secretKey"); + if (secretKey == null) { + System.out.println("Please specify your secret Key as provided by your CloudStack vendor in your usercloud.properties file."); + } + + if (apiUrl == null || apiKey == null || secretKey == null) { + return; + } + + System.out.println("Constructing API call to host = '" + host + "' with API command = '" + apiUrl + "' using apiKey = '" + apiKey + "' and secretKey = '" + secretKey + "'"); + + // Step 1: Make sure your APIKey is URL encoded + String encodedApiKey = URLEncoder.encode(apiKey, "UTF-8"); + + // Step 2: URL encode each parameter value, then sort the parameters and apiKey in + // alphabetical order, and then toLowerCase all the parameters, parameter values and apiKey. + // Please note that if any parameters with a '&' as a value will cause this test client to fail since we are using + // '&' to delimit + // the string + List sortedParams = new ArrayList(); + sortedParams.add("apikey=" + encodedApiKey.toLowerCase()); + StringTokenizer st = new StringTokenizer(apiUrl, "&"); + String url = null; + boolean first = true; + while (st.hasMoreTokens()) { + String paramValue = st.nextToken(); + String param = paramValue.substring(0, paramValue.indexOf("=")); + String value = URLEncoder.encode(paramValue.substring(paramValue.indexOf("=") + 1, paramValue.length()), "UTF-8"); + if (first) { + url = param + "=" + value; + first = false; + } else { + url = url + "&" + param + "=" + value; + } + sortedParams.add(param.toLowerCase() + "=" + value.toLowerCase()); + } + Collections.sort(sortedParams); + + System.out.println("Sorted Parameters: " + sortedParams); + + // Step 3: Construct the sorted URL and sign and URL encode the sorted URL with your secret key + String sortedUrl = null; + first = true; + for (String param : sortedParams) { + if (first) { + sortedUrl = param; + first = false; + } else { + sortedUrl = sortedUrl + "&" + param; + } + } + System.out.println("sorted URL : " + sortedUrl); + String encodedSignature = signRequest(sortedUrl, secretKey); + + // Step 4: Construct the final URL we want to send to the CloudStack Management Server + // Final result should look like: + // http(s)://://client/api?&apiKey=&signature= + String finalUrl = host + "?" + url + "&apiKey=" + apiKey + "&signature=" + encodedSignature; + System.out.println("final URL : " + finalUrl); + + // Step 5: Perform a HTTP GET on this URL to execute the command + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(finalUrl); + int responseCode = client.executeMethod(method); + if (responseCode == 200) { + // SUCCESS! + System.out.println("Successfully executed command"); + } else { + // FAILED! + System.out.println("Unable to execute command with response code: " + responseCode); + } + + } catch (Throwable t) { + System.out.println(t); + } + } + + /** + * 1. Signs a string with a secret key using SHA-1 2. Base64 encode the result 3. URL encode the final result + * + * @param request + * @param key + * @return + */ + public static String signRequest(String request, String key) { + try { + Mac mac = Mac.getInstance("HmacSHA1"); + SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "HmacSHA1"); + mac.init(keySpec); + mac.update(request.getBytes()); + byte[] encryptedBytes = mac.doFinal(); + return URLEncoder.encode(Base64.encodeBytes(encryptedBytes), "UTF-8"); + } catch (Exception ex) { + System.out.println(ex); + } + return null; + } +} diff --git a/test/src/com/cloud/test/longrun/BuildGuestNetwork.java b/test/src/com/cloud/test/longrun/BuildGuestNetwork.java index bdd56a2fd4c..236c9ea46a4 100644 --- a/test/src/com/cloud/test/longrun/BuildGuestNetwork.java +++ b/test/src/com/cloud/test/longrun/BuildGuestNetwork.java @@ -10,115 +10,115 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.longrun; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - - -import org.apache.log4j.Logger; - - -public class BuildGuestNetwork { - - public static final Logger s_logger= Logger.getLogger(BuildGuestNetwork.class.getClass()); - private static final int _apiPort=8096; - private static final int _developerPort=8080; - private static final String _apiUrl = "/client/api"; - private static int numVM=1; - private static long zoneId=-1L; - private static long templateId=3; - private static long serviceOfferingId=1; - - - - public static void main (String[] args){ - - List argsList = Arrays.asList(args); - Iterator iter = argsList.iterator(); - String host = "http://localhost"; - int numThreads = 1; - - while (iter.hasNext()){ - String arg = iter.next(); - if (arg.equals("-h")){ - host="http://"+iter.next(); - } - if (arg.equals("-t")){ - numThreads=Integer.parseInt(iter.next()); - } - if (arg.equals("-n")){ - numVM=Integer.parseInt(iter.next()); - } - if (arg.equals("-z")){ - zoneId=Integer.parseInt(iter.next()); - } - - if (arg.equals("-e")){ - templateId=Integer.parseInt(iter.next()); - } - - if (arg.equals("-s")){ - serviceOfferingId=Integer.parseInt(iter.next()); - } - } - - final String server = host + ":" + _apiPort + "/"; - final String developerServer = host + ":" + _developerPort + _apiUrl; - s_logger.info("Starting test in "+numThreads+" thread(s). Each thread is launching "+numVM+" VMs"); - - for (int i=0; i argsList = Arrays.asList(args); + Iterator iter = argsList.iterator(); + String host = "http://localhost"; + int numThreads = 1; + + while (iter.hasNext()){ + String arg = iter.next(); + if (arg.equals("-h")){ + host="http://"+iter.next(); + } + if (arg.equals("-t")){ + numThreads=Integer.parseInt(iter.next()); + } + if (arg.equals("-n")){ + numVM=Integer.parseInt(iter.next()); + } + if (arg.equals("-z")){ + zoneId=Integer.parseInt(iter.next()); + } + + if (arg.equals("-e")){ + templateId=Integer.parseInt(iter.next()); + } + + if (arg.equals("-s")){ + serviceOfferingId=Integer.parseInt(iter.next()); + } + } + + final String server = host + ":" + _apiPort + "/"; + final String developerServer = host + ":" + _developerPort + _apiUrl; + s_logger.info("Starting test in "+numThreads+" thread(s). Each thread is launching "+numVM+" VMs"); + + for (int i=0; i argsList = Arrays.asList(args); - Iterator iter = argsList.iterator(); - String host = "http://localhost"; - int numThreads = 1; - - while (iter.hasNext()){ - String arg = iter.next(); - if (arg.equals("-h")){ - host="http://"+iter.next(); - } - if (arg.equals("-t")){ - numThreads=Integer.parseInt(iter.next()); - } - if (arg.equals("-n")){ - numVM=Integer.parseInt(iter.next()); - } - } - - final String server = host + ":" + _apiPort + "/"; - final String developerServer = host + ":" + _developerPort + _apiUrl; - - s_logger.info("Starting test in "+numThreads+" thread(s). Each thread is launching "+numVM+" VMs"); - - for (int i=0; i errorInfo = TestClientWithAPI.getSingleValueFromXML(is, - new String[] { "errorCode", "description" }); - s_logger - .error("create ip forwarding rule (linux) test failed with errorCode: " - + errorInfo.get("errorCode") - + " and description: " - + errorInfo.get("description")); - } else { - s_logger.error("internal error processing request: " - + method.getStatusText()); - } - return responseCode; - } - - + + + +public class PerformanceWithAPI { + +public static final Logger s_logger= Logger.getLogger(PerformanceWithAPI.class.getClass()); +private static final int _retry=10; +private static final int _apiPort=8096; +private static int numVM=2; +private static final long _zoneId=-1L; +private static final long _templateId=3; +private static final long _serviceOfferingId=1; +private static final String _apiUrl = "/client/api"; +private static final int _developerPort=8080; + + + + public static void main (String[] args){ + + List argsList = Arrays.asList(args); + Iterator iter = argsList.iterator(); + String host = "http://localhost"; + int numThreads = 1; + + while (iter.hasNext()){ + String arg = iter.next(); + if (arg.equals("-h")){ + host="http://"+iter.next(); + } + if (arg.equals("-t")){ + numThreads=Integer.parseInt(iter.next()); + } + if (arg.equals("-n")){ + numVM=Integer.parseInt(iter.next()); + } + } + + final String server = host + ":" + _apiPort + "/"; + final String developerServer = host + ":" + _developerPort + _apiUrl; + + s_logger.info("Starting test in "+numThreads+" thread(s). Each thread is launching "+numVM+" VMs"); + + for (int i=0; i errorInfo = TestClientWithAPI.getSingleValueFromXML(is, + new String[] { "errorCode", "description" }); + s_logger + .error("create ip forwarding rule (linux) test failed with errorCode: " + + errorInfo.get("errorCode") + + " and description: " + + errorInfo.get("description")); + } else { + s_logger.error("internal error processing request: " + + method.getStatusText()); + } + return responseCode; + } + + } \ No newline at end of file diff --git a/test/src/com/cloud/test/longrun/User.java b/test/src/com/cloud/test/longrun/User.java index 8ada429f479..7ff4674eb1a 100644 --- a/test/src/com/cloud/test/longrun/User.java +++ b/test/src/com/cloud/test/longrun/User.java @@ -10,225 +10,225 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.longrun; -import java.util.ArrayList; -import java.util.Map; -import java.io.InputStream; -import java.io.IOException; -import java.net.URLEncoder; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpException; -import org.apache.commons.httpclient.HttpMethod; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.log4j.Logger; - +package com.cloud.test.longrun; +import java.util.ArrayList; +import java.util.Map; +import java.io.InputStream; +import java.io.IOException; +import java.net.URLEncoder; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.HttpException; +import org.apache.commons.httpclient.HttpMethod; +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.log4j.Logger; + import com.cloud.test.stress.TestClientWithAPI; - - - -public class User { - public static final Logger s_logger= Logger.getLogger(User.class.getClass()); - - private ArrayList virtualMachines; - private ArrayList publicIp; - private String server; - private String developerServer; - private String userName; - private String userId; - private String apiKey; - private String secretKey; - private String password; - private String encryptedPassword; - - - public User(String userName, String password, String server, String developerServer) - { - this.server=server; - this.developerServer=developerServer; - this.userName=userName; - this.password=password; - this.virtualMachines = new ArrayList(); - this.publicIp = new ArrayList(); - } - - public ArrayList getVirtualMachines() { - return virtualMachines; - } - - - public void setVirtualMachines(ArrayList virtualMachines) { - this.virtualMachines = virtualMachines; - } - - - public String getUserId() { - return userId; - } - - - public void setUserId(String userId) { - this.userId = userId; - } - - - public ArrayList getPublicIp() { - return publicIp; - } - - - public void setPublicIp(ArrayList publicIp) { - this.publicIp = publicIp; - } - - - - public String getServer() { - return server; - } - - - - public void setServer(String server) { - this.server = server; - } - - - - public String getUserName() { - return userName; - } - - - - public void setUserName(String userName) { - this.userName = userName; - } - - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getSecretKey() { - return secretKey; - } - - public void setSecretKey(String secretKey) { - this.secretKey = secretKey; - } - - - - public String getDeveloperServer() { - return developerServer; - } - - public void setDeveloperServer(String developerServer) { - this.developerServer = developerServer; - } - - public void launchUser() throws IOException { - String encodedUsername = URLEncoder.encode(this.getUserName(), "UTF-8"); - this.encryptedPassword=TestClientWithAPI.createMD5Password(this.getPassword()); - String encodedPassword = URLEncoder.encode(this.encryptedPassword, "UTF-8"); - String url = this.server + "?command=createUser&username=" + encodedUsername - + "&password=" + encodedPassword - + "&firstname=Test&lastname=Test&email=alena@vmops.com&domainId=1"; - String userIdStr=null; - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode = client.executeMethod(method); - - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map userIdValues = TestClientWithAPI.getSingleValueFromXML(is, - new String[] { "id" }); - userIdStr = userIdValues.get("id"); - if ((userIdStr != null) && (Long.parseLong(userIdStr)!=-1)) { - this.setUserId(userIdStr); - } - } - } - - public void retrievePublicIp(long zoneId) throws IOException{ - - String encodedApiKey = URLEncoder.encode(this.apiKey, "UTF-8"); - String encodedZoneId=URLEncoder.encode(""+zoneId,"UTF-8"); - String requestToSign = "apiKey=" + encodedApiKey - + "&command=associateIpAddress" + "&zoneId="+encodedZoneId; - requestToSign = requestToSign.toLowerCase(); - String signature = TestClientWithAPI.signRequest(requestToSign, this.secretKey); - String encodedSignature = URLEncoder.encode(signature, "UTF-8"); - - String url = this.developerServer + "?command=associateIpAddress" + "&apiKey=" - + encodedApiKey + "&zoneId="+encodedZoneId+"&signature=" - + encodedSignature; - - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode=client.executeMethod(method); - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map values = TestClientWithAPI.getSingleValueFromXML(is, - new String[] { "ipaddress" }); - this.getPublicIp().add(values.get("ipaddress")); - s_logger.info("Ip address is " + values.get("ipaddress")); - } else if (responseCode == 500) { - InputStream is = method.getResponseBodyAsStream(); - Map errorInfo = TestClientWithAPI.getSingleValueFromXML(is, - new String[] { "errorcode", "description" }); - s_logger.error("associate ip test failed with errorCode: " - + errorInfo.get("errorCode") + " and description: " - + errorInfo.get("description")); - } else { - s_logger.error("internal error processing request: " - + method.getStatusText()); - } - - } - - public void registerUser()throws HttpException, IOException{ - - String encodedUsername = URLEncoder.encode(this.userName, "UTF-8"); - String encodedPassword = URLEncoder.encode(this.password, "UTF-8"); - String url = server + "?command=register&username=" + encodedUsername - + "&domainid=1"; - s_logger.info("registering: " + this.userName+" with url "+url); - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode = client.executeMethod(method); - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map requestKeyValues = TestClientWithAPI.getSingleValueFromXML(is, - new String[] { "apikey", "secretkey" }); - this.setApiKey(requestKeyValues.get("apikey")); - this.setSecretKey(requestKeyValues.get("secretkey")); - } else if (responseCode == 500) { - InputStream is = method.getResponseBodyAsStream(); - Map errorInfo = TestClientWithAPI.getSingleValueFromXML(is, - new String[] { "errorcode", "description" }); - s_logger.error("registration failed with errorCode: " - + errorInfo.get("errorCode") + " and description: " - + errorInfo.get("description")); - } else { - s_logger.error("internal error processing request: " - + method.getStatusText()); - } - } - -} - - + + + +public class User { + public static final Logger s_logger= Logger.getLogger(User.class.getClass()); + + private ArrayList virtualMachines; + private ArrayList publicIp; + private String server; + private String developerServer; + private String userName; + private String userId; + private String apiKey; + private String secretKey; + private String password; + private String encryptedPassword; + + + public User(String userName, String password, String server, String developerServer) + { + this.server=server; + this.developerServer=developerServer; + this.userName=userName; + this.password=password; + this.virtualMachines = new ArrayList(); + this.publicIp = new ArrayList(); + } + + public ArrayList getVirtualMachines() { + return virtualMachines; + } + + + public void setVirtualMachines(ArrayList virtualMachines) { + this.virtualMachines = virtualMachines; + } + + + public String getUserId() { + return userId; + } + + + public void setUserId(String userId) { + this.userId = userId; + } + + + public ArrayList getPublicIp() { + return publicIp; + } + + + public void setPublicIp(ArrayList publicIp) { + this.publicIp = publicIp; + } + + + + public String getServer() { + return server; + } + + + + public void setServer(String server) { + this.server = server; + } + + + + public String getUserName() { + return userName; + } + + + + public void setUserName(String userName) { + this.userName = userName; + } + + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getSecretKey() { + return secretKey; + } + + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + + + + public String getDeveloperServer() { + return developerServer; + } + + public void setDeveloperServer(String developerServer) { + this.developerServer = developerServer; + } + + public void launchUser() throws IOException { + String encodedUsername = URLEncoder.encode(this.getUserName(), "UTF-8"); + this.encryptedPassword=TestClientWithAPI.createMD5Password(this.getPassword()); + String encodedPassword = URLEncoder.encode(this.encryptedPassword, "UTF-8"); + String url = this.server + "?command=createUser&username=" + encodedUsername + + "&password=" + encodedPassword + + "&firstname=Test&lastname=Test&email=alena@vmops.com&domainId=1"; + String userIdStr=null; + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode = client.executeMethod(method); + + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map userIdValues = TestClientWithAPI.getSingleValueFromXML(is, + new String[] { "id" }); + userIdStr = userIdValues.get("id"); + if ((userIdStr != null) && (Long.parseLong(userIdStr)!=-1)) { + this.setUserId(userIdStr); + } + } + } + + public void retrievePublicIp(long zoneId) throws IOException{ + + String encodedApiKey = URLEncoder.encode(this.apiKey, "UTF-8"); + String encodedZoneId=URLEncoder.encode(""+zoneId,"UTF-8"); + String requestToSign = "apiKey=" + encodedApiKey + + "&command=associateIpAddress" + "&zoneId="+encodedZoneId; + requestToSign = requestToSign.toLowerCase(); + String signature = TestClientWithAPI.signRequest(requestToSign, this.secretKey); + String encodedSignature = URLEncoder.encode(signature, "UTF-8"); + + String url = this.developerServer + "?command=associateIpAddress" + "&apiKey=" + + encodedApiKey + "&zoneId="+encodedZoneId+"&signature=" + + encodedSignature; + + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode=client.executeMethod(method); + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map values = TestClientWithAPI.getSingleValueFromXML(is, + new String[] { "ipaddress" }); + this.getPublicIp().add(values.get("ipaddress")); + s_logger.info("Ip address is " + values.get("ipaddress")); + } else if (responseCode == 500) { + InputStream is = method.getResponseBodyAsStream(); + Map errorInfo = TestClientWithAPI.getSingleValueFromXML(is, + new String[] { "errorcode", "description" }); + s_logger.error("associate ip test failed with errorCode: " + + errorInfo.get("errorCode") + " and description: " + + errorInfo.get("description")); + } else { + s_logger.error("internal error processing request: " + + method.getStatusText()); + } + + } + + public void registerUser()throws HttpException, IOException{ + + String encodedUsername = URLEncoder.encode(this.userName, "UTF-8"); + String encodedPassword = URLEncoder.encode(this.password, "UTF-8"); + String url = server + "?command=register&username=" + encodedUsername + + "&domainid=1"; + s_logger.info("registering: " + this.userName+" with url "+url); + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode = client.executeMethod(method); + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map requestKeyValues = TestClientWithAPI.getSingleValueFromXML(is, + new String[] { "apikey", "secretkey" }); + this.setApiKey(requestKeyValues.get("apikey")); + this.setSecretKey(requestKeyValues.get("secretkey")); + } else if (responseCode == 500) { + InputStream is = method.getResponseBodyAsStream(); + Map errorInfo = TestClientWithAPI.getSingleValueFromXML(is, + new String[] { "errorcode", "description" }); + s_logger.error("registration failed with errorCode: " + + errorInfo.get("errorCode") + " and description: " + + errorInfo.get("description")); + } else { + s_logger.error("internal error processing request: " + + method.getStatusText()); + } + } + +} + + diff --git a/test/src/com/cloud/test/longrun/VirtualMachine.java b/test/src/com/cloud/test/longrun/VirtualMachine.java index a865c11e131..24cd2069658 100644 --- a/test/src/com/cloud/test/longrun/VirtualMachine.java +++ b/test/src/com/cloud/test/longrun/VirtualMachine.java @@ -10,103 +10,103 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.longrun; - -import java.io.InputStream; -import java.net.URLEncoder; -import java.util.Map; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpMethod; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.log4j.Logger; - +package com.cloud.test.longrun; + +import java.io.InputStream; +import java.net.URLEncoder; +import java.util.Map; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.HttpMethod; +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.log4j.Logger; + import com.cloud.test.stress.TestClientWithAPI; - - -import java.io.IOException; - - -public class VirtualMachine { - public static final Logger s_logger= Logger.getLogger(VirtualMachine.class.getClass()); - - private String privateIp; - private String userId; - - - public VirtualMachine(String userId){ - this.userId=userId; - } - - - public String getPrivateIp() { - return privateIp; - } - - - public void setPrivateIp(String privateIp) { - this.privateIp = privateIp; - } - - - public String getUserId() { - return userId; - } - - - public void setUserId(String userId) { - this.userId = userId; - } - - - public void deployVM(long zoneId, long serviceOfferingId, long templateId, String server, String apiKey, String secretKey) throws IOException{ - - String encodedZoneId = URLEncoder.encode("" + zoneId, "UTF-8"); - String encodedServiceOfferingId = URLEncoder.encode("" - + serviceOfferingId, "UTF-8"); - String encodedTemplateId = URLEncoder.encode("" + templateId, - "UTF-8"); - String encodedApiKey=URLEncoder.encode(apiKey, "UTF-8"); - String requestToSign = "apiKey=" + encodedApiKey - + "&command=deployVirtualMachine&serviceOfferingId=" - + encodedServiceOfferingId + "&templateId=" - + encodedTemplateId + "&zoneId=" + encodedZoneId; - - requestToSign = requestToSign.toLowerCase(); - String signature = TestClientWithAPI.signRequest(requestToSign, secretKey); - String encodedSignature = URLEncoder.encode(signature, "UTF-8"); - String url = server + "?command=deployVirtualMachine" - + "&zoneId=" + encodedZoneId + "&serviceOfferingId=" - + encodedServiceOfferingId + "&templateId=" - + encodedTemplateId + "&apiKey=" + encodedApiKey - + "&signature=" + encodedSignature; - - s_logger.info("Sending this request to deploy a VM: "+url); - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode = client.executeMethod(method); - s_logger.info("deploy linux vm response code: " + responseCode); - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map values = TestClientWithAPI.getSingleValueFromXML(is, - new String[] { "id", "ipaddress" }); - long linuxVMId = Long.parseLong(values.get("id")); - s_logger.info("got linux virtual machine id: " + linuxVMId); - this.setPrivateIp(values.get("ipaddress")); - - } else if (responseCode == 500) { - InputStream is = method.getResponseBodyAsStream(); - Map errorInfo = TestClientWithAPI.getSingleValueFromXML(is, - new String[] { "errorcode", "description" }); - s_logger.error("deploy linux vm test failed with errorCode: " - + errorInfo.get("errorCode") + " and description: " - + errorInfo.get("description")); - } else { - s_logger.error("internal error processing request: " - + method.getStatusText()); - } - } - - - -} + + +import java.io.IOException; + + +public class VirtualMachine { + public static final Logger s_logger= Logger.getLogger(VirtualMachine.class.getClass()); + + private String privateIp; + private String userId; + + + public VirtualMachine(String userId){ + this.userId=userId; + } + + + public String getPrivateIp() { + return privateIp; + } + + + public void setPrivateIp(String privateIp) { + this.privateIp = privateIp; + } + + + public String getUserId() { + return userId; + } + + + public void setUserId(String userId) { + this.userId = userId; + } + + + public void deployVM(long zoneId, long serviceOfferingId, long templateId, String server, String apiKey, String secretKey) throws IOException{ + + String encodedZoneId = URLEncoder.encode("" + zoneId, "UTF-8"); + String encodedServiceOfferingId = URLEncoder.encode("" + + serviceOfferingId, "UTF-8"); + String encodedTemplateId = URLEncoder.encode("" + templateId, + "UTF-8"); + String encodedApiKey=URLEncoder.encode(apiKey, "UTF-8"); + String requestToSign = "apiKey=" + encodedApiKey + + "&command=deployVirtualMachine&serviceOfferingId=" + + encodedServiceOfferingId + "&templateId=" + + encodedTemplateId + "&zoneId=" + encodedZoneId; + + requestToSign = requestToSign.toLowerCase(); + String signature = TestClientWithAPI.signRequest(requestToSign, secretKey); + String encodedSignature = URLEncoder.encode(signature, "UTF-8"); + String url = server + "?command=deployVirtualMachine" + + "&zoneId=" + encodedZoneId + "&serviceOfferingId=" + + encodedServiceOfferingId + "&templateId=" + + encodedTemplateId + "&apiKey=" + encodedApiKey + + "&signature=" + encodedSignature; + + s_logger.info("Sending this request to deploy a VM: "+url); + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode = client.executeMethod(method); + s_logger.info("deploy linux vm response code: " + responseCode); + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map values = TestClientWithAPI.getSingleValueFromXML(is, + new String[] { "id", "ipaddress" }); + long linuxVMId = Long.parseLong(values.get("id")); + s_logger.info("got linux virtual machine id: " + linuxVMId); + this.setPrivateIp(values.get("ipaddress")); + + } else if (responseCode == 500) { + InputStream is = method.getResponseBodyAsStream(); + Map errorInfo = TestClientWithAPI.getSingleValueFromXML(is, + new String[] { "errorcode", "description" }); + s_logger.error("deploy linux vm test failed with errorCode: " + + errorInfo.get("errorCode") + " and description: " + + errorInfo.get("description")); + } else { + s_logger.error("internal error processing request: " + + method.getStatusText()); + } + } + + + +} diff --git a/test/src/com/cloud/test/longrun/guestNetwork.java b/test/src/com/cloud/test/longrun/guestNetwork.java index 54f2df908f2..e9bafcd8256 100644 --- a/test/src/com/cloud/test/longrun/guestNetwork.java +++ b/test/src/com/cloud/test/longrun/guestNetwork.java @@ -10,94 +10,94 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.longrun; -import java.util.ArrayList; -import java.util.Random; -import org.apache.log4j.Logger; -import org.apache.log4j.NDC; -import com.trilead.ssh2.Connection; -import com.trilead.ssh2.Session; - - -public class guestNetwork implements Runnable{ - public static final Logger s_logger= Logger.getLogger(guestNetwork.class.getClass()); - - private String publicIp; - private ArrayList virtualMachines; - private int retryNum; - - public guestNetwork(String publicIp, int retryNum){ - this.publicIp=publicIp; - this.retryNum=retryNum; - } - - public ArrayList getVirtualMachines() { - return virtualMachines; - } - - public void setVirtualMachines(ArrayList virtualMachines) { - this.virtualMachines = virtualMachines; - } - - public void run(){ - NDC.push("Following thread has started"+Thread.currentThread().getName()); - int retry = 0; - - //Start copying files between machines in the network - s_logger.info("The size of the array is " + this.virtualMachines.size()); - while (true) { - try { - if (retry > 0) { - s_logger.info("Retry attempt : " + retry - + " ...sleeping 120 seconds before next attempt"); - Thread.sleep(120000); - } - for (VirtualMachine vm: this.virtualMachines ){ - - s_logger.info("Attempting to SSH into linux host " + this.publicIp - + " with retry attempt: " + retry); - Connection conn = new Connection(this.publicIp); - conn.connect(null, 600000, 600000); - - s_logger.info("SSHed successfully into linux host " + this.publicIp); - - boolean isAuthenticated = conn.authenticateWithPassword("root", - "password"); - - if (isAuthenticated == false) { - s_logger.info("Authentication failed"); - } - //execute copy command - Session sess = conn.openSession(); - String fileName; - Random ran = new Random(); - fileName=Math.abs(ran.nextInt())+"-file"; - String copyCommand = new String ("./scpScript "+vm.getPrivateIp()+" "+fileName); - s_logger.info("Executing " + copyCommand); - sess.execCommand(copyCommand); - Thread.sleep(120000); - sess.close(); - - //execute wget command - sess = conn.openSession(); - String downloadCommand = new String ("wget http://172.16.0.220/scripts/checkDiskSpace.sh; chmod +x *sh; ./checkDiskSpace.sh; rm -rf checkDiskSpace.sh"); - s_logger.info("Executing " + downloadCommand); - sess.execCommand(downloadCommand); - Thread.sleep(120000); - sess.close(); - - //close the connection - conn.close(); - } - }catch (Exception ex) { - s_logger.error(ex); - retry++; - if (retry == retryNum) { - s_logger.info("Performance Guest Network test failed with error " - + ex.getMessage()) ; - } - } - } - - } -} +package com.cloud.test.longrun; +import java.util.ArrayList; +import java.util.Random; +import org.apache.log4j.Logger; +import org.apache.log4j.NDC; +import com.trilead.ssh2.Connection; +import com.trilead.ssh2.Session; + + +public class guestNetwork implements Runnable{ + public static final Logger s_logger= Logger.getLogger(guestNetwork.class.getClass()); + + private String publicIp; + private ArrayList virtualMachines; + private int retryNum; + + public guestNetwork(String publicIp, int retryNum){ + this.publicIp=publicIp; + this.retryNum=retryNum; + } + + public ArrayList getVirtualMachines() { + return virtualMachines; + } + + public void setVirtualMachines(ArrayList virtualMachines) { + this.virtualMachines = virtualMachines; + } + + public void run(){ + NDC.push("Following thread has started"+Thread.currentThread().getName()); + int retry = 0; + + //Start copying files between machines in the network + s_logger.info("The size of the array is " + this.virtualMachines.size()); + while (true) { + try { + if (retry > 0) { + s_logger.info("Retry attempt : " + retry + + " ...sleeping 120 seconds before next attempt"); + Thread.sleep(120000); + } + for (VirtualMachine vm: this.virtualMachines ){ + + s_logger.info("Attempting to SSH into linux host " + this.publicIp + + " with retry attempt: " + retry); + Connection conn = new Connection(this.publicIp); + conn.connect(null, 600000, 600000); + + s_logger.info("SSHed successfully into linux host " + this.publicIp); + + boolean isAuthenticated = conn.authenticateWithPassword("root", + "password"); + + if (isAuthenticated == false) { + s_logger.info("Authentication failed"); + } + //execute copy command + Session sess = conn.openSession(); + String fileName; + Random ran = new Random(); + fileName=Math.abs(ran.nextInt())+"-file"; + String copyCommand = new String ("./scpScript "+vm.getPrivateIp()+" "+fileName); + s_logger.info("Executing " + copyCommand); + sess.execCommand(copyCommand); + Thread.sleep(120000); + sess.close(); + + //execute wget command + sess = conn.openSession(); + String downloadCommand = new String ("wget http://172.16.0.220/scripts/checkDiskSpace.sh; chmod +x *sh; ./checkDiskSpace.sh; rm -rf checkDiskSpace.sh"); + s_logger.info("Executing " + downloadCommand); + sess.execCommand(downloadCommand); + Thread.sleep(120000); + sess.close(); + + //close the connection + conn.close(); + } + }catch (Exception ex) { + s_logger.error(ex); + retry++; + if (retry == retryNum) { + s_logger.info("Performance Guest Network test failed with error " + + ex.getMessage()) ; + } + } + } + + } +} diff --git a/test/src/com/cloud/test/regression/DelegatedAdminTest.java b/test/src/com/cloud/test/regression/DelegatedAdminTest.java index 74e5f2a4f54..6ade35f8512 100644 --- a/test/src/com/cloud/test/regression/DelegatedAdminTest.java +++ b/test/src/com/cloud/test/regression/DelegatedAdminTest.java @@ -10,119 +10,119 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.regression; - - -import java.util.HashMap; - -import org.apache.log4j.Logger; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import com.cloud.test.regression.ApiCommand.ResponseType; - -public class DelegatedAdminTest extends TestCase{ - -public static final Logger s_logger = Logger.getLogger(DelegatedAdminTest.class.getName()); - - public DelegatedAdminTest(){ - this.setClient(); - this.setParam(new HashMap()); - } - - public boolean executeTest(){ - int error=0; - - for (Document eachElement: this.getInputFile()) { - - Element rootElement = eachElement.getDocumentElement(); - NodeList commandLst = rootElement.getElementsByTagName("command"); - - //Analyze each command, send request and build the array list of api commands - for (int i=0; i()); + } + + public boolean executeTest(){ + int error=0; + + for (Document eachElement: this.getInputFile()) { + + Element rootElement = eachElement.getDocumentElement(); + NodeList commandLst = rootElement.getElementsByTagName("command"); + + //Analyze each command, send request and build the array list of api commands + for (int i=0; i()); - } - - - public boolean executeTest() { - int error=0; - Element rootElement = this.getInputFile().get(0).getDocumentElement(); - NodeList commandLst = rootElement.getElementsByTagName("command"); - - //Analyze each command, send request and build the array list of api commands - for (int i=0; i argsList = Arrays.asList(args); - Iterator iter = argsList.iterator(); - String host = null; - String file = null; - - while (iter.hasNext()) { - String arg = iter.next(); - // management server host - if (arg.equals("-h")) { - host = iter.next(); - } - if (arg.equals("-f")) { - file = iter.next(); - } - } - +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import org.apache.log4j.Logger; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class Deploy extends TestCase{ + public static final Logger s_logger = Logger.getLogger(Deploy.class.getName()); + + public Deploy(){ + this.setClient(); + this.setParam(new HashMap()); + } + + + public boolean executeTest() { + int error=0; + Element rootElement = this.getInputFile().get(0).getDocumentElement(); + NodeList commandLst = rootElement.getElementsByTagName("command"); + + //Analyze each command, send request and build the array list of api commands + for (int i=0; i argsList = Arrays.asList(args); + Iterator iter = argsList.iterator(); + String host = null; + String file = null; + + while (iter.hasNext()) { + String arg = iter.next(); + // management server host + if (arg.equals("-h")) { + host = iter.next(); + } + if (arg.equals("-f")) { + file = iter.next(); + } + } + Deploy deploy = new Deploy (); ArrayList inputFile = new ArrayList(); - inputFile.add(file); - deploy.setInputFile(inputFile); - deploy.setTestCaseName("Management server deployment"); - deploy.getParam().put("hostip", host); - deploy.getParam().put("apicommands", "../metadata/func/commands"); - deploy.setCommands(); - - s_logger.info("Starting deployment against host " + host); - - boolean result = deploy.executeTest(); - if (result == false) { - s_logger.error("DEPLOYMENT FAILED"); - System.exit(1); - } - else { - s_logger.info("DEPLOYMENT IS SUCCESSFUL"); - } - - } - -} - + inputFile.add(file); + deploy.setInputFile(inputFile); + deploy.setTestCaseName("Management server deployment"); + deploy.getParam().put("hostip", host); + deploy.getParam().put("apicommands", "../metadata/func/commands"); + deploy.setCommands(); + + s_logger.info("Starting deployment against host " + host); + + boolean result = deploy.executeTest(); + if (result == false) { + s_logger.error("DEPLOYMENT FAILED"); + System.exit(1); + } + else { + s_logger.info("DEPLOYMENT IS SUCCESSFUL"); + } + + } + +} + diff --git a/test/src/com/cloud/test/regression/EventsApiTest.java b/test/src/com/cloud/test/regression/EventsApiTest.java index 55a34282d82..8e5e9e5d6da 100644 --- a/test/src/com/cloud/test/regression/EventsApiTest.java +++ b/test/src/com/cloud/test/regression/EventsApiTest.java @@ -10,165 +10,165 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.regression; - -import java.sql.Statement; -import java.util.HashMap; - -import org.apache.log4j.Logger; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - +package com.cloud.test.regression; + +import java.sql.Statement; +import java.util.HashMap; + +import org.apache.log4j.Logger; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + import com.cloud.test.regression.ApiCommand.ResponseType; -import com.trilead.ssh2.Connection; -import com.trilead.ssh2.Session; - -public class EventsApiTest extends TestCase{ -public static final Logger s_logger = Logger.getLogger(EventsApiTest.class.getName()); - - - public EventsApiTest(){ - this.setClient(); - this.setParam(new HashMap()); - } - - public boolean executeTest(){ - int error=0; - Element rootElement = this.getInputFile().get(0).getDocumentElement(); - NodeList commandLst = rootElement.getElementsByTagName("command"); - - - //Analyze each command, send request and build the array list of api commands - for (int i=0; i expectedEvents = new HashMap(); - expectedEvents.put("VM.START", 1); - boolean eventResult = ApiCommand.verifyEvents(expectedEvents, "INFO", "http://" + this.getParam().get("hostip") + ":8096", "userid=" + this.getParam().get("userid1") + "&type=VM.START"); - s_logger.info("Test case 97 - listEvent command verification result is " + eventResult); - - //verify error events - eventResult = ApiCommand.verifyEvents("../metadata/error_events.properties", "ERROR", "http://" + this.getParam().get("hostip") + ":8096", this.getParam().get("erroruseraccount")); - s_logger.info("listEvent command verification result is " + eventResult); - - - if (error != 0) - return false; - else - return true; - } -} +import com.trilead.ssh2.Connection; +import com.trilead.ssh2.Session; + +public class EventsApiTest extends TestCase{ +public static final Logger s_logger = Logger.getLogger(EventsApiTest.class.getName()); + + + public EventsApiTest(){ + this.setClient(); + this.setParam(new HashMap()); + } + + public boolean executeTest(){ + int error=0; + Element rootElement = this.getInputFile().get(0).getDocumentElement(); + NodeList commandLst = rootElement.getElementsByTagName("command"); + + + //Analyze each command, send request and build the array list of api commands + for (int i=0; i expectedEvents = new HashMap(); + expectedEvents.put("VM.START", 1); + boolean eventResult = ApiCommand.verifyEvents(expectedEvents, "INFO", "http://" + this.getParam().get("hostip") + ":8096", "userid=" + this.getParam().get("userid1") + "&type=VM.START"); + s_logger.info("Test case 97 - listEvent command verification result is " + eventResult); + + //verify error events + eventResult = ApiCommand.verifyEvents("../metadata/error_events.properties", "ERROR", "http://" + this.getParam().get("hostip") + ":8096", this.getParam().get("erroruseraccount")); + s_logger.info("listEvent command verification result is " + eventResult); + + + if (error != 0) + return false; + else + return true; + } +} diff --git a/test/src/com/cloud/test/regression/HA.java b/test/src/com/cloud/test/regression/HA.java index 9ff843d0bc6..cdf2a1c052f 100644 --- a/test/src/com/cloud/test/regression/HA.java +++ b/test/src/com/cloud/test/regression/HA.java @@ -10,65 +10,65 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.regression; - -import org.apache.log4j.Logger; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import com.cloud.test.regression.ApiCommand.ResponseType; - -public class HA extends TestCase{ - - public static final Logger s_logger = Logger.getLogger(HA.class.getName()); - - public HA(){ - this.setClient(); - } - - public boolean executeTest(){ - int error=0; - Element rootElement = this.getInputFile().get(0).getDocumentElement(); - NodeList commandLst = rootElement.getElementsByTagName("command"); - - //Analyze each command, send request and build the array list of api commands - for (int i=0; i()); - } - - public boolean executeTest(){ - - int error=0; - Element rootElement = this.getInputFile().get(0).getDocumentElement(); - NodeList commandLst = rootElement.getElementsByTagName("command"); - - //Analyze each command, send request and build the array list of api commands - for (int i=0; i port = new ArrayList(); -// for (int i=1; i<65536; i++){ -// port.add(Integer.toString(i)); -// } -// -// //try all public ports -// for (String portValue : port) { -// try { -// String url = this.getHost() + ":8096/?command=createOrUpdateLoadBalancerRule&account=" + this.getParam().get("accountname") + "&publicip=" + this.getParam().get("boundaryip") + -// "&privateip=" + this.getParam().get("vmipaddress") + "&privateport=22&protocol=tcp&publicport=" + portValue; -// HttpClient client = new HttpClient(); -// HttpMethod method = new GetMethod(url); -// int responseCode = client.executeMethod(method); -// if (responseCode != 200 ) { -// error++; -// s_logger.error("Can't create LB rule for the public port " + portValue + ". Request was sent with url " + url); -// } -// }catch (Exception ex) { -// s_logger.error(ex); -// } -// } -// -// //try all private ports -// for (String portValue : port) { -// try { -// String url = this.getHost() + ":8096/?command=createOrUpdateLoadBalancerRule&account=" + this.getParam().get("accountname") + "&publicip=" + this.getParam().get("boundaryip") + -// "&privateip=" + this.getParam().get("vmipaddress") + "&publicport=22&protocol=tcp&privateport=" + portValue; -// HttpClient client = new HttpClient(); -// HttpMethod method = new GetMethod(url); -// int responseCode = client.executeMethod(method); -// if (responseCode != 200 ) { -// error++; -// s_logger.error("Can't create LB rule for the private port " + portValue + ". Request was sent with url " + url); -// } -// }catch (Exception ex) { -// s_logger.error(ex); -// } -// } - - - if (error != 0) - return false; - else - return true; - } - -} + + +public class LoadBalancingTest extends TestCase{ + + public static final Logger s_logger = Logger.getLogger(LoadBalancingTest.class.getName()); + + public LoadBalancingTest(){ + this.setClient(); + this.setParam(new HashMap()); + } + + public boolean executeTest(){ + + int error=0; + Element rootElement = this.getInputFile().get(0).getDocumentElement(); + NodeList commandLst = rootElement.getElementsByTagName("command"); + + //Analyze each command, send request and build the array list of api commands + for (int i=0; i port = new ArrayList(); +// for (int i=1; i<65536; i++){ +// port.add(Integer.toString(i)); +// } +// +// //try all public ports +// for (String portValue : port) { +// try { +// String url = this.getHost() + ":8096/?command=createOrUpdateLoadBalancerRule&account=" + this.getParam().get("accountname") + "&publicip=" + this.getParam().get("boundaryip") + +// "&privateip=" + this.getParam().get("vmipaddress") + "&privateport=22&protocol=tcp&publicport=" + portValue; +// HttpClient client = new HttpClient(); +// HttpMethod method = new GetMethod(url); +// int responseCode = client.executeMethod(method); +// if (responseCode != 200 ) { +// error++; +// s_logger.error("Can't create LB rule for the public port " + portValue + ". Request was sent with url " + url); +// } +// }catch (Exception ex) { +// s_logger.error(ex); +// } +// } +// +// //try all private ports +// for (String portValue : port) { +// try { +// String url = this.getHost() + ":8096/?command=createOrUpdateLoadBalancerRule&account=" + this.getParam().get("accountname") + "&publicip=" + this.getParam().get("boundaryip") + +// "&privateip=" + this.getParam().get("vmipaddress") + "&publicport=22&protocol=tcp&privateport=" + portValue; +// HttpClient client = new HttpClient(); +// HttpMethod method = new GetMethod(url); +// int responseCode = client.executeMethod(method); +// if (responseCode != 200 ) { +// error++; +// s_logger.error("Can't create LB rule for the private port " + portValue + ". Request was sent with url " + url); +// } +// }catch (Exception ex) { +// s_logger.error(ex); +// } +// } + + + if (error != 0) + return false; + else + return true; + } + +} diff --git a/test/src/com/cloud/test/regression/PortForwardingTest.java b/test/src/com/cloud/test/regression/PortForwardingTest.java index 13dc42429a4..2942edace53 100644 --- a/test/src/com/cloud/test/regression/PortForwardingTest.java +++ b/test/src/com/cloud/test/regression/PortForwardingTest.java @@ -10,8 +10,8 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.regression; - +package com.cloud.test.regression; + import java.util.HashMap; import org.apache.log4j.Logger; @@ -20,123 +20,123 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import com.cloud.test.regression.ApiCommand.ResponseType; - -public class PortForwardingTest extends TestCase{ - public static final Logger s_logger = Logger.getLogger(PortForwardingTest.class.getName()); - - public PortForwardingTest(){ - this.setClient(); - this.setParam(new HashMap()); - } - - public boolean executeTest(){ - - int error=0; - Element rootElement = this.getInputFile().get(0).getDocumentElement(); - NodeList commandLst = rootElement.getElementsByTagName("command"); - - //Analyze each command, send request and build the array list of api commands - for (int i=0; i port = new ArrayList(); -// for (int i=1; i<65536; i++){ -// port.add(Integer.toString(i)); -// } -// -// //try all public ports -// for (String portValue : port) { -// try { -// s_logger.info("public port is " + portValue); -// String url = this.getHost() + ":8096/?command=createOrUpdateIpForwardingRule&account=" + this.getParam().get("accountname") + "&publicip=" + this.getParam().get("boundaryip") + -// "&privateip=" + this.getParam().get("vmipaddress") + "&privateport=22&protocol=tcp&publicport=" + portValue; -// HttpClient client = new HttpClient(); -// HttpMethod method = new GetMethod(url); -// int responseCode = client.executeMethod(method); -// if (responseCode != 200 ) { -// error++; -// s_logger.error("Can't create portForwarding rule for the public port " + portValue + ". Request was sent with url " + url); -// } -// }catch (Exception ex) { -// s_logger.error(ex); -// } -// } -// -// //try all private ports -// for (String portValue : port) { -// try { -// String url = this.getHost() + ":8096/?command=createOrUpdateIpForwardingRule&account=" + this.getParam().get("accountname") + "&publicip=" + this.getParam().get("boundaryip") + -// "&privateip=" + this.getParam().get("vmipaddress") + "&publicport=22&protocol=tcp&privateport=" + portValue; -// HttpClient client = new HttpClient(); -// HttpMethod method = new GetMethod(url); -// int responseCode = client.executeMethod(method); -// if (responseCode != 200 ) { -// error++; -// s_logger.error("Can't create portForwarding rule for the private port " + portValue + ". Request was sent with url " + url); -// } -// }catch (Exception ex) { -// s_logger.error(ex); -// } -// } - - - if (error != 0) - return false; - else - return true; - } - -} + +public class PortForwardingTest extends TestCase{ + public static final Logger s_logger = Logger.getLogger(PortForwardingTest.class.getName()); + + public PortForwardingTest(){ + this.setClient(); + this.setParam(new HashMap()); + } + + public boolean executeTest(){ + + int error=0; + Element rootElement = this.getInputFile().get(0).getDocumentElement(); + NodeList commandLst = rootElement.getElementsByTagName("command"); + + //Analyze each command, send request and build the array list of api commands + for (int i=0; i port = new ArrayList(); +// for (int i=1; i<65536; i++){ +// port.add(Integer.toString(i)); +// } +// +// //try all public ports +// for (String portValue : port) { +// try { +// s_logger.info("public port is " + portValue); +// String url = this.getHost() + ":8096/?command=createOrUpdateIpForwardingRule&account=" + this.getParam().get("accountname") + "&publicip=" + this.getParam().get("boundaryip") + +// "&privateip=" + this.getParam().get("vmipaddress") + "&privateport=22&protocol=tcp&publicport=" + portValue; +// HttpClient client = new HttpClient(); +// HttpMethod method = new GetMethod(url); +// int responseCode = client.executeMethod(method); +// if (responseCode != 200 ) { +// error++; +// s_logger.error("Can't create portForwarding rule for the public port " + portValue + ". Request was sent with url " + url); +// } +// }catch (Exception ex) { +// s_logger.error(ex); +// } +// } +// +// //try all private ports +// for (String portValue : port) { +// try { +// String url = this.getHost() + ":8096/?command=createOrUpdateIpForwardingRule&account=" + this.getParam().get("accountname") + "&publicip=" + this.getParam().get("boundaryip") + +// "&privateip=" + this.getParam().get("vmipaddress") + "&publicport=22&protocol=tcp&privateport=" + portValue; +// HttpClient client = new HttpClient(); +// HttpMethod method = new GetMethod(url); +// int responseCode = client.executeMethod(method); +// if (responseCode != 200 ) { +// error++; +// s_logger.error("Can't create portForwarding rule for the private port " + portValue + ". Request was sent with url " + url); +// } +// }catch (Exception ex) { +// s_logger.error(ex); +// } +// } + + + if (error != 0) + return false; + else + return true; + } + +} diff --git a/test/src/com/cloud/test/regression/SanityTest.java b/test/src/com/cloud/test/regression/SanityTest.java index ef7e3cc4b9a..343cbbf11a5 100644 --- a/test/src/com/cloud/test/regression/SanityTest.java +++ b/test/src/com/cloud/test/regression/SanityTest.java @@ -12,71 +12,71 @@ // Automatically generated by addcopyright.py at 04/03/2012 package com.cloud.test.regression; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.apache.log4j.Logger; - -public class SanityTest extends TestCase{ - - public static final Logger s_logger = Logger.getLogger(SanityTest.class.getName()); - - public SanityTest(){ - this.setClient(); - } - - public boolean executeTest(){ - int error=0; - Element rootElement = this.getInputFile().get(0).getDocumentElement(); - NodeList commandLst = rootElement.getElementsByTagName("command"); - //Analyze each command, send request and build the array list of api commands - for (int i=0; i()); - } - - public boolean executeTest(){ - - int error=0; - Element rootElement = this.getInputFile().get(0).getDocumentElement(); - NodeList commandLst = rootElement.getElementsByTagName("command"); - - //Analyze each command, send request and build the array list of api commands - for (int i=0; i port = new ArrayList(); - for (int j=1; j<1000; j++){ - port.add(Integer.toString(j)); - } - - //try all public ports - for (String portValue : port) { - try { - s_logger.info("public port is " + portValue); - String url = "http://" + this.getParam().get("hostip") + ":8096/?command=createNetworkRule&publicPort=" + portValue + "&privatePort=22&protocol=tcp&isForward=true&securityGroupId=1&account=admin"; - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode = client.executeMethod(method); - if (responseCode != 200 ) { - error++; - s_logger.error("Can't create portForwarding network rule for the public port " + portValue + ". Request was sent with url " + url); - } - }catch (Exception ex) { - s_logger.error(ex); - } - } - - - if (error != 0) - return false; - else - return true; - } -} +package com.cloud.test.regression; + +import java.util.ArrayList; +import java.util.HashMap; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.HttpMethod; +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.log4j.Logger; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class Test extends TestCase{ + public static final Logger s_logger = Logger.getLogger(Test.class.getName()); + + public Test(){ + this.setClient(); + this.setParam(new HashMap()); + } + + public boolean executeTest(){ + + int error=0; + Element rootElement = this.getInputFile().get(0).getDocumentElement(); + NodeList commandLst = rootElement.getElementsByTagName("command"); + + //Analyze each command, send request and build the array list of api commands + for (int i=0; i port = new ArrayList(); + for (int j=1; j<1000; j++){ + port.add(Integer.toString(j)); + } + + //try all public ports + for (String portValue : port) { + try { + s_logger.info("public port is " + portValue); + String url = "http://" + this.getParam().get("hostip") + ":8096/?command=createNetworkRule&publicPort=" + portValue + "&privatePort=22&protocol=tcp&isForward=true&securityGroupId=1&account=admin"; + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode = client.executeMethod(method); + if (responseCode != 200 ) { + error++; + s_logger.error("Can't create portForwarding network rule for the public port " + portValue + ". Request was sent with url " + url); + } + }catch (Exception ex) { + s_logger.error(ex); + } + } + + + if (error != 0) + return false; + else + return true; + } +} diff --git a/test/src/com/cloud/test/regression/TestCase.java b/test/src/com/cloud/test/regression/TestCase.java index 8b68e52e1b3..3eefa4c1507 100644 --- a/test/src/com/cloud/test/regression/TestCase.java +++ b/test/src/com/cloud/test/regression/TestCase.java @@ -10,8 +10,8 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.regression; - +package com.cloud.test.regression; + import java.io.File; import java.io.FileInputStream; import java.sql.Connection; @@ -27,24 +27,24 @@ import javax.xml.parsers.DocumentBuilderFactory; import org.apache.commons.httpclient.HttpClient; import org.apache.log4j.Logger; import org.w3c.dom.Document; - - -public abstract class TestCase{ - - public static Logger s_logger = Logger.getLogger(TestCase.class.getName()); - private Connection conn; - private ArrayList inputFile = new ArrayList (); - private HttpClient client; - private String testCaseName; + + +public abstract class TestCase{ + + public static Logger s_logger = Logger.getLogger(TestCase.class.getName()); + private Connection conn; + private ArrayList inputFile = new ArrayList (); + private HttpClient client; + private String testCaseName; private HashMap param = new HashMap (); - private HashMap commands = new HashMap (); - - public HashMap getParam() { - return param; - } - - public void setParam(HashMap param) { - this.param = param; + private HashMap commands = new HashMap (); + + public HashMap getParam() { + return param; + } + + public void setParam(HashMap param) { + this.param = param; } @@ -73,26 +73,26 @@ public abstract class TestCase{ s_logger.info("Unable to find the file " + param.get("apicommands") + " due to following exception " + ex); } - } - - public Connection getConn() { - return conn; - } - - public void setConn(String dbPassword) { - this.conn = null; - try { - Class.forName("com.mysql.jdbc.Driver"); - this.conn=DriverManager.getConnection("jdbc:mysql://" + param.get("db") + "/cloud", "root", dbPassword); - if (!this.conn.isValid(0)) { - s_logger.error("Connection to DB failed to establish"); - } - - }catch (Exception ex) { - s_logger.error(ex); - } - } - + } + + public Connection getConn() { + return conn; + } + + public void setConn(String dbPassword) { + this.conn = null; + try { + Class.forName("com.mysql.jdbc.Driver"); + this.conn=DriverManager.getConnection("jdbc:mysql://" + param.get("db") + "/cloud", "root", dbPassword); + if (!this.conn.isValid(0)) { + s_logger.error("Connection to DB failed to establish"); + } + + }catch (Exception ex) { + s_logger.error(ex); + } + } + public void setInputFile (ArrayList fileNameInput) { for (String fileName: fileNameInput) { File file = new File(fileName); @@ -106,31 +106,31 @@ public abstract class TestCase{ s_logger.error("Unable to load " + fileName + " due to ", ex); } this.inputFile.add(doc); - } - } - - public ArrayList getInputFile() { - return inputFile; - } - - public void setTestCaseName(String testCaseName) { - this.testCaseName = testCaseName; - } - - public String getTestCaseName(){ - return this.testCaseName; - } - - public void setClient() { - HttpClient client = new HttpClient(); - this.client = client; - } - - public HttpClient getClient() { - return this.client; - } - - //abstract methods - public abstract boolean executeTest(); - -} + } + } + + public ArrayList getInputFile() { + return inputFile; + } + + public void setTestCaseName(String testCaseName) { + this.testCaseName = testCaseName; + } + + public String getTestCaseName(){ + return this.testCaseName; + } + + public void setClient() { + HttpClient client = new HttpClient(); + this.client = client; + } + + public HttpClient getClient() { + return this.client; + } + + //abstract methods + public abstract boolean executeTest(); + +} diff --git a/test/src/com/cloud/test/regression/VMApiTest.java b/test/src/com/cloud/test/regression/VMApiTest.java index 30a086cafc7..917b5bf9d01 100644 --- a/test/src/com/cloud/test/regression/VMApiTest.java +++ b/test/src/com/cloud/test/regression/VMApiTest.java @@ -10,55 +10,55 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.regression; - -import java.util.HashMap; - -import org.apache.log4j.Logger; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; +package com.cloud.test.regression; + +import java.util.HashMap; + +import org.apache.log4j.Logger; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; import com.cloud.test.regression.ApiCommand.ResponseType; - - -public class VMApiTest extends TestCase{ -public static final Logger s_logger = Logger.getLogger(VMApiTest.class.getName()); - - - public VMApiTest(){ - this.setClient(); - this.setParam(new HashMap()); - } - - public boolean executeTest(){ - int error=0; - Element rootElement = this.getInputFile().get(0).getDocumentElement(); - NodeList commandLst = rootElement.getElementsByTagName("command"); - - //Analyze each command, send request and build the array list of api commands - for (int i=0; i()); + } + + public boolean executeTest(){ + int error=0; + Element rootElement = this.getInputFile().get(0).getDocumentElement(); + NodeList commandLst = rootElement.getElementsByTagName("command"); + + //Analyze each command, send request and build the array list of api commands + for (int i=0; i _linuxIP = new ThreadLocal(); - private static ThreadLocal _linuxVmId = new ThreadLocal(); - private static ThreadLocal _linuxVmId1 = new ThreadLocal(); - private static ThreadLocal _linuxPassword = new ThreadLocal(); - private static ThreadLocal _windowsIP = new ThreadLocal(); - private static ThreadLocal _secretKey = new ThreadLocal(); - private static ThreadLocal _apiKey = new ThreadLocal(); - private static ThreadLocal _userId = new ThreadLocal(); - private static ThreadLocal _account = new ThreadLocal(); - private static ThreadLocal _domainRouterId = new ThreadLocal(); - private static ThreadLocal _newVolume = new ThreadLocal(); - private static ThreadLocal _newVolume1 = new ThreadLocal(); - private static DocumentBuilderFactory factory = DocumentBuilderFactory - .newInstance(); - private static int usageIterator = 1; - private static int numThreads = 1; - private static int wait = 5000; - private static String accountName = null; - private static String zoneId = "1"; - private static String serviceOfferingId = "13"; - private static String diskOfferingId="11"; - private static String diskOfferingId1="12"; - - private static final int MAX_RETRY_LINUX = 10; - private static final int MAX_RETRY_WIN = 10; - - - public static void main(String[] args) { - String host = "http://localhost"; - String port = "8092"; - String devPort = "8080"; - String apiUrl = "/client/api"; - - try { - // Parameters - List argsList = Arrays.asList(args); - Iterator iter = argsList.iterator(); - while (iter.hasNext()) { - String arg = iter.next(); - // host - if (arg.equals("-h")) { - host = "http://" + iter.next(); - } - - if (arg.equals("-p")) { - port = iter.next(); - } - if (arg.equals("-dp")) { - devPort = iter.next(); - } - - if (arg.equals("-t")) { - numThreads = Integer.parseInt(iter.next()); - } - - if (arg.equals("-s")) { - sleepTime = Long.parseLong(iter.next()); - } - if (arg.equals("-a")) { - accountName = iter.next(); - } - - if (arg.equals("-c")) { - cleanUp = Boolean.parseBoolean(iter.next()); - if (!cleanUp) - sleepTime = 0L; // no need to wait if we don't ever - // cleanup - } - - if (arg.equals("-r")) { - repeat = Boolean.parseBoolean(iter.next()); - } - - if (arg.equals("-i")) { - internet = Boolean.parseBoolean(iter.next()); - } - - if (arg.equals("-w")) { - wait = Integer.parseInt(iter.next()); - } - - if (arg.equals("-z")) { - zoneId = iter.next(); - } - - if (arg.equals("-so")) { - serviceOfferingId = iter.next(); - } - - } - - final String server = host + ":" + port + "/"; - final String developerServer = host + ":" + devPort + apiUrl; - s_logger.info("Starting test against server: " + server + " with " - + numThreads + " thread(s)"); - if (cleanUp) - s_logger.info("Clean up is enabled, each test will wait " - + sleepTime + " ms before cleaning up"); - - - - for (int i = 0; i < numThreads; i++) { - new Thread(new Runnable() { - public void run() { - do { - String username = null; - try { - long now = System.currentTimeMillis(); - Random ran = new Random(); - username = Math.abs(ran.nextInt())+ "-user"; - NDC.push(username); - - s_logger.info("Starting test for the user " + username); - int response = executeDeployment(server, - developerServer, username); - boolean success = false; - String reason = null; - - - - - if (response == 200) { - success = true; - if (internet) { - s_logger - .info("Deploy successful...waiting 5 minute before SSH tests"); - Thread.sleep(300000L); // Wait 60 - // seconds so - // the windows VM - // can boot up and do a sys prep. - - s_logger.info("Begin Linux SSH test for account " + _account.get()); - reason = sshTest(_linuxIP.get(), _linuxPassword.get()); - - - if (reason == null) { - s_logger - .info("Linux SSH test successful for account " + _account.get()); - } - } - if (reason == null) { - if (internet) { - s_logger - .info("Windows SSH test successful for account " + _account.get()); - } else { - s_logger - .info("deploy test successful....now cleaning up"); - if (cleanUp) { - s_logger - .info("Waiting " - + sleepTime - + " ms before cleaning up vms"); - Thread.sleep(sleepTime); - } else { - success = true; - } - } - - if (usageIterator >= numThreads) { - int eventsAndBillingResponseCode = - executeEventsAndBilling(server, developerServer); - s_logger.info("events and usage records command finished with response code: " - + eventsAndBillingResponseCode); - usageIterator = 1; - - } - else { - s_logger.info("Skipping events and usage records for this user: usageIterator " + usageIterator+ " and number of Threads " + numThreads); - usageIterator++; - } - - if ((users == null) && (accountName == null)) { - s_logger - .info("Sending cleanup command"); - int cleanupResponseCode = executeCleanup( - server, developerServer, username); - s_logger - .info("cleanup command finished with response code: " - + cleanupResponseCode); - success = (cleanupResponseCode == 200); - } else { - s_logger - .info("Sending stop DomR / destroy VM command"); - int stopResponseCode = executeStop( - server, developerServer, - username); - s_logger - .info("stop(destroy) command finished with response code: " - + stopResponseCode); - success = (stopResponseCode == 200); - } - - } else { - // Just stop but don't destroy the - // VMs/Routers - s_logger - .info("SSH test failed for account " + _account.get() + "with reason '" - + reason - + "', stopping VMs"); - int stopResponseCode = executeStop( - server, developerServer, - username); - s_logger - .info("stop command finished with response code: " - + stopResponseCode); - success = false; // since the SSH test - // failed, mark the - // whole test as - // failure - } - } else { - // Just stop but don't destroy the - // VMs/Routers - s_logger - .info("Deploy test failed with reason '" - + reason - + "', stopping VMs"); - int stopResponseCode = executeStop(server, - developerServer, username); - s_logger - .info("stop command finished with response code: " - + stopResponseCode); - success = false; // since the deploy test - // failed, mark the - // whole test as failure - } - - if (success) { - s_logger - .info("***** Completed test for user : " - + username - + " in " - + ((System - .currentTimeMillis() - now) / 1000L) - + " seconds"); - - } else { - s_logger - .info("##### FAILED test for user : " - + username - + " in " - + ((System - .currentTimeMillis() - now) / 1000L) - + " seconds with reason : " - + reason); - } - s_logger.info("Sleeping for " + wait + " seconds before starting next iteration"); - Thread.sleep(wait); - } catch (Exception e) { - s_logger.warn("Error in thread", e); - try { - int stopResponseCode = executeStop(server, - developerServer, username); - s_logger.info("stop response code: " - + stopResponseCode); - } catch (Exception e1) { - } - } finally { - NDC.clear(); - } - } while (repeat); - } - }).start(); - } - } catch (Exception e) { - s_logger.error(e); - } - } - - - public static Map> getMultipleValuesFromXML( - InputStream is, String[] tagNames) { - Map> returnValues = new HashMap>(); - try { - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - Document doc = docBuilder.parse(is); - Element rootElement = doc.getDocumentElement(); - for (int i = 0; i < tagNames.length; i++) { - NodeList targetNodes = rootElement - .getElementsByTagName(tagNames[i]); - if (targetNodes.getLength() <= 0) { - s_logger.error("no " + tagNames[i] - + " tag in XML response...returning null"); - } else { - List valueList = new ArrayList(); - for (int j = 0; j < targetNodes.getLength(); j++) { - Node node = targetNodes.item(j); - valueList.add(node.getTextContent()); - } - returnValues.put(tagNames[i], valueList); - } - } - } catch (Exception ex) { - s_logger.error(ex); - } - return returnValues; - } - - public static Map getSingleValueFromXML(InputStream is, - String[] tagNames) { - Map returnValues = new HashMap(); - try { - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - Document doc = docBuilder.parse(is); - Element rootElement = doc.getDocumentElement(); - - for (int i = 0; i < tagNames.length; i++) { - NodeList targetNodes = rootElement - .getElementsByTagName(tagNames[i]); - if (targetNodes.getLength() <= 0) { - s_logger.error("no " + tagNames[i] - + " tag in XML response...returning null"); - } else { - returnValues.put(tagNames[i], targetNodes.item(0) - .getTextContent()); - } - } - } catch (Exception ex) { - s_logger.error("error processing XML", ex); - } - return returnValues; - } - - public static Map getSingleValueFromXML(Element rootElement, - String[] tagNames) { - Map returnValues = new HashMap(); - if (rootElement == null) { - s_logger.error("Root element is null, can't get single value from xml"); - return null; - } - try { - for (int i = 0; i < tagNames.length; i++) { - NodeList targetNodes = rootElement - .getElementsByTagName(tagNames[i]); - if (targetNodes.getLength() <= 0) { - s_logger.error("no " + tagNames[i] - + " tag in XML response...returning null"); - } else { - returnValues.put(tagNames[i], targetNodes.item(0) - .getTextContent()); - } - } - } catch (Exception ex) { - s_logger.error("error processing XML", ex); - } - return returnValues; - } - - - private static List getNonSourceNatIPs(InputStream is) { - List returnValues = new ArrayList(); - try { - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - Document doc = docBuilder.parse(is); - Element rootElement = doc.getDocumentElement(); - NodeList allocatedIpAddrNodes = rootElement - .getElementsByTagName("publicipaddress"); - for (int i = 0; i < allocatedIpAddrNodes.getLength(); i++) { - Node allocatedIpAddrNode = allocatedIpAddrNodes.item(i); - NodeList childNodes = allocatedIpAddrNode.getChildNodes(); - String ipAddress = null; - boolean isSourceNat = true; // assume it's source nat until we - // find otherwise - for (int j = 0; j < childNodes.getLength(); j++) { - Node n = childNodes.item(j); - if ("ipaddress".equals(n.getNodeName())) { - ipAddress = n.getTextContent(); - } else if ("issourcenat".equals(n.getNodeName())) { - isSourceNat = Boolean.parseBoolean(n.getTextContent()); - } - } - if ((ipAddress != null) && !isSourceNat) { - returnValues.add(ipAddress); - } - } - } catch (Exception ex) { - s_logger.error(ex); - } - return returnValues; - } - - private static List getSourceNatIPs(InputStream is) { - List returnValues = new ArrayList(); - try { - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - Document doc = docBuilder.parse(is); - Element rootElement = doc.getDocumentElement(); - NodeList allocatedIpAddrNodes = rootElement - .getElementsByTagName("publicipaddress"); - for (int i = 0; i < allocatedIpAddrNodes.getLength(); i++) { - Node allocatedIpAddrNode = allocatedIpAddrNodes.item(i); - NodeList childNodes = allocatedIpAddrNode.getChildNodes(); - String ipAddress = null; - boolean isSourceNat = false; // assume it's *not* source nat until we find otherwise - for (int j = 0; j < childNodes.getLength(); j++) { - Node n = childNodes.item(j); - if ("ipaddress".equals(n.getNodeName())) { - ipAddress = n.getTextContent(); - } else if ("issourcenat".equals(n.getNodeName())) { - isSourceNat = Boolean.parseBoolean(n.getTextContent()); - } - } - if ((ipAddress != null) && isSourceNat) { - returnValues.add(ipAddress); - } - } - } catch (Exception ex) { - s_logger.error(ex); - } - return returnValues; - } - - private static String executeRegistration(String server, String username, - String password) throws HttpException, IOException { - String url = server + "?command=registerUserKeys&id=" + _userId.get().toString(); - s_logger.info("registering: " + username); - String returnValue = null; - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode = client.executeMethod(method); - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map requestKeyValues = getSingleValueFromXML(is, - new String[] { "apikey", "secretkey" }); - _apiKey.set(requestKeyValues.get("apikey")); - returnValue = requestKeyValues.get("secretkey"); - } else { - s_logger.error("registration failed with error code: " + responseCode); - } - return returnValue; - } - - private static Integer executeDeployment(String server, String developerServer, - String username) throws HttpException, IOException { - // test steps: - // - create user - // - deploy Windows VM - // - deploy Linux VM - // - associate IP address - // - create two IP forwarding rules - // - create load balancer rule - // - list IP forwarding rules - // - list load balancer rules - - // ----------------------------- - // CREATE USER - // ----------------------------- - String encodedUsername = URLEncoder.encode(username, "UTF-8"); - String encryptedPassword = createMD5Password(username); - String encodedPassword = URLEncoder.encode(encryptedPassword, "UTF-8"); - - String url = server + "?command=createUser&username=" + encodedUsername - + "&password=" + encodedPassword - + "&firstname=Test&lastname=Test&email=test@vmops.com&domainId=1&accounttype=0"; - if (accountName != null ) { - url = server + "?command=createUser&username=" + encodedUsername - + "&password=" + encodedPassword - + "&firstname=Test&lastname=Test&email=test@vmops.com&domainId=1&accounttype=0&account=" + accountName; - } - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode = client.executeMethod(method); - long userId = -1; - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map userIdValues = getSingleValueFromXML(is, - new String[] { "id", "account" }); - String userIdStr = userIdValues.get("id"); - s_logger.info("created user " + username + " with id "+ userIdStr); - if (userIdStr != null) { - userId = Long.parseLong(userIdStr); - _userId.set(userId); - _account.set(userIdValues.get("account")); - if (userId == -1) { - s_logger - .error("create user (" + username + ") failed to retrieve a valid user id, aborting depolyment test"); - return -1; - } - } - } else { - s_logger.error("create user test failed for user " + username + " with error code :" + responseCode); - return responseCode; - } - - _secretKey.set(executeRegistration(server, username, username)); - - if (_secretKey.get() == null) { - s_logger - .error("FAILED to retrieve secret key during registration, skipping user: " - + username); - return -1; - } else { - s_logger.info("got secret key: " + _secretKey.get()); - s_logger.info("got api key: " + _apiKey.get()); - } - - - // --------------------------------- - // CREATE NETWORK GROUP AND ADD INGRESS RULE TO IT - // --------------------------------- - String networkAccount = null; - if (accountName != null) { - networkAccount = accountName; - } - else { - networkAccount = encodedUsername; - } - String encodedApiKey = URLEncoder.encode(_apiKey.get(), "UTF-8"); - String requestToSign = "apikey=" + encodedApiKey - + "&command=createSecurityGroup&name=" + encodedUsername; - requestToSign = requestToSign.toLowerCase(); - String signature = signRequest(requestToSign, _secretKey.get()); - String encodedSignature = URLEncoder.encode(signature, "UTF-8"); - url = developerServer + "?command=createSecurityGroup&name=" + encodedUsername + "&apikey=" + encodedApiKey - + "&signature=" + encodedSignature; - method = new GetMethod(url); - responseCode = client.executeMethod(method); - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map values = getSingleValueFromXML(is, - new String[] { "id" }); - - if (values.get("id") == null) { - s_logger.info("Create network rule response code: 401"); - return 401; - } - else { - s_logger.info("Create security group response code: " + responseCode); - } - } else { - s_logger.error("Create security group failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - - - String encodedCidr = URLEncoder.encode("192.168.1.143/32", "UTF-8"); - url = server + "?command=authorizeSecurityGroupIngress&cidrlist=" + encodedCidr + "&endport=22&" + - "securitygroupname=" + encodedUsername +"&protocol=tcp&startport=22&account=" + networkAccount + "&domainid=1"; - - method = new GetMethod(url); - responseCode = client.executeMethod(method); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map values = getSingleValueFromXML(el, - new String[] { "id" }); - - if (values.get("id") == null) { - s_logger.info("Authorise security group ingress response code: 401"); - return 401; - } - else { - s_logger.info("Authorise security group ingress response code: " + responseCode); - } - } else { - s_logger.error("Authorise security group ingress failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - - - - // --------------------------------- - // DEPLOY LINUX VM - // --------------------------------- - { - long templateId = 2; - String encodedZoneId = URLEncoder.encode("" + zoneId, "UTF-8"); - String encodedServiceOfferingId = URLEncoder.encode("" - + serviceOfferingId, "UTF-8"); - String encodedTemplateId = URLEncoder.encode("" + templateId, - "UTF-8"); - encodedApiKey = URLEncoder.encode(_apiKey.get(), "UTF-8"); - requestToSign = "apikey=" + encodedApiKey - + "&command=deployVirtualMachine&securitygrouplist=" + encodedUsername + "&serviceofferingid=" - + encodedServiceOfferingId + "&templateid=" - + encodedTemplateId + "&zoneid=" + encodedZoneId; - requestToSign = requestToSign.toLowerCase(); - signature = signRequest(requestToSign, _secretKey.get()); - encodedSignature = URLEncoder.encode(signature, "UTF-8"); - url = developerServer + "?command=deployVirtualMachine&securitygrouplist=" + encodedUsername + "&zoneid=" + encodedZoneId + "&serviceofferingid=" - + encodedServiceOfferingId + "&templateid=" - + encodedTemplateId + "&apikey=" + encodedApiKey - + "&signature=" + encodedSignature; - - method = new GetMethod(url); - responseCode = client.executeMethod(method); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map values = getSingleValueFromXML(el, - new String[] { "id", "ipaddress" }); - - if ((values.get("ipaddress") == null) || (values - .get("id") == null)) { - s_logger.info("deploy linux vm response code: 401"); - return 401; - } - else { - s_logger.info("deploy linux vm response code: " + responseCode); - long linuxVMId = Long.parseLong(values.get("id")); - s_logger.info("got linux virtual machine id: " + linuxVMId); - _linuxVmId.set(values.get("id")); - _linuxIP.set(values.get("ipaddress")); - _linuxPassword.set("rs-ccb35ea5"); - } - } else { - s_logger.error("deploy linux vm failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - } - - - - //Create a new volume - { - url = server + "?command=createVolume&diskofferingid=" + diskOfferingId + "&zoneid=" + zoneId + "&name=newvolume&account=" + _account.get() + "&domainid=1"; - s_logger.info("Creating volume...."); - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map values = getSingleValueFromXML(el, - new String[] { "id" }); - - if (values.get("id") == null) { - s_logger.info("create volume response code: 401"); - return 401; - } - else { - s_logger.info("create volume response code: " + responseCode); - String volumeId = values.get("id"); - s_logger.info("got volume id: " + volumeId); - _newVolume.set(volumeId); - } - } else { - s_logger.error("create volume failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - } - - //attach a new volume to the vm - { - url = server + "?command=attachVolume&id=" + _newVolume.get() + "&virtualmachineid=" + _linuxVmId.get(); - s_logger.info("Attaching volume with id " + _newVolume.get() + " to the vm " + _linuxVmId.get()); - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - s_logger.info("Attach data volume response code: " + responseCode); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map values = getSingleValueFromXML(el, - new String[] { "id" }); - - if (values.get("id") == null) { - s_logger.info("Attach volume response code: 401"); - return 401; - } - else { - s_logger.info("Attach volume response code: " + responseCode); - } - } else { - s_logger.error("Attach volume failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - } - - //DEPLOY SECOND VM, ADD VOLUME TO IT - - // --------------------------------- - // DEPLOY another linux vm - // --------------------------------- - { - long templateId = 2; - String encodedZoneId = URLEncoder.encode("" + zoneId, "UTF-8"); - String encodedServiceOfferingId = URLEncoder.encode("" - + serviceOfferingId, "UTF-8"); - String encodedTemplateId = URLEncoder.encode("" + templateId, - "UTF-8"); - encodedApiKey = URLEncoder.encode(_apiKey.get(), "UTF-8"); - requestToSign = "apikey=" + encodedApiKey - + "&command=deployVirtualMachine&securitygrouplist=" + encodedUsername + "&serviceofferingid=" - + encodedServiceOfferingId + "&templateid=" - + encodedTemplateId + "&zoneid=" + encodedZoneId; - requestToSign = requestToSign.toLowerCase(); - signature = signRequest(requestToSign, _secretKey.get()); - encodedSignature = URLEncoder.encode(signature, "UTF-8"); - url = developerServer + "?command=deployVirtualMachine&securitygrouplist=" + encodedUsername + "&zoneid=" + encodedZoneId + "&serviceofferingid=" - + encodedServiceOfferingId + "&templateid=" - + encodedTemplateId + "&apikey=" + encodedApiKey - + "&signature=" + encodedSignature; - - method = new GetMethod(url); - responseCode = client.executeMethod(method); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map values = getSingleValueFromXML(el, - new String[] { "id", "ipaddress" }); - - if ((values.get("ipaddress") == null) || (values - .get("id") == null)) { - s_logger.info("deploy linux vm response code: 401"); - return 401; - } - else { - s_logger.info("deploy linux vm response code: " + responseCode); - long linuxVMId = Long.parseLong(values.get("id")); - s_logger.info("got linux virtual machine id: " + linuxVMId); - _linuxVmId1.set(values.get("id")); - } - } else { - s_logger.error("deploy linux vm failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - } - - - - //Create a new volume - { - url = server + "?command=createVolume&diskofferingid=" + diskOfferingId1 + "&zoneid=" + zoneId + "&name=newvolume1&account=" + _account.get() + "&domainid=1"; - s_logger.info("Creating volume...."); - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map values = getSingleValueFromXML(el, - new String[] { "id" }); - - if (values.get("id") == null) { - s_logger.info("create volume response code: 401"); - return 401; - } - else { - s_logger.info("create volume response code: " + responseCode); - String volumeId = values.get("id"); - s_logger.info("got volume id: " + volumeId); - _newVolume1.set(volumeId); - } - } else { - s_logger.error("create volume failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - } - - //attach a new volume to the vm - { - url = server + "?command=attachVolume&id=" + _newVolume1.get() + "&virtualmachineid=" + _linuxVmId1.get(); - s_logger.info("Attaching volume with id " + _newVolume1.get() + " to the vm " + _linuxVmId1.get()); - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - s_logger.info("Attach data volume response code: " + responseCode); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map values = getSingleValueFromXML(el, - new String[] { "id" }); - - if (values.get("id") == null) { - s_logger.info("Attach volume response code: 401"); - return 401; - } - else { - s_logger.info("Attach volume response code: " + responseCode); - } - } else { - s_logger.error("Attach volume failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - } - return 200; - } - - - - - private static int executeCleanup(String server, String developerServer, String username) - throws HttpException, IOException { - // test steps: - // - get user - // - delete user - - // ----------------------------- - // GET USER - // ----------------------------- - String userId = _userId.get().toString(); - String encodedUserId = URLEncoder.encode(userId, "UTF-8"); - String url = server + "?command=listUsers&id=" + encodedUserId; - s_logger.info("Cleaning up resources for user: " + userId + " with url " + url); - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode = client.executeMethod(method); - s_logger.info("get user response code: " + responseCode); - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map userInfo = getSingleValueFromXML(is, - new String[] { "username", "id", "account" }); - if (!username.equals(userInfo.get("username"))) { - s_logger - .error("get user failed to retrieve requested user, aborting cleanup test" + ". Following URL was sent: " + url); - return -1; - } - - } else { - s_logger.error("get user failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - - // ----------------------------- - // UPDATE USER - // ----------------------------- - { - url = server + "?command=updateUser&id=" + userId - + "&firstname=delete&lastname=me"; - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - s_logger.info("update user response code: " + responseCode); - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map success = getSingleValueFromXML(is, - new String[] { "success" }); - s_logger - .info("update user..success? " + success.get("success")); - } else { - s_logger.error("update user failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - } - - // ----------------------------- - // Execute reboot/stop/start commands for the VMs before deleting the account - made to exercise xen - // ----------------------------- - - //Reboot centos VM - String encodedApiKey = URLEncoder.encode(_apiKey.get(), "UTF-8"); - String requestToSign = "apikey=" + encodedApiKey + "&command=rebootVirtualMachine&id=" + _linuxVmId.get(); - requestToSign = requestToSign.toLowerCase(); - String signature = signRequest(requestToSign, _secretKey.get()); - String encodedSignature = URLEncoder.encode(signature, "UTF-8"); - - url = developerServer + "?command=rebootVirtualMachine&id=" + _linuxVmId.get() + "&apikey=" - + encodedApiKey + "&signature=" + encodedSignature; - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - s_logger.info("Reboot VM response code: " - + responseCode); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map success = getSingleValueFromXML(el, - new String[] { "success" }); - s_logger.info("VM was rebooted with the status: " - + success.get("success")); - } else { - s_logger.error(" VM test failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - - //Stop centos VM - requestToSign = "apikey=" + encodedApiKey + "&command=stopVirtualMachine&id=" + _linuxVmId.get(); - requestToSign = requestToSign.toLowerCase(); - signature = signRequest(requestToSign, _secretKey.get()); - encodedSignature = URLEncoder.encode(signature, "UTF-8"); - - url = developerServer + "?command=stopVirtualMachine&id=" + _linuxVmId.get() + "&apikey=" - + encodedApiKey + "&signature=" + encodedSignature; - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - s_logger.info("Stop VM response code: " - + responseCode); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map success = getSingleValueFromXML(el, - new String[] { "success" }); - s_logger.info("VM was stopped with the status: " - + success.get("success")); - } else { - s_logger.error("Stop VM test failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - - //Start centos VM - requestToSign = "apikey=" + encodedApiKey + "&command=startVirtualMachine&id=" + _linuxVmId.get(); - requestToSign = requestToSign.toLowerCase(); - signature = signRequest(requestToSign, _secretKey.get()); - encodedSignature = URLEncoder.encode(signature, "UTF-8"); - - url = developerServer + "?command=startVirtualMachine&id=" + _linuxVmId.get() + "&apikey=" - + encodedApiKey + "&signature=" + encodedSignature; - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - s_logger.info("Start VM response code: " - + responseCode); - - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map success = getSingleValueFromXML(el, - new String[] { "id" }); - - if (success.get("id") == null) { - s_logger.info("Start linux vm response code: 401"); - return 401; - } - else { - s_logger.info("Start vm response code: " + responseCode); - } - - s_logger.info("VM was started with the status: " - + success.get("success")); - } else { - s_logger.error("Start VM test failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - -//// // ----------------------------- -//// // DISABLE USER -//// // ----------------------------- -// { -// url = server + "?command=disableUser&id=" + userId; -// client = new HttpClient(); -// method = new GetMethod(url); -// responseCode = client.executeMethod(method); -// s_logger.info("disable user response code: " + responseCode); -// if (responseCode == 200) { -// InputStream input = method.getResponseBodyAsStream(); -// Element el = queryAsyncJobResult(server, input); -// s_logger -// .info("Disabled user successfully"); -// } else { -// s_logger.error("disable user failed with error code: " + responseCode + ". Following URL was sent: " + url); -// return responseCode; -// } -// } - - // ----------------------------- - // DELETE USER - // ----------------------------- - { - url = server + "?command=deleteUser&id=" + userId; - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - s_logger.info("delete user response code: " + responseCode); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - s_logger - .info("Deleted user successfully"); - } else { - s_logger.error("delete user failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - } - return responseCode; - } - - private static int executeEventsAndBilling(String server, String developerServer) - throws HttpException, IOException { - // test steps: - // - get all the events in the system for all users in the system - // - generate all the usage records in the system - // - get all the usage records in the system - - // ----------------------------- - // GET EVENTS - // ----------------------------- - String url =server+"?command=listEvents&page=1&account=" + _account.get(); - - s_logger.info("Getting events for the account " + _account.get()); - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode = client.executeMethod(method); - s_logger.info("get events response code: " + responseCode); - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map> eventDescriptions = getMultipleValuesFromXML( - is, new String[] { "description" }); - List descriptionText = eventDescriptions.get("description"); - if (descriptionText == null) { - s_logger.info("no events retrieved..."); - } else { - for (String text : descriptionText) { - s_logger.info("event: " + text); - } - } - } else { - s_logger.error("list events failed with error code: " + responseCode + ". Following URL was sent: " + url); - - return responseCode; - } - return responseCode; - } - - - private static int executeStop(String server, String developerServer, - String username) throws HttpException, IOException { - // test steps: - // - get userId for the given username - // - list virtual machines for the user - // - stop all virtual machines - // - get ip addresses for the user - // - release ip addresses - - // ----------------------------- - // GET USER - // ----------------------------- - String userId = _userId.get().toString(); - String encodedUserId = URLEncoder.encode(userId, "UTF-8"); - - String url = server + "?command=listUsers&id=" + encodedUserId; - s_logger.info("Stopping resources for user: " + username); - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode = client.executeMethod(method); - s_logger.info("get user response code: " + responseCode); - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map userIdValues = getSingleValueFromXML(is, - new String[] { "id" }); - String userIdStr = userIdValues.get("id"); - if (userIdStr != null) { - userId = userIdStr; - if (userId == null) { - s_logger - .error("get user failed to retrieve a valid user id, aborting depolyment test" + ". Following URL was sent: " + url); - return -1; - } - } - } else { - s_logger.error("get user failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - - { - // ---------------------------------- - // LIST VIRTUAL MACHINES - // ---------------------------------- - String encodedApiKey = URLEncoder.encode(_apiKey.get(), "UTF-8"); - String requestToSign = "apikey=" + encodedApiKey - + "&command=listVirtualMachines"; - requestToSign = requestToSign.toLowerCase(); - String signature = signRequest(requestToSign, _secretKey.get()); - String encodedSignature = URLEncoder.encode(signature, "UTF-8"); - - url = developerServer + "?command=listVirtualMachines&apikey=" + encodedApiKey + "&signature=" - + encodedSignature; - - s_logger.info("Listing all virtual machines for the user with url " + url); - String[] vmIds = null; - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - s_logger.info("list virtual machines response code: " - + responseCode); - if (responseCode == 200) { - InputStream is = method.getResponseBodyAsStream(); - Map> vmIdValues = getMultipleValuesFromXML( - is, new String[] { "id" }); - if (vmIdValues.containsKey("id")) { - List vmIdList = vmIdValues.get("id"); - if (vmIdList != null) { - vmIds = new String[vmIdList.size()]; - vmIdList.toArray(vmIds); - String vmIdLogStr = ""; - if ((vmIds != null) && (vmIds.length > 0)) { - vmIdLogStr = vmIds[0]; - for (int i = 1; i < vmIds.length; i++) { - vmIdLogStr = vmIdLogStr + "," + vmIds[i]; - } - } - s_logger.info("got virtual machine ids: " + vmIdLogStr); - } - } - - - } else { - s_logger.error("list virtual machines test failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - - - // ---------------------------------- - // STOP/DESTROY VIRTUAL MACHINES - // ---------------------------------- - if (vmIds != null) { - for (String vmId : vmIds) { - requestToSign = "apikey=" + encodedApiKey + "&command=stopVirtualMachine&id=" + vmId; - requestToSign = requestToSign.toLowerCase(); - signature = signRequest(requestToSign, _secretKey.get()); - encodedSignature = URLEncoder.encode(signature, "UTF-8"); - - url = developerServer + "?command=stopVirtualMachine&id=" + vmId + "&apikey=" - + encodedApiKey + "&signature=" + encodedSignature; - client = new HttpClient(); - method = new GetMethod(url); - responseCode = client.executeMethod(method); - s_logger.info("StopVirtualMachine" + " [" + vmId + "] response code: " - + responseCode); - if (responseCode == 200) { - InputStream input = method.getResponseBodyAsStream(); - Element el = queryAsyncJobResult(server, input); - Map success = getSingleValueFromXML(el, - new String[] { "success" }); - s_logger.info("StopVirtualMachine..success? " - + success.get("success")); - } else { - s_logger.error("Stop virtual machine test failed with error code: " + responseCode + ". Following URL was sent: " + url); - return responseCode; - } - } - } - -// { -// url = server + "?command=deleteUser&id=" + userId; -// client = new HttpClient(); -// method = new GetMethod(url); -// responseCode = client.executeMethod(method); -// s_logger.info("delete user response code: " + responseCode); -// if (responseCode == 200) { -// InputStream input = method.getResponseBodyAsStream(); -// Element el = queryAsyncJobResult(server, input); -// s_logger -// .info("Deleted user successfully"); -// } else { -// s_logger.error("delete user failed with error code: " + responseCode + ". Following URL was sent: " + url); -// return responseCode; -// } -// } - - - } - - _linuxIP.set(""); - _linuxVmId.set(""); - _linuxPassword.set(""); - _windowsIP.set(""); - _secretKey.set(""); - _apiKey.set(""); - _userId.set(Long.parseLong("0")); - _account.set(""); - _domainRouterId.set(""); - return responseCode; - } - - public static String signRequest(String request, String key) { - try { - Mac mac = Mac.getInstance("HmacSHA1"); - SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), - "HmacSHA1"); - mac.init(keySpec); - mac.update(request.getBytes()); - byte[] encryptedBytes = mac.doFinal(); - return Base64.encodeBytes(encryptedBytes); - } catch (Exception ex) { - s_logger.error("unable to sign request", ex); - } - return null; - } - - private static String sshWinTest(String host) { - if (host == null) { - s_logger - .info("Did not receive a host back from test, ignoring win ssh test"); - return null; - } - - // We will retry 5 times before quitting - int retry = 1; - - while (true) { - try { - if (retry > 0) { - s_logger.info("Retry attempt : " + retry - + " ...sleeping 300 seconds before next attempt. Account is " + _account.get()); - Thread.sleep(300000); - } - - s_logger.info("Attempting to SSH into windows host " + host - + " with retry attempt: " + retry + " for account " + _account.get()); - - Connection conn = new Connection(host); - conn.connect(null, 60000, 60000); - - s_logger.info("User " + _account.get() + " ssHed successfully into windows host " + host); - boolean success = false; - boolean isAuthenticated = conn.authenticateWithPassword( - "Administrator", "password"); - if (isAuthenticated == false) { - return "Authentication failed"; - } - else { - s_logger.info("Authentication is successfull"); - } - - try { - SCPClient scp = new SCPClient(conn); - scp.put("wget.exe", "wget.exe", "C:\\Users\\Administrator", "0777"); - s_logger.info("Successfully put wget.exe file"); - } catch (Exception ex) { - s_logger.error("Unable to put wget.exe " + ex); - } - - if (conn == null ){ - s_logger.error("Connection is null"); - } - Session sess = conn.openSession(); - - s_logger.info("User + " + _account.get() + " executing : wget http://192.168.1.250/dump.bin"); - sess - .execCommand("wget http://192.168.1.250/dump.bin && dir dump.bin"); - - InputStream stdout = sess.getStdout(); - InputStream stderr = sess.getStderr(); - - byte[] buffer = new byte[8192]; - while (true) { - if ((stdout.available() == 0) && (stderr.available() == 0)) { - int conditions = sess.waitForCondition( - ChannelCondition.STDOUT_DATA - | ChannelCondition.STDERR_DATA - | ChannelCondition.EOF, 120000); - - if ((conditions & ChannelCondition.TIMEOUT) != 0) { - s_logger - .info("Timeout while waiting for data from peer."); - return null; - } - - if ((conditions & ChannelCondition.EOF) != 0) { - if ((conditions & (ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA)) == 0) { - break; - } - } - } - - while (stdout.available() > 0) { - success = true; - int len = stdout.read(buffer); - if (len > 0) // this check is somewhat paranoid - s_logger.info(new String(buffer, 0, len)); - } - - while (stderr.available() > 0) { - /* int len = */stderr.read(buffer); - } - } - sess.close(); - conn.close(); - - if (success) { - Thread.sleep(120000); - return null; - } else { - retry++; - if (retry == MAX_RETRY_WIN) { - return "SSH Windows Network test fail for account " + _account.get(); - } - } - } catch (Exception e) { - s_logger.error(e); - retry++; - if (retry == MAX_RETRY_WIN) { - return "SSH Windows Network test fail with error " - + e.getMessage(); - } - } - } - } - - private static String sshTest(String host, String password) { - int i = 0; - if (host == null) { - s_logger - .info("Did not receive a host back from test, ignoring ssh test"); - return null; - } - - if (password == null){ - s_logger.info("Did not receive a password back from test, ignoring ssh test"); - return null; - } - - // We will retry 5 times before quitting - String result = null; - int retry = 0; - - while (true) { - try { - if (retry > 0) { - s_logger.info("Retry attempt : " + retry - + " ...sleeping 120 seconds before next attempt. Account is " + _account.get()); - Thread.sleep(120000); - } - - s_logger.info("Attempting to SSH into linux host " + host - + " with retry attempt: " + retry + ". Account is " + _account.get()); - - Connection conn = new Connection(host); - conn.connect(null, 60000, 60000); - - s_logger.info("User + " + _account.get() + " ssHed successfully into linux host " + host); - - boolean isAuthenticated = conn.authenticateWithPassword("root", - password); - - if (isAuthenticated == false) { - s_logger.info("Authentication failed for root with password" + password); - return "Authentication failed"; - - } - - boolean success = false; - String linuxCommand = null; - - if (i % 10 == 0) - linuxCommand = "rm -rf *; wget http://192.168.1.250/dump.bin && ls -al dump.bin"; - else - linuxCommand = "wget http://192.168.1.250/dump.bin && ls -al dump.bin"; - - Session sess = conn.openSession(); - s_logger.info("User " + _account.get() + " executing : " + linuxCommand); - sess.execCommand(linuxCommand); - - InputStream stdout = sess.getStdout(); - InputStream stderr = sess.getStderr(); - - - byte[] buffer = new byte[8192]; - while (true) { - if ((stdout.available() == 0) && (stderr.available() == 0)) { - int conditions = sess.waitForCondition( - ChannelCondition.STDOUT_DATA - | ChannelCondition.STDERR_DATA - | ChannelCondition.EOF, 120000); - - if ((conditions & ChannelCondition.TIMEOUT) != 0) { - s_logger - .info("Timeout while waiting for data from peer."); - return null; - } - - if ((conditions & ChannelCondition.EOF) != 0) { - if ((conditions & (ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA)) == 0) { - break; - } - } - } - - while (stdout.available() > 0) { - success = true; - int len = stdout.read(buffer); - if (len > 0) // this check is somewhat paranoid - s_logger.info(new String(buffer, 0, len)); - } - - while (stderr.available() > 0) { - /* int len = */stderr.read(buffer); - } - } - - sess.close(); - conn.close(); - - if (!success) { - retry++; - if (retry == MAX_RETRY_LINUX) { - result = "SSH Linux Network test fail"; - } - } - - return result; - } catch (Exception e) { - retry++; - s_logger.error("SSH Linux Network test fail with error"); - if (retry == MAX_RETRY_LINUX) { - return "SSH Linux Network test fail with error " - + e.getMessage(); - } - } - i++; - } - } - - public static String createMD5Password(String password) { - MessageDigest md5; - - try { - md5 = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - throw new CloudRuntimeException("Error", e); - } - - md5.reset(); - BigInteger pwInt = new BigInteger(1, md5.digest(password.getBytes())); - - // make sure our MD5 hash value is 32 digits long... - StringBuffer sb = new StringBuffer(); - String pwStr = pwInt.toString(16); - int padding = 32 - pwStr.length(); - for (int i = 0; i < padding; i++) { - sb.append('0'); - } - sb.append(pwStr); - return sb.toString(); - } - - - public static Element queryAsyncJobResult (String host, InputStream inputStream) { - Element returnBody = null; - - Map values = getSingleValueFromXML(inputStream, - new String[] { "jobid" }); - String jobId = values.get("jobid"); - - if (jobId == null) { - s_logger.error("Unable to get a jobId"); - return null; - } - - //s_logger.info("Job id is " + jobId); - String resultUrl = host + "?command=queryAsyncJobResult&jobid=" + jobId; - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(resultUrl); - while (true) { - try { - client.executeMethod(method); - //s_logger.info("Method is executed successfully. Following url was sent " + resultUrl); - InputStream is = method.getResponseBodyAsStream(); - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = builder.parse(is); - returnBody = doc.getDocumentElement(); - doc.getDocumentElement().normalize(); - Element jobStatusTag = (Element) returnBody.getElementsByTagName("jobstatus").item(0); - String jobStatus = jobStatusTag.getTextContent(); - if(jobStatus.equals("0")) { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - } - } else { - break; - } - - } catch (Exception ex) { - s_logger.error(ex); - } - } - return returnBody; - } - -} +package com.cloud.test.stress; + +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; +import java.net.URLEncoder; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.HttpException; +import org.apache.commons.httpclient.HttpMethod; +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.log4j.Logger; +import org.apache.log4j.NDC; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + + +import com.cloud.utils.encoding.Base64; +import com.cloud.utils.exception.CloudRuntimeException; +import com.trilead.ssh2.ChannelCondition; +import com.trilead.ssh2.Connection; +import com.trilead.ssh2.SCPClient; +import com.trilead.ssh2.Session; + +public class StressTestDirectAttach { + private static long sleepTime = 180000L; // default 0 + private static boolean cleanUp = true; + public static final Logger s_logger = Logger + .getLogger(TestClientWithAPI.class.getName()); + private static boolean repeat = true; + private static String[] users = null; + private static boolean internet = false; + private static ThreadLocal _linuxIP = new ThreadLocal(); + private static ThreadLocal _linuxVmId = new ThreadLocal(); + private static ThreadLocal _linuxVmId1 = new ThreadLocal(); + private static ThreadLocal _linuxPassword = new ThreadLocal(); + private static ThreadLocal _windowsIP = new ThreadLocal(); + private static ThreadLocal _secretKey = new ThreadLocal(); + private static ThreadLocal _apiKey = new ThreadLocal(); + private static ThreadLocal _userId = new ThreadLocal(); + private static ThreadLocal _account = new ThreadLocal(); + private static ThreadLocal _domainRouterId = new ThreadLocal(); + private static ThreadLocal _newVolume = new ThreadLocal(); + private static ThreadLocal _newVolume1 = new ThreadLocal(); + private static DocumentBuilderFactory factory = DocumentBuilderFactory + .newInstance(); + private static int usageIterator = 1; + private static int numThreads = 1; + private static int wait = 5000; + private static String accountName = null; + private static String zoneId = "1"; + private static String serviceOfferingId = "13"; + private static String diskOfferingId="11"; + private static String diskOfferingId1="12"; + + private static final int MAX_RETRY_LINUX = 10; + private static final int MAX_RETRY_WIN = 10; + + + public static void main(String[] args) { + String host = "http://localhost"; + String port = "8092"; + String devPort = "8080"; + String apiUrl = "/client/api"; + + try { + // Parameters + List argsList = Arrays.asList(args); + Iterator iter = argsList.iterator(); + while (iter.hasNext()) { + String arg = iter.next(); + // host + if (arg.equals("-h")) { + host = "http://" + iter.next(); + } + + if (arg.equals("-p")) { + port = iter.next(); + } + if (arg.equals("-dp")) { + devPort = iter.next(); + } + + if (arg.equals("-t")) { + numThreads = Integer.parseInt(iter.next()); + } + + if (arg.equals("-s")) { + sleepTime = Long.parseLong(iter.next()); + } + if (arg.equals("-a")) { + accountName = iter.next(); + } + + if (arg.equals("-c")) { + cleanUp = Boolean.parseBoolean(iter.next()); + if (!cleanUp) + sleepTime = 0L; // no need to wait if we don't ever + // cleanup + } + + if (arg.equals("-r")) { + repeat = Boolean.parseBoolean(iter.next()); + } + + if (arg.equals("-i")) { + internet = Boolean.parseBoolean(iter.next()); + } + + if (arg.equals("-w")) { + wait = Integer.parseInt(iter.next()); + } + + if (arg.equals("-z")) { + zoneId = iter.next(); + } + + if (arg.equals("-so")) { + serviceOfferingId = iter.next(); + } + + } + + final String server = host + ":" + port + "/"; + final String developerServer = host + ":" + devPort + apiUrl; + s_logger.info("Starting test against server: " + server + " with " + + numThreads + " thread(s)"); + if (cleanUp) + s_logger.info("Clean up is enabled, each test will wait " + + sleepTime + " ms before cleaning up"); + + + + for (int i = 0; i < numThreads; i++) { + new Thread(new Runnable() { + public void run() { + do { + String username = null; + try { + long now = System.currentTimeMillis(); + Random ran = new Random(); + username = Math.abs(ran.nextInt())+ "-user"; + NDC.push(username); + + s_logger.info("Starting test for the user " + username); + int response = executeDeployment(server, + developerServer, username); + boolean success = false; + String reason = null; + + + + + if (response == 200) { + success = true; + if (internet) { + s_logger + .info("Deploy successful...waiting 5 minute before SSH tests"); + Thread.sleep(300000L); // Wait 60 + // seconds so + // the windows VM + // can boot up and do a sys prep. + + s_logger.info("Begin Linux SSH test for account " + _account.get()); + reason = sshTest(_linuxIP.get(), _linuxPassword.get()); + + + if (reason == null) { + s_logger + .info("Linux SSH test successful for account " + _account.get()); + } + } + if (reason == null) { + if (internet) { + s_logger + .info("Windows SSH test successful for account " + _account.get()); + } else { + s_logger + .info("deploy test successful....now cleaning up"); + if (cleanUp) { + s_logger + .info("Waiting " + + sleepTime + + " ms before cleaning up vms"); + Thread.sleep(sleepTime); + } else { + success = true; + } + } + + if (usageIterator >= numThreads) { + int eventsAndBillingResponseCode = + executeEventsAndBilling(server, developerServer); + s_logger.info("events and usage records command finished with response code: " + + eventsAndBillingResponseCode); + usageIterator = 1; + + } + else { + s_logger.info("Skipping events and usage records for this user: usageIterator " + usageIterator+ " and number of Threads " + numThreads); + usageIterator++; + } + + if ((users == null) && (accountName == null)) { + s_logger + .info("Sending cleanup command"); + int cleanupResponseCode = executeCleanup( + server, developerServer, username); + s_logger + .info("cleanup command finished with response code: " + + cleanupResponseCode); + success = (cleanupResponseCode == 200); + } else { + s_logger + .info("Sending stop DomR / destroy VM command"); + int stopResponseCode = executeStop( + server, developerServer, + username); + s_logger + .info("stop(destroy) command finished with response code: " + + stopResponseCode); + success = (stopResponseCode == 200); + } + + } else { + // Just stop but don't destroy the + // VMs/Routers + s_logger + .info("SSH test failed for account " + _account.get() + "with reason '" + + reason + + "', stopping VMs"); + int stopResponseCode = executeStop( + server, developerServer, + username); + s_logger + .info("stop command finished with response code: " + + stopResponseCode); + success = false; // since the SSH test + // failed, mark the + // whole test as + // failure + } + } else { + // Just stop but don't destroy the + // VMs/Routers + s_logger + .info("Deploy test failed with reason '" + + reason + + "', stopping VMs"); + int stopResponseCode = executeStop(server, + developerServer, username); + s_logger + .info("stop command finished with response code: " + + stopResponseCode); + success = false; // since the deploy test + // failed, mark the + // whole test as failure + } + + if (success) { + s_logger + .info("***** Completed test for user : " + + username + + " in " + + ((System + .currentTimeMillis() - now) / 1000L) + + " seconds"); + + } else { + s_logger + .info("##### FAILED test for user : " + + username + + " in " + + ((System + .currentTimeMillis() - now) / 1000L) + + " seconds with reason : " + + reason); + } + s_logger.info("Sleeping for " + wait + " seconds before starting next iteration"); + Thread.sleep(wait); + } catch (Exception e) { + s_logger.warn("Error in thread", e); + try { + int stopResponseCode = executeStop(server, + developerServer, username); + s_logger.info("stop response code: " + + stopResponseCode); + } catch (Exception e1) { + } + } finally { + NDC.clear(); + } + } while (repeat); + } + }).start(); + } + } catch (Exception e) { + s_logger.error(e); + } + } + + + public static Map> getMultipleValuesFromXML( + InputStream is, String[] tagNames) { + Map> returnValues = new HashMap>(); + try { + DocumentBuilder docBuilder = factory.newDocumentBuilder(); + Document doc = docBuilder.parse(is); + Element rootElement = doc.getDocumentElement(); + for (int i = 0; i < tagNames.length; i++) { + NodeList targetNodes = rootElement + .getElementsByTagName(tagNames[i]); + if (targetNodes.getLength() <= 0) { + s_logger.error("no " + tagNames[i] + + " tag in XML response...returning null"); + } else { + List valueList = new ArrayList(); + for (int j = 0; j < targetNodes.getLength(); j++) { + Node node = targetNodes.item(j); + valueList.add(node.getTextContent()); + } + returnValues.put(tagNames[i], valueList); + } + } + } catch (Exception ex) { + s_logger.error(ex); + } + return returnValues; + } + + public static Map getSingleValueFromXML(InputStream is, + String[] tagNames) { + Map returnValues = new HashMap(); + try { + DocumentBuilder docBuilder = factory.newDocumentBuilder(); + Document doc = docBuilder.parse(is); + Element rootElement = doc.getDocumentElement(); + + for (int i = 0; i < tagNames.length; i++) { + NodeList targetNodes = rootElement + .getElementsByTagName(tagNames[i]); + if (targetNodes.getLength() <= 0) { + s_logger.error("no " + tagNames[i] + + " tag in XML response...returning null"); + } else { + returnValues.put(tagNames[i], targetNodes.item(0) + .getTextContent()); + } + } + } catch (Exception ex) { + s_logger.error("error processing XML", ex); + } + return returnValues; + } + + public static Map getSingleValueFromXML(Element rootElement, + String[] tagNames) { + Map returnValues = new HashMap(); + if (rootElement == null) { + s_logger.error("Root element is null, can't get single value from xml"); + return null; + } + try { + for (int i = 0; i < tagNames.length; i++) { + NodeList targetNodes = rootElement + .getElementsByTagName(tagNames[i]); + if (targetNodes.getLength() <= 0) { + s_logger.error("no " + tagNames[i] + + " tag in XML response...returning null"); + } else { + returnValues.put(tagNames[i], targetNodes.item(0) + .getTextContent()); + } + } + } catch (Exception ex) { + s_logger.error("error processing XML", ex); + } + return returnValues; + } + + + private static List getNonSourceNatIPs(InputStream is) { + List returnValues = new ArrayList(); + try { + DocumentBuilder docBuilder = factory.newDocumentBuilder(); + Document doc = docBuilder.parse(is); + Element rootElement = doc.getDocumentElement(); + NodeList allocatedIpAddrNodes = rootElement + .getElementsByTagName("publicipaddress"); + for (int i = 0; i < allocatedIpAddrNodes.getLength(); i++) { + Node allocatedIpAddrNode = allocatedIpAddrNodes.item(i); + NodeList childNodes = allocatedIpAddrNode.getChildNodes(); + String ipAddress = null; + boolean isSourceNat = true; // assume it's source nat until we + // find otherwise + for (int j = 0; j < childNodes.getLength(); j++) { + Node n = childNodes.item(j); + if ("ipaddress".equals(n.getNodeName())) { + ipAddress = n.getTextContent(); + } else if ("issourcenat".equals(n.getNodeName())) { + isSourceNat = Boolean.parseBoolean(n.getTextContent()); + } + } + if ((ipAddress != null) && !isSourceNat) { + returnValues.add(ipAddress); + } + } + } catch (Exception ex) { + s_logger.error(ex); + } + return returnValues; + } + + private static List getSourceNatIPs(InputStream is) { + List returnValues = new ArrayList(); + try { + DocumentBuilder docBuilder = factory.newDocumentBuilder(); + Document doc = docBuilder.parse(is); + Element rootElement = doc.getDocumentElement(); + NodeList allocatedIpAddrNodes = rootElement + .getElementsByTagName("publicipaddress"); + for (int i = 0; i < allocatedIpAddrNodes.getLength(); i++) { + Node allocatedIpAddrNode = allocatedIpAddrNodes.item(i); + NodeList childNodes = allocatedIpAddrNode.getChildNodes(); + String ipAddress = null; + boolean isSourceNat = false; // assume it's *not* source nat until we find otherwise + for (int j = 0; j < childNodes.getLength(); j++) { + Node n = childNodes.item(j); + if ("ipaddress".equals(n.getNodeName())) { + ipAddress = n.getTextContent(); + } else if ("issourcenat".equals(n.getNodeName())) { + isSourceNat = Boolean.parseBoolean(n.getTextContent()); + } + } + if ((ipAddress != null) && isSourceNat) { + returnValues.add(ipAddress); + } + } + } catch (Exception ex) { + s_logger.error(ex); + } + return returnValues; + } + + private static String executeRegistration(String server, String username, + String password) throws HttpException, IOException { + String url = server + "?command=registerUserKeys&id=" + _userId.get().toString(); + s_logger.info("registering: " + username); + String returnValue = null; + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode = client.executeMethod(method); + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map requestKeyValues = getSingleValueFromXML(is, + new String[] { "apikey", "secretkey" }); + _apiKey.set(requestKeyValues.get("apikey")); + returnValue = requestKeyValues.get("secretkey"); + } else { + s_logger.error("registration failed with error code: " + responseCode); + } + return returnValue; + } + + private static Integer executeDeployment(String server, String developerServer, + String username) throws HttpException, IOException { + // test steps: + // - create user + // - deploy Windows VM + // - deploy Linux VM + // - associate IP address + // - create two IP forwarding rules + // - create load balancer rule + // - list IP forwarding rules + // - list load balancer rules + + // ----------------------------- + // CREATE USER + // ----------------------------- + String encodedUsername = URLEncoder.encode(username, "UTF-8"); + String encryptedPassword = createMD5Password(username); + String encodedPassword = URLEncoder.encode(encryptedPassword, "UTF-8"); + + String url = server + "?command=createUser&username=" + encodedUsername + + "&password=" + encodedPassword + + "&firstname=Test&lastname=Test&email=test@vmops.com&domainId=1&accounttype=0"; + if (accountName != null ) { + url = server + "?command=createUser&username=" + encodedUsername + + "&password=" + encodedPassword + + "&firstname=Test&lastname=Test&email=test@vmops.com&domainId=1&accounttype=0&account=" + accountName; + } + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode = client.executeMethod(method); + long userId = -1; + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map userIdValues = getSingleValueFromXML(is, + new String[] { "id", "account" }); + String userIdStr = userIdValues.get("id"); + s_logger.info("created user " + username + " with id "+ userIdStr); + if (userIdStr != null) { + userId = Long.parseLong(userIdStr); + _userId.set(userId); + _account.set(userIdValues.get("account")); + if (userId == -1) { + s_logger + .error("create user (" + username + ") failed to retrieve a valid user id, aborting depolyment test"); + return -1; + } + } + } else { + s_logger.error("create user test failed for user " + username + " with error code :" + responseCode); + return responseCode; + } + + _secretKey.set(executeRegistration(server, username, username)); + + if (_secretKey.get() == null) { + s_logger + .error("FAILED to retrieve secret key during registration, skipping user: " + + username); + return -1; + } else { + s_logger.info("got secret key: " + _secretKey.get()); + s_logger.info("got api key: " + _apiKey.get()); + } + + + // --------------------------------- + // CREATE NETWORK GROUP AND ADD INGRESS RULE TO IT + // --------------------------------- + String networkAccount = null; + if (accountName != null) { + networkAccount = accountName; + } + else { + networkAccount = encodedUsername; + } + String encodedApiKey = URLEncoder.encode(_apiKey.get(), "UTF-8"); + String requestToSign = "apikey=" + encodedApiKey + + "&command=createSecurityGroup&name=" + encodedUsername; + requestToSign = requestToSign.toLowerCase(); + String signature = signRequest(requestToSign, _secretKey.get()); + String encodedSignature = URLEncoder.encode(signature, "UTF-8"); + url = developerServer + "?command=createSecurityGroup&name=" + encodedUsername + "&apikey=" + encodedApiKey + + "&signature=" + encodedSignature; + method = new GetMethod(url); + responseCode = client.executeMethod(method); + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map values = getSingleValueFromXML(is, + new String[] { "id" }); + + if (values.get("id") == null) { + s_logger.info("Create network rule response code: 401"); + return 401; + } + else { + s_logger.info("Create security group response code: " + responseCode); + } + } else { + s_logger.error("Create security group failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + + + String encodedCidr = URLEncoder.encode("192.168.1.143/32", "UTF-8"); + url = server + "?command=authorizeSecurityGroupIngress&cidrlist=" + encodedCidr + "&endport=22&" + + "securitygroupname=" + encodedUsername +"&protocol=tcp&startport=22&account=" + networkAccount + "&domainid=1"; + + method = new GetMethod(url); + responseCode = client.executeMethod(method); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map values = getSingleValueFromXML(el, + new String[] { "id" }); + + if (values.get("id") == null) { + s_logger.info("Authorise security group ingress response code: 401"); + return 401; + } + else { + s_logger.info("Authorise security group ingress response code: " + responseCode); + } + } else { + s_logger.error("Authorise security group ingress failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + + + + // --------------------------------- + // DEPLOY LINUX VM + // --------------------------------- + { + long templateId = 2; + String encodedZoneId = URLEncoder.encode("" + zoneId, "UTF-8"); + String encodedServiceOfferingId = URLEncoder.encode("" + + serviceOfferingId, "UTF-8"); + String encodedTemplateId = URLEncoder.encode("" + templateId, + "UTF-8"); + encodedApiKey = URLEncoder.encode(_apiKey.get(), "UTF-8"); + requestToSign = "apikey=" + encodedApiKey + + "&command=deployVirtualMachine&securitygrouplist=" + encodedUsername + "&serviceofferingid=" + + encodedServiceOfferingId + "&templateid=" + + encodedTemplateId + "&zoneid=" + encodedZoneId; + requestToSign = requestToSign.toLowerCase(); + signature = signRequest(requestToSign, _secretKey.get()); + encodedSignature = URLEncoder.encode(signature, "UTF-8"); + url = developerServer + "?command=deployVirtualMachine&securitygrouplist=" + encodedUsername + "&zoneid=" + encodedZoneId + "&serviceofferingid=" + + encodedServiceOfferingId + "&templateid=" + + encodedTemplateId + "&apikey=" + encodedApiKey + + "&signature=" + encodedSignature; + + method = new GetMethod(url); + responseCode = client.executeMethod(method); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map values = getSingleValueFromXML(el, + new String[] { "id", "ipaddress" }); + + if ((values.get("ipaddress") == null) || (values + .get("id") == null)) { + s_logger.info("deploy linux vm response code: 401"); + return 401; + } + else { + s_logger.info("deploy linux vm response code: " + responseCode); + long linuxVMId = Long.parseLong(values.get("id")); + s_logger.info("got linux virtual machine id: " + linuxVMId); + _linuxVmId.set(values.get("id")); + _linuxIP.set(values.get("ipaddress")); + _linuxPassword.set("rs-ccb35ea5"); + } + } else { + s_logger.error("deploy linux vm failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + } + + + + //Create a new volume + { + url = server + "?command=createVolume&diskofferingid=" + diskOfferingId + "&zoneid=" + zoneId + "&name=newvolume&account=" + _account.get() + "&domainid=1"; + s_logger.info("Creating volume...."); + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map values = getSingleValueFromXML(el, + new String[] { "id" }); + + if (values.get("id") == null) { + s_logger.info("create volume response code: 401"); + return 401; + } + else { + s_logger.info("create volume response code: " + responseCode); + String volumeId = values.get("id"); + s_logger.info("got volume id: " + volumeId); + _newVolume.set(volumeId); + } + } else { + s_logger.error("create volume failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + } + + //attach a new volume to the vm + { + url = server + "?command=attachVolume&id=" + _newVolume.get() + "&virtualmachineid=" + _linuxVmId.get(); + s_logger.info("Attaching volume with id " + _newVolume.get() + " to the vm " + _linuxVmId.get()); + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + s_logger.info("Attach data volume response code: " + responseCode); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map values = getSingleValueFromXML(el, + new String[] { "id" }); + + if (values.get("id") == null) { + s_logger.info("Attach volume response code: 401"); + return 401; + } + else { + s_logger.info("Attach volume response code: " + responseCode); + } + } else { + s_logger.error("Attach volume failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + } + + //DEPLOY SECOND VM, ADD VOLUME TO IT + + // --------------------------------- + // DEPLOY another linux vm + // --------------------------------- + { + long templateId = 2; + String encodedZoneId = URLEncoder.encode("" + zoneId, "UTF-8"); + String encodedServiceOfferingId = URLEncoder.encode("" + + serviceOfferingId, "UTF-8"); + String encodedTemplateId = URLEncoder.encode("" + templateId, + "UTF-8"); + encodedApiKey = URLEncoder.encode(_apiKey.get(), "UTF-8"); + requestToSign = "apikey=" + encodedApiKey + + "&command=deployVirtualMachine&securitygrouplist=" + encodedUsername + "&serviceofferingid=" + + encodedServiceOfferingId + "&templateid=" + + encodedTemplateId + "&zoneid=" + encodedZoneId; + requestToSign = requestToSign.toLowerCase(); + signature = signRequest(requestToSign, _secretKey.get()); + encodedSignature = URLEncoder.encode(signature, "UTF-8"); + url = developerServer + "?command=deployVirtualMachine&securitygrouplist=" + encodedUsername + "&zoneid=" + encodedZoneId + "&serviceofferingid=" + + encodedServiceOfferingId + "&templateid=" + + encodedTemplateId + "&apikey=" + encodedApiKey + + "&signature=" + encodedSignature; + + method = new GetMethod(url); + responseCode = client.executeMethod(method); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map values = getSingleValueFromXML(el, + new String[] { "id", "ipaddress" }); + + if ((values.get("ipaddress") == null) || (values + .get("id") == null)) { + s_logger.info("deploy linux vm response code: 401"); + return 401; + } + else { + s_logger.info("deploy linux vm response code: " + responseCode); + long linuxVMId = Long.parseLong(values.get("id")); + s_logger.info("got linux virtual machine id: " + linuxVMId); + _linuxVmId1.set(values.get("id")); + } + } else { + s_logger.error("deploy linux vm failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + } + + + + //Create a new volume + { + url = server + "?command=createVolume&diskofferingid=" + diskOfferingId1 + "&zoneid=" + zoneId + "&name=newvolume1&account=" + _account.get() + "&domainid=1"; + s_logger.info("Creating volume...."); + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map values = getSingleValueFromXML(el, + new String[] { "id" }); + + if (values.get("id") == null) { + s_logger.info("create volume response code: 401"); + return 401; + } + else { + s_logger.info("create volume response code: " + responseCode); + String volumeId = values.get("id"); + s_logger.info("got volume id: " + volumeId); + _newVolume1.set(volumeId); + } + } else { + s_logger.error("create volume failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + } + + //attach a new volume to the vm + { + url = server + "?command=attachVolume&id=" + _newVolume1.get() + "&virtualmachineid=" + _linuxVmId1.get(); + s_logger.info("Attaching volume with id " + _newVolume1.get() + " to the vm " + _linuxVmId1.get()); + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + s_logger.info("Attach data volume response code: " + responseCode); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map values = getSingleValueFromXML(el, + new String[] { "id" }); + + if (values.get("id") == null) { + s_logger.info("Attach volume response code: 401"); + return 401; + } + else { + s_logger.info("Attach volume response code: " + responseCode); + } + } else { + s_logger.error("Attach volume failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + } + return 200; + } + + + + + private static int executeCleanup(String server, String developerServer, String username) + throws HttpException, IOException { + // test steps: + // - get user + // - delete user + + // ----------------------------- + // GET USER + // ----------------------------- + String userId = _userId.get().toString(); + String encodedUserId = URLEncoder.encode(userId, "UTF-8"); + String url = server + "?command=listUsers&id=" + encodedUserId; + s_logger.info("Cleaning up resources for user: " + userId + " with url " + url); + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode = client.executeMethod(method); + s_logger.info("get user response code: " + responseCode); + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map userInfo = getSingleValueFromXML(is, + new String[] { "username", "id", "account" }); + if (!username.equals(userInfo.get("username"))) { + s_logger + .error("get user failed to retrieve requested user, aborting cleanup test" + ". Following URL was sent: " + url); + return -1; + } + + } else { + s_logger.error("get user failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + + // ----------------------------- + // UPDATE USER + // ----------------------------- + { + url = server + "?command=updateUser&id=" + userId + + "&firstname=delete&lastname=me"; + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + s_logger.info("update user response code: " + responseCode); + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map success = getSingleValueFromXML(is, + new String[] { "success" }); + s_logger + .info("update user..success? " + success.get("success")); + } else { + s_logger.error("update user failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + } + + // ----------------------------- + // Execute reboot/stop/start commands for the VMs before deleting the account - made to exercise xen + // ----------------------------- + + //Reboot centos VM + String encodedApiKey = URLEncoder.encode(_apiKey.get(), "UTF-8"); + String requestToSign = "apikey=" + encodedApiKey + "&command=rebootVirtualMachine&id=" + _linuxVmId.get(); + requestToSign = requestToSign.toLowerCase(); + String signature = signRequest(requestToSign, _secretKey.get()); + String encodedSignature = URLEncoder.encode(signature, "UTF-8"); + + url = developerServer + "?command=rebootVirtualMachine&id=" + _linuxVmId.get() + "&apikey=" + + encodedApiKey + "&signature=" + encodedSignature; + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + s_logger.info("Reboot VM response code: " + + responseCode); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map success = getSingleValueFromXML(el, + new String[] { "success" }); + s_logger.info("VM was rebooted with the status: " + + success.get("success")); + } else { + s_logger.error(" VM test failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + + //Stop centos VM + requestToSign = "apikey=" + encodedApiKey + "&command=stopVirtualMachine&id=" + _linuxVmId.get(); + requestToSign = requestToSign.toLowerCase(); + signature = signRequest(requestToSign, _secretKey.get()); + encodedSignature = URLEncoder.encode(signature, "UTF-8"); + + url = developerServer + "?command=stopVirtualMachine&id=" + _linuxVmId.get() + "&apikey=" + + encodedApiKey + "&signature=" + encodedSignature; + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + s_logger.info("Stop VM response code: " + + responseCode); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map success = getSingleValueFromXML(el, + new String[] { "success" }); + s_logger.info("VM was stopped with the status: " + + success.get("success")); + } else { + s_logger.error("Stop VM test failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + + //Start centos VM + requestToSign = "apikey=" + encodedApiKey + "&command=startVirtualMachine&id=" + _linuxVmId.get(); + requestToSign = requestToSign.toLowerCase(); + signature = signRequest(requestToSign, _secretKey.get()); + encodedSignature = URLEncoder.encode(signature, "UTF-8"); + + url = developerServer + "?command=startVirtualMachine&id=" + _linuxVmId.get() + "&apikey=" + + encodedApiKey + "&signature=" + encodedSignature; + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + s_logger.info("Start VM response code: " + + responseCode); + + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map success = getSingleValueFromXML(el, + new String[] { "id" }); + + if (success.get("id") == null) { + s_logger.info("Start linux vm response code: 401"); + return 401; + } + else { + s_logger.info("Start vm response code: " + responseCode); + } + + s_logger.info("VM was started with the status: " + + success.get("success")); + } else { + s_logger.error("Start VM test failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + +//// // ----------------------------- +//// // DISABLE USER +//// // ----------------------------- +// { +// url = server + "?command=disableUser&id=" + userId; +// client = new HttpClient(); +// method = new GetMethod(url); +// responseCode = client.executeMethod(method); +// s_logger.info("disable user response code: " + responseCode); +// if (responseCode == 200) { +// InputStream input = method.getResponseBodyAsStream(); +// Element el = queryAsyncJobResult(server, input); +// s_logger +// .info("Disabled user successfully"); +// } else { +// s_logger.error("disable user failed with error code: " + responseCode + ". Following URL was sent: " + url); +// return responseCode; +// } +// } + + // ----------------------------- + // DELETE USER + // ----------------------------- + { + url = server + "?command=deleteUser&id=" + userId; + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + s_logger.info("delete user response code: " + responseCode); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + s_logger + .info("Deleted user successfully"); + } else { + s_logger.error("delete user failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + } + return responseCode; + } + + private static int executeEventsAndBilling(String server, String developerServer) + throws HttpException, IOException { + // test steps: + // - get all the events in the system for all users in the system + // - generate all the usage records in the system + // - get all the usage records in the system + + // ----------------------------- + // GET EVENTS + // ----------------------------- + String url =server+"?command=listEvents&page=1&account=" + _account.get(); + + s_logger.info("Getting events for the account " + _account.get()); + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode = client.executeMethod(method); + s_logger.info("get events response code: " + responseCode); + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map> eventDescriptions = getMultipleValuesFromXML( + is, new String[] { "description" }); + List descriptionText = eventDescriptions.get("description"); + if (descriptionText == null) { + s_logger.info("no events retrieved..."); + } else { + for (String text : descriptionText) { + s_logger.info("event: " + text); + } + } + } else { + s_logger.error("list events failed with error code: " + responseCode + ". Following URL was sent: " + url); + + return responseCode; + } + return responseCode; + } + + + private static int executeStop(String server, String developerServer, + String username) throws HttpException, IOException { + // test steps: + // - get userId for the given username + // - list virtual machines for the user + // - stop all virtual machines + // - get ip addresses for the user + // - release ip addresses + + // ----------------------------- + // GET USER + // ----------------------------- + String userId = _userId.get().toString(); + String encodedUserId = URLEncoder.encode(userId, "UTF-8"); + + String url = server + "?command=listUsers&id=" + encodedUserId; + s_logger.info("Stopping resources for user: " + username); + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode = client.executeMethod(method); + s_logger.info("get user response code: " + responseCode); + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map userIdValues = getSingleValueFromXML(is, + new String[] { "id" }); + String userIdStr = userIdValues.get("id"); + if (userIdStr != null) { + userId = userIdStr; + if (userId == null) { + s_logger + .error("get user failed to retrieve a valid user id, aborting depolyment test" + ". Following URL was sent: " + url); + return -1; + } + } + } else { + s_logger.error("get user failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + + { + // ---------------------------------- + // LIST VIRTUAL MACHINES + // ---------------------------------- + String encodedApiKey = URLEncoder.encode(_apiKey.get(), "UTF-8"); + String requestToSign = "apikey=" + encodedApiKey + + "&command=listVirtualMachines"; + requestToSign = requestToSign.toLowerCase(); + String signature = signRequest(requestToSign, _secretKey.get()); + String encodedSignature = URLEncoder.encode(signature, "UTF-8"); + + url = developerServer + "?command=listVirtualMachines&apikey=" + encodedApiKey + "&signature=" + + encodedSignature; + + s_logger.info("Listing all virtual machines for the user with url " + url); + String[] vmIds = null; + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + s_logger.info("list virtual machines response code: " + + responseCode); + if (responseCode == 200) { + InputStream is = method.getResponseBodyAsStream(); + Map> vmIdValues = getMultipleValuesFromXML( + is, new String[] { "id" }); + if (vmIdValues.containsKey("id")) { + List vmIdList = vmIdValues.get("id"); + if (vmIdList != null) { + vmIds = new String[vmIdList.size()]; + vmIdList.toArray(vmIds); + String vmIdLogStr = ""; + if ((vmIds != null) && (vmIds.length > 0)) { + vmIdLogStr = vmIds[0]; + for (int i = 1; i < vmIds.length; i++) { + vmIdLogStr = vmIdLogStr + "," + vmIds[i]; + } + } + s_logger.info("got virtual machine ids: " + vmIdLogStr); + } + } + + + } else { + s_logger.error("list virtual machines test failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + + + // ---------------------------------- + // STOP/DESTROY VIRTUAL MACHINES + // ---------------------------------- + if (vmIds != null) { + for (String vmId : vmIds) { + requestToSign = "apikey=" + encodedApiKey + "&command=stopVirtualMachine&id=" + vmId; + requestToSign = requestToSign.toLowerCase(); + signature = signRequest(requestToSign, _secretKey.get()); + encodedSignature = URLEncoder.encode(signature, "UTF-8"); + + url = developerServer + "?command=stopVirtualMachine&id=" + vmId + "&apikey=" + + encodedApiKey + "&signature=" + encodedSignature; + client = new HttpClient(); + method = new GetMethod(url); + responseCode = client.executeMethod(method); + s_logger.info("StopVirtualMachine" + " [" + vmId + "] response code: " + + responseCode); + if (responseCode == 200) { + InputStream input = method.getResponseBodyAsStream(); + Element el = queryAsyncJobResult(server, input); + Map success = getSingleValueFromXML(el, + new String[] { "success" }); + s_logger.info("StopVirtualMachine..success? " + + success.get("success")); + } else { + s_logger.error("Stop virtual machine test failed with error code: " + responseCode + ". Following URL was sent: " + url); + return responseCode; + } + } + } + +// { +// url = server + "?command=deleteUser&id=" + userId; +// client = new HttpClient(); +// method = new GetMethod(url); +// responseCode = client.executeMethod(method); +// s_logger.info("delete user response code: " + responseCode); +// if (responseCode == 200) { +// InputStream input = method.getResponseBodyAsStream(); +// Element el = queryAsyncJobResult(server, input); +// s_logger +// .info("Deleted user successfully"); +// } else { +// s_logger.error("delete user failed with error code: " + responseCode + ". Following URL was sent: " + url); +// return responseCode; +// } +// } + + + } + + _linuxIP.set(""); + _linuxVmId.set(""); + _linuxPassword.set(""); + _windowsIP.set(""); + _secretKey.set(""); + _apiKey.set(""); + _userId.set(Long.parseLong("0")); + _account.set(""); + _domainRouterId.set(""); + return responseCode; + } + + public static String signRequest(String request, String key) { + try { + Mac mac = Mac.getInstance("HmacSHA1"); + SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), + "HmacSHA1"); + mac.init(keySpec); + mac.update(request.getBytes()); + byte[] encryptedBytes = mac.doFinal(); + return Base64.encodeBytes(encryptedBytes); + } catch (Exception ex) { + s_logger.error("unable to sign request", ex); + } + return null; + } + + private static String sshWinTest(String host) { + if (host == null) { + s_logger + .info("Did not receive a host back from test, ignoring win ssh test"); + return null; + } + + // We will retry 5 times before quitting + int retry = 1; + + while (true) { + try { + if (retry > 0) { + s_logger.info("Retry attempt : " + retry + + " ...sleeping 300 seconds before next attempt. Account is " + _account.get()); + Thread.sleep(300000); + } + + s_logger.info("Attempting to SSH into windows host " + host + + " with retry attempt: " + retry + " for account " + _account.get()); + + Connection conn = new Connection(host); + conn.connect(null, 60000, 60000); + + s_logger.info("User " + _account.get() + " ssHed successfully into windows host " + host); + boolean success = false; + boolean isAuthenticated = conn.authenticateWithPassword( + "Administrator", "password"); + if (isAuthenticated == false) { + return "Authentication failed"; + } + else { + s_logger.info("Authentication is successfull"); + } + + try { + SCPClient scp = new SCPClient(conn); + scp.put("wget.exe", "wget.exe", "C:\\Users\\Administrator", "0777"); + s_logger.info("Successfully put wget.exe file"); + } catch (Exception ex) { + s_logger.error("Unable to put wget.exe " + ex); + } + + if (conn == null ){ + s_logger.error("Connection is null"); + } + Session sess = conn.openSession(); + + s_logger.info("User + " + _account.get() + " executing : wget http://192.168.1.250/dump.bin"); + sess + .execCommand("wget http://192.168.1.250/dump.bin && dir dump.bin"); + + InputStream stdout = sess.getStdout(); + InputStream stderr = sess.getStderr(); + + byte[] buffer = new byte[8192]; + while (true) { + if ((stdout.available() == 0) && (stderr.available() == 0)) { + int conditions = sess.waitForCondition( + ChannelCondition.STDOUT_DATA + | ChannelCondition.STDERR_DATA + | ChannelCondition.EOF, 120000); + + if ((conditions & ChannelCondition.TIMEOUT) != 0) { + s_logger + .info("Timeout while waiting for data from peer."); + return null; + } + + if ((conditions & ChannelCondition.EOF) != 0) { + if ((conditions & (ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA)) == 0) { + break; + } + } + } + + while (stdout.available() > 0) { + success = true; + int len = stdout.read(buffer); + if (len > 0) // this check is somewhat paranoid + s_logger.info(new String(buffer, 0, len)); + } + + while (stderr.available() > 0) { + /* int len = */stderr.read(buffer); + } + } + sess.close(); + conn.close(); + + if (success) { + Thread.sleep(120000); + return null; + } else { + retry++; + if (retry == MAX_RETRY_WIN) { + return "SSH Windows Network test fail for account " + _account.get(); + } + } + } catch (Exception e) { + s_logger.error(e); + retry++; + if (retry == MAX_RETRY_WIN) { + return "SSH Windows Network test fail with error " + + e.getMessage(); + } + } + } + } + + private static String sshTest(String host, String password) { + int i = 0; + if (host == null) { + s_logger + .info("Did not receive a host back from test, ignoring ssh test"); + return null; + } + + if (password == null){ + s_logger.info("Did not receive a password back from test, ignoring ssh test"); + return null; + } + + // We will retry 5 times before quitting + String result = null; + int retry = 0; + + while (true) { + try { + if (retry > 0) { + s_logger.info("Retry attempt : " + retry + + " ...sleeping 120 seconds before next attempt. Account is " + _account.get()); + Thread.sleep(120000); + } + + s_logger.info("Attempting to SSH into linux host " + host + + " with retry attempt: " + retry + ". Account is " + _account.get()); + + Connection conn = new Connection(host); + conn.connect(null, 60000, 60000); + + s_logger.info("User + " + _account.get() + " ssHed successfully into linux host " + host); + + boolean isAuthenticated = conn.authenticateWithPassword("root", + password); + + if (isAuthenticated == false) { + s_logger.info("Authentication failed for root with password" + password); + return "Authentication failed"; + + } + + boolean success = false; + String linuxCommand = null; + + if (i % 10 == 0) + linuxCommand = "rm -rf *; wget http://192.168.1.250/dump.bin && ls -al dump.bin"; + else + linuxCommand = "wget http://192.168.1.250/dump.bin && ls -al dump.bin"; + + Session sess = conn.openSession(); + s_logger.info("User " + _account.get() + " executing : " + linuxCommand); + sess.execCommand(linuxCommand); + + InputStream stdout = sess.getStdout(); + InputStream stderr = sess.getStderr(); + + + byte[] buffer = new byte[8192]; + while (true) { + if ((stdout.available() == 0) && (stderr.available() == 0)) { + int conditions = sess.waitForCondition( + ChannelCondition.STDOUT_DATA + | ChannelCondition.STDERR_DATA + | ChannelCondition.EOF, 120000); + + if ((conditions & ChannelCondition.TIMEOUT) != 0) { + s_logger + .info("Timeout while waiting for data from peer."); + return null; + } + + if ((conditions & ChannelCondition.EOF) != 0) { + if ((conditions & (ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA)) == 0) { + break; + } + } + } + + while (stdout.available() > 0) { + success = true; + int len = stdout.read(buffer); + if (len > 0) // this check is somewhat paranoid + s_logger.info(new String(buffer, 0, len)); + } + + while (stderr.available() > 0) { + /* int len = */stderr.read(buffer); + } + } + + sess.close(); + conn.close(); + + if (!success) { + retry++; + if (retry == MAX_RETRY_LINUX) { + result = "SSH Linux Network test fail"; + } + } + + return result; + } catch (Exception e) { + retry++; + s_logger.error("SSH Linux Network test fail with error"); + if (retry == MAX_RETRY_LINUX) { + return "SSH Linux Network test fail with error " + + e.getMessage(); + } + } + i++; + } + } + + public static String createMD5Password(String password) { + MessageDigest md5; + + try { + md5 = MessageDigest.getInstance("MD5"); + } catch (NoSuchAlgorithmException e) { + throw new CloudRuntimeException("Error", e); + } + + md5.reset(); + BigInteger pwInt = new BigInteger(1, md5.digest(password.getBytes())); + + // make sure our MD5 hash value is 32 digits long... + StringBuffer sb = new StringBuffer(); + String pwStr = pwInt.toString(16); + int padding = 32 - pwStr.length(); + for (int i = 0; i < padding; i++) { + sb.append('0'); + } + sb.append(pwStr); + return sb.toString(); + } + + + public static Element queryAsyncJobResult (String host, InputStream inputStream) { + Element returnBody = null; + + Map values = getSingleValueFromXML(inputStream, + new String[] { "jobid" }); + String jobId = values.get("jobid"); + + if (jobId == null) { + s_logger.error("Unable to get a jobId"); + return null; + } + + //s_logger.info("Job id is " + jobId); + String resultUrl = host + "?command=queryAsyncJobResult&jobid=" + jobId; + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(resultUrl); + while (true) { + try { + client.executeMethod(method); + //s_logger.info("Method is executed successfully. Following url was sent " + resultUrl); + InputStream is = method.getResponseBodyAsStream(); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document doc = builder.parse(is); + returnBody = doc.getDocumentElement(); + doc.getDocumentElement().normalize(); + Element jobStatusTag = (Element) returnBody.getElementsByTagName("jobstatus").item(0); + String jobStatus = jobStatusTag.getTextContent(); + if(jobStatus.equals("0")) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + } + } else { + break; + } + + } catch (Exception ex) { + s_logger.error(ex); + } + } + return returnBody; + } + +} diff --git a/test/src/com/cloud/test/stress/WgetTest.java b/test/src/com/cloud/test/stress/WgetTest.java index 276fe228c8c..28e74081493 100644 --- a/test/src/com/cloud/test/stress/WgetTest.java +++ b/test/src/com/cloud/test/stress/WgetTest.java @@ -10,148 +10,148 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.stress; - -import java.io.InputStream; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import org.apache.log4j.Logger; - -import com.trilead.ssh2.ChannelCondition; -import com.trilead.ssh2.Connection; -import com.trilead.ssh2.Session; - -public class WgetTest { - - public static int MAX_RETRY_LINUX = 1; - public static final Logger s_logger = Logger.getLogger(WgetTest.class.getName()); - public static String host = ""; - public static String password = "rs-ccb35ea5"; - - - - public static void main (String[] args) { - - // Parameters - List argsList = Arrays.asList(args); - Iterator iter = argsList.iterator(); - while (iter.hasNext()) { - String arg = iter.next(); - // host - if (arg.equals("-h")) { - host = iter.next(); - } - //password - - if (arg.equals("-p")) { - password = iter.next(); - } - - } - - int i = 0; - if (host == null || host.equals("")) { - s_logger - .info("Did not receive a host back from test, ignoring ssh test"); - System.exit(2); - } - - if (password == null){ - s_logger.info("Did not receive a password back from test, ignoring ssh test"); - System.exit(2); - } - int retry = 0; - - try { - if (retry > 0) { - s_logger.info("Retry attempt : " + retry - + " ...sleeping 120 seconds before next attempt"); - Thread.sleep(120000); - } - - s_logger.info("Attempting to SSH into linux host " + host - + " with retry attempt: " + retry); - - Connection conn = new Connection(host); - conn.connect(null, 60000, 60000); - - s_logger.info("User + ssHed successfully into linux host " + host); - - boolean isAuthenticated = conn.authenticateWithPassword("root", - password); - - if (isAuthenticated == false) { - s_logger.info("Authentication failed for root with password" + password); - System.exit(2); - } - - boolean success = false; - String linuxCommand = null; - - if (i % 10 == 0) - linuxCommand = "rm -rf *; wget http://192.168.1.250/dump.bin && ls -al dump.bin"; - else - linuxCommand = "wget http://192.168.1.250/dump.bin && ls -al dump.bin"; - - Session sess = conn.openSession(); - sess.execCommand(linuxCommand); - - InputStream stdout = sess.getStdout(); - InputStream stderr = sess.getStderr(); - - - byte[] buffer = new byte[8192]; - while (true) { - if ((stdout.available() == 0) && (stderr.available() == 0)) { - int conditions = sess.waitForCondition( - ChannelCondition.STDOUT_DATA - | ChannelCondition.STDERR_DATA - | ChannelCondition.EOF, 120000); - - if ((conditions & ChannelCondition.TIMEOUT) != 0) { - s_logger - .info("Timeout while waiting for data from peer."); - System.exit(2); - } - - if ((conditions & ChannelCondition.EOF) != 0) { - if ((conditions & (ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA)) == 0) { - break; - } - } - } - - while (stdout.available() > 0) { - success = true; - int len = stdout.read(buffer); - if (len > 0) // this check is somewhat paranoid - s_logger.info(new String(buffer, 0, len)); - } - - while (stderr.available() > 0) { - /* int len = */stderr.read(buffer); - } - } - - sess.close(); - conn.close(); - - if (!success) { - retry++; - if (retry == MAX_RETRY_LINUX) { - System.exit(2); - } - } - } catch (Exception e) { - retry++; - s_logger.error("SSH Linux Network test fail with error"); - if (retry == MAX_RETRY_LINUX) { - s_logger.error("Ssh test failed"); - System.exit(2); - } - } - } - -} +package com.cloud.test.stress; + +import java.io.InputStream; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import org.apache.log4j.Logger; + +import com.trilead.ssh2.ChannelCondition; +import com.trilead.ssh2.Connection; +import com.trilead.ssh2.Session; + +public class WgetTest { + + public static int MAX_RETRY_LINUX = 1; + public static final Logger s_logger = Logger.getLogger(WgetTest.class.getName()); + public static String host = ""; + public static String password = "rs-ccb35ea5"; + + + + public static void main (String[] args) { + + // Parameters + List argsList = Arrays.asList(args); + Iterator iter = argsList.iterator(); + while (iter.hasNext()) { + String arg = iter.next(); + // host + if (arg.equals("-h")) { + host = iter.next(); + } + //password + + if (arg.equals("-p")) { + password = iter.next(); + } + + } + + int i = 0; + if (host == null || host.equals("")) { + s_logger + .info("Did not receive a host back from test, ignoring ssh test"); + System.exit(2); + } + + if (password == null){ + s_logger.info("Did not receive a password back from test, ignoring ssh test"); + System.exit(2); + } + int retry = 0; + + try { + if (retry > 0) { + s_logger.info("Retry attempt : " + retry + + " ...sleeping 120 seconds before next attempt"); + Thread.sleep(120000); + } + + s_logger.info("Attempting to SSH into linux host " + host + + " with retry attempt: " + retry); + + Connection conn = new Connection(host); + conn.connect(null, 60000, 60000); + + s_logger.info("User + ssHed successfully into linux host " + host); + + boolean isAuthenticated = conn.authenticateWithPassword("root", + password); + + if (isAuthenticated == false) { + s_logger.info("Authentication failed for root with password" + password); + System.exit(2); + } + + boolean success = false; + String linuxCommand = null; + + if (i % 10 == 0) + linuxCommand = "rm -rf *; wget http://192.168.1.250/dump.bin && ls -al dump.bin"; + else + linuxCommand = "wget http://192.168.1.250/dump.bin && ls -al dump.bin"; + + Session sess = conn.openSession(); + sess.execCommand(linuxCommand); + + InputStream stdout = sess.getStdout(); + InputStream stderr = sess.getStderr(); + + + byte[] buffer = new byte[8192]; + while (true) { + if ((stdout.available() == 0) && (stderr.available() == 0)) { + int conditions = sess.waitForCondition( + ChannelCondition.STDOUT_DATA + | ChannelCondition.STDERR_DATA + | ChannelCondition.EOF, 120000); + + if ((conditions & ChannelCondition.TIMEOUT) != 0) { + s_logger + .info("Timeout while waiting for data from peer."); + System.exit(2); + } + + if ((conditions & ChannelCondition.EOF) != 0) { + if ((conditions & (ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA)) == 0) { + break; + } + } + } + + while (stdout.available() > 0) { + success = true; + int len = stdout.read(buffer); + if (len > 0) // this check is somewhat paranoid + s_logger.info(new String(buffer, 0, len)); + } + + while (stderr.available() > 0) { + /* int len = */stderr.read(buffer); + } + } + + sess.close(); + conn.close(); + + if (!success) { + retry++; + if (retry == MAX_RETRY_LINUX) { + System.exit(2); + } + } + } catch (Exception e) { + retry++; + s_logger.error("SSH Linux Network test fail with error"); + if (retry == MAX_RETRY_LINUX) { + s_logger.error("Ssh test failed"); + System.exit(2); + } + } + } + +} diff --git a/test/src/com/cloud/test/ui/AddAndDeleteAISO.java b/test/src/com/cloud/test/ui/AddAndDeleteAISO.java index 7e6dff151fa..90634728f3c 100644 --- a/test/src/com/cloud/test/ui/AddAndDeleteAISO.java +++ b/test/src/com/cloud/test/ui/AddAndDeleteAISO.java @@ -10,104 +10,104 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.ui; - -import org.junit.Test; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import com.cloud.test.ui.AbstractSeleniumTestCase; -import com.thoughtworks.selenium.SeleniumException; - -public class AddAndDeleteAISO extends AbstractSeleniumTestCase { - - @Test - public void testAddAndDeleteISO() throws Exception { - try { - selenium.open("/client/"); - selenium.type("account_username", "admin"); - selenium.type("account_password", "password"); - selenium.click("loginbutton"); - Thread.sleep(3000); - assertTrue(selenium.isTextPresent("admin")); - selenium.click("//div[@id='leftmenu_templates']/div"); - selenium.click("//div[@id='leftmenu_submenu_my_iso']/div/div[2]"); - Thread.sleep(3000); - selenium.click("label"); - - selenium.type("add_iso_name", "abc"); - selenium.type("add_iso_display_text", "abc"); - String iso_url = System.getProperty("add_iso_url", "http://10.91.28.6/ISO/Fedora-11-i386-DVD.iso"); - selenium.type("add_iso_url", iso_url); - String iso_zone = System.getProperty("add_iso_zone", "All Zones"); - selenium.select("add_iso_zone", "label="+iso_zone); - String iso_os_type = System.getProperty("add_iso_os_type", "Fedora 11"); - selenium.select("add_iso_os_type", "label="+iso_os_type); - selenium.click("//div[28]/div[11]/button[1]"); - Thread.sleep(3000); - int i=1; - try - { - for(;;i++) - { - System.out.println("i= "+i); - selenium.click("//div[" +i+ "]/div/div[2]/span/span"); - } - } - catch(Exception ex) { - } - - for (int second = 0;; second++) { - if (second >= 60) fail("timeout"); - try { if (selenium.isVisible("//div[@id='after_action_info_container_on_top']")) break; } catch (Exception e) {} - Thread.sleep(10000); - } - - assertTrue(selenium.isTextPresent("Adding succeeded")); - Thread.sleep(3000); - int status=1; - while(!selenium.isTextPresent("Ready")) - { - for(int j =1;j<=i;j++) - - { - if (selenium.isTextPresent("Ready")) - { - status=0; - break; - } - selenium.click("//div["+j+"]/div/div[2]/span/span"); - } - if(status==0){ - break; - } - else - { - selenium.click("//div[@id='leftmenu_submenu_featured_iso']/div/div[2]"); - Thread.sleep(3000); - selenium.click("//div[@id='leftmenu_submenu_my_iso']/div/div[2]"); - Thread.sleep(3000); - } - - } - selenium.click("link=Delete ISO"); - selenium.click("//div[28]/div[11]/button[1]"); - for (int second = 0;; second++) { - if (second >= 60) fail("timeout"); - try { if (selenium.isVisible("after_action_info_container_on_top")) break; } catch (Exception e) {} - Thread.sleep(1000); - } - - assertTrue(selenium.isTextPresent("Delete ISO action succeeded")); - selenium.click("main_logout"); - selenium.waitForPageToLoad("30000"); - assertTrue(selenium.isTextPresent("Welcome to Management Console")); - - } catch (SeleniumException ex) { - - System.err.println(ex.getMessage()); - fail(ex.getMessage()); - - throw ex; - } - } +package com.cloud.test.ui; + +import org.junit.Test; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import com.cloud.test.ui.AbstractSeleniumTestCase; +import com.thoughtworks.selenium.SeleniumException; + +public class AddAndDeleteAISO extends AbstractSeleniumTestCase { + + @Test + public void testAddAndDeleteISO() throws Exception { + try { + selenium.open("/client/"); + selenium.type("account_username", "admin"); + selenium.type("account_password", "password"); + selenium.click("loginbutton"); + Thread.sleep(3000); + assertTrue(selenium.isTextPresent("admin")); + selenium.click("//div[@id='leftmenu_templates']/div"); + selenium.click("//div[@id='leftmenu_submenu_my_iso']/div/div[2]"); + Thread.sleep(3000); + selenium.click("label"); + + selenium.type("add_iso_name", "abc"); + selenium.type("add_iso_display_text", "abc"); + String iso_url = System.getProperty("add_iso_url", "http://10.91.28.6/ISO/Fedora-11-i386-DVD.iso"); + selenium.type("add_iso_url", iso_url); + String iso_zone = System.getProperty("add_iso_zone", "All Zones"); + selenium.select("add_iso_zone", "label="+iso_zone); + String iso_os_type = System.getProperty("add_iso_os_type", "Fedora 11"); + selenium.select("add_iso_os_type", "label="+iso_os_type); + selenium.click("//div[28]/div[11]/button[1]"); + Thread.sleep(3000); + int i=1; + try + { + for(;;i++) + { + System.out.println("i= "+i); + selenium.click("//div[" +i+ "]/div/div[2]/span/span"); + } + } + catch(Exception ex) { + } + + for (int second = 0;; second++) { + if (second >= 60) fail("timeout"); + try { if (selenium.isVisible("//div[@id='after_action_info_container_on_top']")) break; } catch (Exception e) {} + Thread.sleep(10000); + } + + assertTrue(selenium.isTextPresent("Adding succeeded")); + Thread.sleep(3000); + int status=1; + while(!selenium.isTextPresent("Ready")) + { + for(int j =1;j<=i;j++) + + { + if (selenium.isTextPresent("Ready")) + { + status=0; + break; + } + selenium.click("//div["+j+"]/div/div[2]/span/span"); + } + if(status==0){ + break; + } + else + { + selenium.click("//div[@id='leftmenu_submenu_featured_iso']/div/div[2]"); + Thread.sleep(3000); + selenium.click("//div[@id='leftmenu_submenu_my_iso']/div/div[2]"); + Thread.sleep(3000); + } + + } + selenium.click("link=Delete ISO"); + selenium.click("//div[28]/div[11]/button[1]"); + for (int second = 0;; second++) { + if (second >= 60) fail("timeout"); + try { if (selenium.isVisible("after_action_info_container_on_top")) break; } catch (Exception e) {} + Thread.sleep(1000); + } + + assertTrue(selenium.isTextPresent("Delete ISO action succeeded")); + selenium.click("main_logout"); + selenium.waitForPageToLoad("30000"); + assertTrue(selenium.isTextPresent("Welcome to Management Console")); + + } catch (SeleniumException ex) { + + System.err.println(ex.getMessage()); + fail(ex.getMessage()); + + throw ex; + } + } } \ No newline at end of file diff --git a/test/src/com/cloud/test/ui/AddAndDeleteATemplate.java b/test/src/com/cloud/test/ui/AddAndDeleteATemplate.java index d03b788cf49..7046bdef585 100644 --- a/test/src/com/cloud/test/ui/AddAndDeleteATemplate.java +++ b/test/src/com/cloud/test/ui/AddAndDeleteATemplate.java @@ -10,102 +10,102 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.ui; - -import org.junit.Test; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import com.cloud.test.ui.AbstractSeleniumTestCase; -import com.thoughtworks.selenium.SeleniumException; - -public class AddAndDeleteATemplate extends AbstractSeleniumTestCase { - - @Test - public void testAddAndDeleteTemplate() throws Exception { - try { - selenium.open("/client/"); - selenium.type("account_username", "admin"); - selenium.type("account_password", "password"); - selenium.click("loginbutton"); - Thread.sleep(3000); - assertTrue(selenium.isTextPresent("admin")); - selenium.click("//div[@id='leftmenu_templates']/div"); - selenium.click("//div[@id='leftmenu_submenu_my_template']/div/div[2]"); - Thread.sleep(3000); - selenium.click("label"); - selenium.type("add_template_name", "abc"); - selenium.type("add_template_display_text", "abc"); - String template_url = System.getProperty("add_template_url", "http://10.91.28.6/templates/centos53-x86_64/latest/f59f18fb-ae94-4f97-afd2-f84755767aca.vhd.bz2"); - selenium.type("add_template_url", template_url); - String template_zone = System.getProperty("add_template_zone", "All Zones"); - selenium.select("add_template_zone", "label="+template_zone); - String template_os_type = System.getProperty("add_template_os_type", "CentOS 5.3 (32-bit)"); - selenium.select("add_template_os_type", "label="+template_os_type); - selenium.click("//div[28]/div[11]/button[1]"); - Thread.sleep(3000); - int i=1; - try - { - for(;;i++) - { - System.out.println("i= "+i); - selenium.click("//div[" +i+ "]/div/div[2]/span/span"); - } - } - catch(Exception ex) { - } - - for (int second = 0;; second++) { - if (second >= 60) fail("timeout"); - try { if (selenium.isVisible("//div[@id='after_action_info_container_on_top']")) break; } catch (Exception e) {} - Thread.sleep(10000); - } - - assertTrue(selenium.isTextPresent("Adding succeeded")); - Thread.sleep(3000); - int status=1; - while(!selenium.isTextPresent("Ready")) - { - for(int j =1;j<=i;j++) - - { - if (selenium.isTextPresent("Ready")) - { - status=0; - break; - } - selenium.click("//div["+j+"]/div/div[2]/span/span"); - } - if(status==0){ - break; - } - else - { - selenium.click("//div[@id='leftmenu_submenu_featured_template']/div/div[2]"); - Thread.sleep(3000); - selenium.click("//div[@id='leftmenu_submenu_my_template']/div/div[2]"); - Thread.sleep(3000); - } - - } - selenium.click("link=Delete Template"); - selenium.click("//div[28]/div[11]/button[1]"); - for (int second = 0;; second++) { - if (second >= 60) fail("timeout"); - try { if (selenium.isVisible("after_action_info_container_on_top")) break; } catch (Exception e) {} - Thread.sleep(1000); - } - - assertTrue(selenium.isTextPresent("Delete Template action succeeded")); - selenium.click("main_logout"); - selenium.waitForPageToLoad("30000"); - assertTrue(selenium.isTextPresent("Welcome to Management Console")); - } catch (SeleniumException ex) { - - System.err.println(ex.getMessage()); - fail(ex.getMessage()); - - throw ex; - } - } +package com.cloud.test.ui; + +import org.junit.Test; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import com.cloud.test.ui.AbstractSeleniumTestCase; +import com.thoughtworks.selenium.SeleniumException; + +public class AddAndDeleteATemplate extends AbstractSeleniumTestCase { + + @Test + public void testAddAndDeleteTemplate() throws Exception { + try { + selenium.open("/client/"); + selenium.type("account_username", "admin"); + selenium.type("account_password", "password"); + selenium.click("loginbutton"); + Thread.sleep(3000); + assertTrue(selenium.isTextPresent("admin")); + selenium.click("//div[@id='leftmenu_templates']/div"); + selenium.click("//div[@id='leftmenu_submenu_my_template']/div/div[2]"); + Thread.sleep(3000); + selenium.click("label"); + selenium.type("add_template_name", "abc"); + selenium.type("add_template_display_text", "abc"); + String template_url = System.getProperty("add_template_url", "http://10.91.28.6/templates/centos53-x86_64/latest/f59f18fb-ae94-4f97-afd2-f84755767aca.vhd.bz2"); + selenium.type("add_template_url", template_url); + String template_zone = System.getProperty("add_template_zone", "All Zones"); + selenium.select("add_template_zone", "label="+template_zone); + String template_os_type = System.getProperty("add_template_os_type", "CentOS 5.3 (32-bit)"); + selenium.select("add_template_os_type", "label="+template_os_type); + selenium.click("//div[28]/div[11]/button[1]"); + Thread.sleep(3000); + int i=1; + try + { + for(;;i++) + { + System.out.println("i= "+i); + selenium.click("//div[" +i+ "]/div/div[2]/span/span"); + } + } + catch(Exception ex) { + } + + for (int second = 0;; second++) { + if (second >= 60) fail("timeout"); + try { if (selenium.isVisible("//div[@id='after_action_info_container_on_top']")) break; } catch (Exception e) {} + Thread.sleep(10000); + } + + assertTrue(selenium.isTextPresent("Adding succeeded")); + Thread.sleep(3000); + int status=1; + while(!selenium.isTextPresent("Ready")) + { + for(int j =1;j<=i;j++) + + { + if (selenium.isTextPresent("Ready")) + { + status=0; + break; + } + selenium.click("//div["+j+"]/div/div[2]/span/span"); + } + if(status==0){ + break; + } + else + { + selenium.click("//div[@id='leftmenu_submenu_featured_template']/div/div[2]"); + Thread.sleep(3000); + selenium.click("//div[@id='leftmenu_submenu_my_template']/div/div[2]"); + Thread.sleep(3000); + } + + } + selenium.click("link=Delete Template"); + selenium.click("//div[28]/div[11]/button[1]"); + for (int second = 0;; second++) { + if (second >= 60) fail("timeout"); + try { if (selenium.isVisible("after_action_info_container_on_top")) break; } catch (Exception e) {} + Thread.sleep(1000); + } + + assertTrue(selenium.isTextPresent("Delete Template action succeeded")); + selenium.click("main_logout"); + selenium.waitForPageToLoad("30000"); + assertTrue(selenium.isTextPresent("Welcome to Management Console")); + } catch (SeleniumException ex) { + + System.err.println(ex.getMessage()); + fail(ex.getMessage()); + + throw ex; + } + } } \ No newline at end of file diff --git a/test/src/com/cloud/test/utils/ConsoleProxy.java b/test/src/com/cloud/test/utils/ConsoleProxy.java index 925195edad9..cd4741c67ee 100644 --- a/test/src/com/cloud/test/utils/ConsoleProxy.java +++ b/test/src/com/cloud/test/utils/ConsoleProxy.java @@ -10,101 +10,101 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.utils; - -import java.io.BufferedReader; -import java.io.IOException; - -import org.apache.log4j.Logger; - +package com.cloud.test.utils; + +import java.io.BufferedReader; +import java.io.IOException; + +import org.apache.log4j.Logger; + import com.cloud.utils.script.OutputInterpreter; import com.cloud.utils.script.Script; - -public class ConsoleProxy implements Runnable { - public static String proxyIp; - private String command; - private int connectionsMade; - private long responseTime; - public static final Logger s_logger = Logger.getLogger(ConsoleProxy.class - .getClass()); - - public ConsoleProxy(String port, String sid, String host) { - this.command = "https://" + proxyIp - + ".realhostip.com:8000/getscreen?w=100&h=75&host=" + host - + "&port=" + port + "&sid=" + sid; - s_logger.info("Command for a console proxy is " + this.command); - this.connectionsMade=0; - this.responseTime=0; - } - - public int getConnectionsMade() { - return this.connectionsMade; - } - - public long getResponseTime() { - return this.responseTime; - } - - public void run() { - while (true){ - - Script myScript = new Script("wget"); - myScript.add(command); - myScript.execute(); - long begin = System.currentTimeMillis(); - wgetInt process = new wgetInt(); - String response = myScript.execute(process); - long end = process.getEnd(); - if (response!=null){ - s_logger.info("Content lenght is incorrect: "+response); - } - - long duration = (end - begin); - this.connectionsMade++; - this.responseTime=this.responseTime+duration; - try{ - Thread.sleep(1000); - }catch (InterruptedException e){ - - } - - } - } - - public class wgetInt extends OutputInterpreter { - private long end; - - public long getEnd() { - return end; - } - - public void setEnd(long end) { - this.end = end; - } - - @Override - public String interpret(BufferedReader reader) throws IOException { - // TODO Auto-generated method stub - end = System.currentTimeMillis(); - String status = null; - String line = null; - while ((line = reader.readLine()) != null) { - int index = line.indexOf("Length:"); - if (index == -1) { - continue; - } - else{ - int index1 = line.indexOf("Length: 1827"); - if (index1 == -1) { - return status; - } - else - status=line; - } - - } - return status; - } - - } -} + +public class ConsoleProxy implements Runnable { + public static String proxyIp; + private String command; + private int connectionsMade; + private long responseTime; + public static final Logger s_logger = Logger.getLogger(ConsoleProxy.class + .getClass()); + + public ConsoleProxy(String port, String sid, String host) { + this.command = "https://" + proxyIp + + ".realhostip.com:8000/getscreen?w=100&h=75&host=" + host + + "&port=" + port + "&sid=" + sid; + s_logger.info("Command for a console proxy is " + this.command); + this.connectionsMade=0; + this.responseTime=0; + } + + public int getConnectionsMade() { + return this.connectionsMade; + } + + public long getResponseTime() { + return this.responseTime; + } + + public void run() { + while (true){ + + Script myScript = new Script("wget"); + myScript.add(command); + myScript.execute(); + long begin = System.currentTimeMillis(); + wgetInt process = new wgetInt(); + String response = myScript.execute(process); + long end = process.getEnd(); + if (response!=null){ + s_logger.info("Content lenght is incorrect: "+response); + } + + long duration = (end - begin); + this.connectionsMade++; + this.responseTime=this.responseTime+duration; + try{ + Thread.sleep(1000); + }catch (InterruptedException e){ + + } + + } + } + + public class wgetInt extends OutputInterpreter { + private long end; + + public long getEnd() { + return end; + } + + public void setEnd(long end) { + this.end = end; + } + + @Override + public String interpret(BufferedReader reader) throws IOException { + // TODO Auto-generated method stub + end = System.currentTimeMillis(); + String status = null; + String line = null; + while ((line = reader.readLine()) != null) { + int index = line.indexOf("Length:"); + if (index == -1) { + continue; + } + else{ + int index1 = line.indexOf("Length: 1827"); + if (index1 == -1) { + return status; + } + else + status=line; + } + + } + return status; + } + + } +} diff --git a/test/src/com/cloud/test/utils/IpSqlGenerator.java b/test/src/com/cloud/test/utils/IpSqlGenerator.java index 31f3b311598..1a90c20b6ee 100644 --- a/test/src/com/cloud/test/utils/IpSqlGenerator.java +++ b/test/src/com/cloud/test/utils/IpSqlGenerator.java @@ -10,75 +10,75 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.utils; - -import java.io.DataOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.util.StringTokenizer; - -public class IpSqlGenerator { - public static void main (String[] args) { - try { - if (args.length != 5) { - System.out.println("Usage -- generate-ip.sh "); - System.out.println("Example -- generate-ip.sh public 192.168.1.1 192.168.1.255 1 1"); - System.out.println(" will generate ips ranging from public ips 192.168.1.1 to 192.168.1.255 for dc 1 and pod 1"); - return; - } - - String type = args[0]; - - StringTokenizer st = new StringTokenizer(args[1], "."); - int ipS1 = Integer.parseInt(st.nextToken()); - int ipS2 = Integer.parseInt(st.nextToken()); - int ipS3 = Integer.parseInt(st.nextToken()); - int ipS4 = Integer.parseInt(st.nextToken()); - - st = new StringTokenizer(args[2], "."); - int ipE1 = Integer.parseInt(st.nextToken()); - int ipE2 = Integer.parseInt(st.nextToken()); - int ipE3 = Integer.parseInt(st.nextToken()); - int ipE4 = Integer.parseInt(st.nextToken()); - - String dcId = args[3]; - String podId = args[4]; - - if (type.equals("private")) { - FileOutputStream fs = new FileOutputStream(new File("private-ips.sql")); - DataOutputStream out = new DataOutputStream(fs); - for (int i = ipS1; i <= ipE1; i++) { - for (int j = ipS2; j <= ipE2; j++) { - for (int k = ipS3; k <= ipE3; k++) { - for (int l = ipS4; l <= ipE4; l++) { - out.writeBytes("INSERT INTO `vmops`.`dc_ip_address_alloc` (ip_address, data_center_id, pod_id) VALUES ('" - + i + "." + j + "." + k + "." + l + "'," + dcId + "," + podId + ");\r\n"); - } - } - } - } - out.writeBytes("\r\n"); - out.flush(); - out.close(); - } else { - FileOutputStream fs = new FileOutputStream(new File("public-ips.sql")); - DataOutputStream out = new DataOutputStream(fs); - for (int i = ipS1; i <= ipE1; i++) { - for (int j = ipS2; j <= ipE2; j++) { - for (int k = ipS3; k <= ipE3; k++) { - for (int l = ipS4; l <= ipE4; l++) { - out.writeBytes("INSERT INTO `vmops`.`user_ip_address` (ip_address, data_center_id) VALUES ('" - + i + "." + j + "." + k + "." + l + "'," + dcId + ");\r\n"); - } - } - } - } - out.writeBytes("\r\n"); - out.flush(); - out.close(); - } - } catch (Exception e) { - - } - } -} +package com.cloud.test.utils; + +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.util.StringTokenizer; + +public class IpSqlGenerator { + public static void main (String[] args) { + try { + if (args.length != 5) { + System.out.println("Usage -- generate-ip.sh "); + System.out.println("Example -- generate-ip.sh public 192.168.1.1 192.168.1.255 1 1"); + System.out.println(" will generate ips ranging from public ips 192.168.1.1 to 192.168.1.255 for dc 1 and pod 1"); + return; + } + + String type = args[0]; + + StringTokenizer st = new StringTokenizer(args[1], "."); + int ipS1 = Integer.parseInt(st.nextToken()); + int ipS2 = Integer.parseInt(st.nextToken()); + int ipS3 = Integer.parseInt(st.nextToken()); + int ipS4 = Integer.parseInt(st.nextToken()); + + st = new StringTokenizer(args[2], "."); + int ipE1 = Integer.parseInt(st.nextToken()); + int ipE2 = Integer.parseInt(st.nextToken()); + int ipE3 = Integer.parseInt(st.nextToken()); + int ipE4 = Integer.parseInt(st.nextToken()); + + String dcId = args[3]; + String podId = args[4]; + + if (type.equals("private")) { + FileOutputStream fs = new FileOutputStream(new File("private-ips.sql")); + DataOutputStream out = new DataOutputStream(fs); + for (int i = ipS1; i <= ipE1; i++) { + for (int j = ipS2; j <= ipE2; j++) { + for (int k = ipS3; k <= ipE3; k++) { + for (int l = ipS4; l <= ipE4; l++) { + out.writeBytes("INSERT INTO `vmops`.`dc_ip_address_alloc` (ip_address, data_center_id, pod_id) VALUES ('" + + i + "." + j + "." + k + "." + l + "'," + dcId + "," + podId + ");\r\n"); + } + } + } + } + out.writeBytes("\r\n"); + out.flush(); + out.close(); + } else { + FileOutputStream fs = new FileOutputStream(new File("public-ips.sql")); + DataOutputStream out = new DataOutputStream(fs); + for (int i = ipS1; i <= ipE1; i++) { + for (int j = ipS2; j <= ipE2; j++) { + for (int k = ipS3; k <= ipE3; k++) { + for (int l = ipS4; l <= ipE4; l++) { + out.writeBytes("INSERT INTO `vmops`.`user_ip_address` (ip_address, data_center_id) VALUES ('" + + i + "." + j + "." + k + "." + l + "'," + dcId + ");\r\n"); + } + } + } + } + out.writeBytes("\r\n"); + out.flush(); + out.close(); + } + } catch (Exception e) { + + } + } +} diff --git a/test/src/com/cloud/test/utils/ProxyLoadTemp.java b/test/src/com/cloud/test/utils/ProxyLoadTemp.java index ff166a82de4..da72ed0ab1f 100644 --- a/test/src/com/cloud/test/utils/ProxyLoadTemp.java +++ b/test/src/com/cloud/test/utils/ProxyLoadTemp.java @@ -10,108 +10,108 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.utils; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.util.ArrayList; - -import org.apache.log4j.Logger; - - - - -public class ProxyLoadTemp { - public static final Logger s_logger= Logger.getLogger(ProxyLoadTemp.class.getClass()); - public static int numThreads=0; - public static ArrayList proxyList = new ArrayList(); - public static long begin; - public static long end; - public static long sum=0; - - public ProxyLoadTemp(){ - } - - public static void main (String[] args){ - begin= System.currentTimeMillis(); - Runtime.getRuntime().addShutdownHook(new ShutdownThread(new ProxyLoadTemp())); - ConsoleProxy.proxyIp="172-16-1-101"; - - try - { - BufferedReader consoleInput = new BufferedReader(new FileReader("console.input")); - boolean eof = false; - s_logger.info("Started reading file"); - while (!eof){ - String line = consoleInput.readLine(); - s_logger.info("Line is "+line); - if (line == null){ - s_logger.info("Line "+numThreads+" is null"); - eof=true; - } - else{ - String[] result=null; - try - { - s_logger.info("Starting parsing line "+line); - result= parseLine(line, "[,]"); - s_logger.info("Line retrieved from the file is "+result[0]+" "+result[1]+" "+result[2]); - ConsoleProxy proxy = new ConsoleProxy(result[0], result[1], result[2]); - proxyList.add(proxy); - new Thread(proxy).start(); - numThreads++; - - } - catch (Exception ex){ - s_logger.warn(ex); - } - } - - } - }catch(Exception e){ - s_logger.warn(e); - } - - } - - public static class ShutdownThread extends Thread { - ProxyLoadTemp temp; - public ShutdownThread(ProxyLoadTemp temp) { - this.temp = temp; - } - public void run() { - s_logger.info("Program was running in "+numThreads+" threads"); - - for (int j=0; j proxyList = new ArrayList(); + public static long begin; + public static long end; + public static long sum=0; + + public ProxyLoadTemp(){ + } + + public static void main (String[] args){ + begin= System.currentTimeMillis(); + Runtime.getRuntime().addShutdownHook(new ShutdownThread(new ProxyLoadTemp())); + ConsoleProxy.proxyIp="172-16-1-101"; + + try + { + BufferedReader consoleInput = new BufferedReader(new FileReader("console.input")); + boolean eof = false; + s_logger.info("Started reading file"); + while (!eof){ + String line = consoleInput.readLine(); + s_logger.info("Line is "+line); + if (line == null){ + s_logger.info("Line "+numThreads+" is null"); + eof=true; + } + else{ + String[] result=null; + try + { + s_logger.info("Starting parsing line "+line); + result= parseLine(line, "[,]"); + s_logger.info("Line retrieved from the file is "+result[0]+" "+result[1]+" "+result[2]); + ConsoleProxy proxy = new ConsoleProxy(result[0], result[1], result[2]); + proxyList.add(proxy); + new Thread(proxy).start(); + numThreads++; + + } + catch (Exception ex){ + s_logger.warn(ex); + } + } + + } + }catch(Exception e){ + s_logger.warn(e); + } + + } + + public static class ShutdownThread extends Thread { + ProxyLoadTemp temp; + public ShutdownThread(ProxyLoadTemp temp) { + this.temp = temp; + } + public void run() { + s_logger.info("Program was running in "+numThreads+" threads"); + + for (int j=0; j argsList = Arrays.asList(args); - Iterator iter = argsList.iterator(); - while (iter.hasNext()) { - String arg = iter.next(); - if (arg.equals("-a")) { - apikey = iter.next(); - - } - if (arg.equals("-u")) { - url = iter.next(); - } - - if (arg.equals("-s")) { - secretkey = iter.next(); - } - } - - - if (url == null) { - System.out.println("Please specify url with -u option. Example: -u \"command=listZones&id=1\""); - System.exit(1); - } - - if (apikey == null) { - System.out.println("Please specify apikey with -a option"); - System.exit(1); - } - - if (secretkey == null) { - System.out.println("Please specify secretkey with -s option"); - System.exit(1); - } - - TreeMap param = new TreeMap(); - - String temp = ""; - param.put("apikey", apikey); - - StringTokenizer str1 = new StringTokenizer (url, "&"); - while(str1.hasMoreTokens()) { - String newEl = str1.nextToken(); - StringTokenizer str2 = new StringTokenizer(newEl, "="); - String name = str2.nextToken(); - String value= str2.nextToken(); - param.put(name, value); - } - - //sort url hash map by key - Set c = param.entrySet(); - Iterator it = c.iterator(); - while (it.hasNext()) { - Map.Entry me = (Map.Entry)it.next(); - String key = (String) me.getKey(); - String value = (String) me.getValue(); - try { - temp = temp + key + "=" + URLEncoder.encode(value, "UTF-8") + "&"; - } catch (Exception ex) { - System.out.println("Unable to set parameter " + value + " for the command " + param.get("command")); - } - - } - temp = temp.substring(0, temp.length()-1 ); - String requestToSign = temp.toLowerCase(); - System.out.println("After sorting: " + requestToSign); - String signature = UtilsForTest.signRequest(requestToSign, secretkey); - System.out.println("After Base64 encoding: " + signature); - String encodedSignature = ""; - try { - encodedSignature = URLEncoder.encode(signature, "UTF-8"); - } catch (Exception ex) { - System.out.println(ex); + +public class SignRequest { + public static String url; + public static String apikey; + public static String secretkey; + public static String command; + + + public static void main (String[] args) { + // Parameters + List argsList = Arrays.asList(args); + Iterator iter = argsList.iterator(); + while (iter.hasNext()) { + String arg = iter.next(); + if (arg.equals("-a")) { + apikey = iter.next(); + + } + if (arg.equals("-u")) { + url = iter.next(); + } + + if (arg.equals("-s")) { + secretkey = iter.next(); + } } - System.out.println("After UTF8 encoding: " + encodedSignature); + + + if (url == null) { + System.out.println("Please specify url with -u option. Example: -u \"command=listZones&id=1\""); + System.exit(1); + } + + if (apikey == null) { + System.out.println("Please specify apikey with -a option"); + System.exit(1); + } + + if (secretkey == null) { + System.out.println("Please specify secretkey with -s option"); + System.exit(1); + } + + TreeMap param = new TreeMap(); + + String temp = ""; + param.put("apikey", apikey); + + StringTokenizer str1 = new StringTokenizer (url, "&"); + while(str1.hasMoreTokens()) { + String newEl = str1.nextToken(); + StringTokenizer str2 = new StringTokenizer(newEl, "="); + String name = str2.nextToken(); + String value= str2.nextToken(); + param.put(name, value); + } + + //sort url hash map by key + Set c = param.entrySet(); + Iterator it = c.iterator(); + while (it.hasNext()) { + Map.Entry me = (Map.Entry)it.next(); + String key = (String) me.getKey(); + String value = (String) me.getValue(); + try { + temp = temp + key + "=" + URLEncoder.encode(value, "UTF-8") + "&"; + } catch (Exception ex) { + System.out.println("Unable to set parameter " + value + " for the command " + param.get("command")); + } + + } + temp = temp.substring(0, temp.length()-1 ); + String requestToSign = temp.toLowerCase(); + System.out.println("After sorting: " + requestToSign); + String signature = UtilsForTest.signRequest(requestToSign, secretkey); + System.out.println("After Base64 encoding: " + signature); + String encodedSignature = ""; + try { + encodedSignature = URLEncoder.encode(signature, "UTF-8"); + } catch (Exception ex) { + System.out.println(ex); + } + System.out.println("After UTF8 encoding: " + encodedSignature); String url = temp + "&signature=" + encodedSignature; - System.out.println("After sort and add signature: " + url); - - } -} + System.out.println("After sort and add signature: " + url); + + } +} diff --git a/test/src/com/cloud/test/utils/SqlDataGenerator.java b/test/src/com/cloud/test/utils/SqlDataGenerator.java index efa9b58fccb..5060cd8dc09 100644 --- a/test/src/com/cloud/test/utils/SqlDataGenerator.java +++ b/test/src/com/cloud/test/utils/SqlDataGenerator.java @@ -10,35 +10,35 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.utils; - -import java.io.DataOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.util.Formatter; - -public class SqlDataGenerator { - public static void main (String[] args) { - try { - FileOutputStream fs = new FileOutputStream(new File("out.txt")); - - DataOutputStream out = new DataOutputStream(fs); - - for (int i = 20; i < 171; i++) { - out.writeBytes("INSERT INTO `vmops`.`dc_ip_address_alloc` (ip_address, data_center_id, pod_id) VALUES ('192.168.2."+i+"',1,1);\r\n"); - } - out.writeBytes("\r\n"); - for (int i = 1; i < 10000; i++) { - StringBuilder imagePath = new StringBuilder(); - Formatter formatter = new Formatter(imagePath); - formatter.format("%04x", i); - out.writeBytes("INSERT INTO `vmops`.`dc_vnet_alloc` (vnet, data_center_id) VALUES ('"+imagePath.toString()+"',1);\r\n"); - } - - out.flush(); - out.close(); - } catch (Exception e) { - - } - } -} +package com.cloud.test.utils; + +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.util.Formatter; + +public class SqlDataGenerator { + public static void main (String[] args) { + try { + FileOutputStream fs = new FileOutputStream(new File("out.txt")); + + DataOutputStream out = new DataOutputStream(fs); + + for (int i = 20; i < 171; i++) { + out.writeBytes("INSERT INTO `vmops`.`dc_ip_address_alloc` (ip_address, data_center_id, pod_id) VALUES ('192.168.2."+i+"',1,1);\r\n"); + } + out.writeBytes("\r\n"); + for (int i = 1; i < 10000; i++) { + StringBuilder imagePath = new StringBuilder(); + Formatter formatter = new Formatter(imagePath); + formatter.format("%04x", i); + out.writeBytes("INSERT INTO `vmops`.`dc_vnet_alloc` (vnet, data_center_id) VALUES ('"+imagePath.toString()+"',1);\r\n"); + } + + out.flush(); + out.close(); + } catch (Exception e) { + + } + } +} diff --git a/test/src/com/cloud/test/utils/TestClient.java b/test/src/com/cloud/test/utils/TestClient.java index 2086510573a..f2ce4ef1ec8 100644 --- a/test/src/com/cloud/test/utils/TestClient.java +++ b/test/src/com/cloud/test/utils/TestClient.java @@ -10,368 +10,368 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.utils; - -import java.io.InputStream; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpMethod; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.log4j.Logger; -import org.apache.log4j.NDC; - -import com.trilead.ssh2.ChannelCondition; -import com.trilead.ssh2.Connection; -import com.trilead.ssh2.SCPClient; -import com.trilead.ssh2.Session; - -public class TestClient { - private static long sleepTime = 180000L; // default 0 - private static boolean cleanUp = true; - public static final Logger s_logger = Logger.getLogger(TestClient.class.getName()); - private static boolean repeat = true; - private static int numOfUsers = 0; - private static String[] users = null; - private static boolean internet = true; - - private static final int MAX_RETRY_LINUX = 5; - private static final int MAX_RETRY_WIN = 10; - - public static void main (String[] args) { - String host = "http://localhost"; - String port = "8080"; - String testUrl = "/client/test"; - int numThreads = 1; - - try { - // Parameters - List argsList = Arrays.asList(args); - Iterator iter = argsList.iterator(); - while (iter.hasNext()) { - String arg = iter.next(); - // host - if (arg.equals("-h")) { - host = "http://" + iter.next(); - } - - if (arg.equals("-p")) { - port = iter.next(); - } - - if (arg.equals("-t")) { - numThreads = Integer.parseInt(iter.next()); - } - - if (arg.equals("-s")) { - sleepTime = Long.parseLong(iter.next()); - } - - if (arg.equals("-c")) { - cleanUp = Boolean.parseBoolean(iter.next()); - if (!cleanUp) sleepTime = 0L; // no need to wait if we don't ever cleanup - } - - if (arg.equals("-r")) { - repeat = Boolean.parseBoolean(iter.next()); - } - - if (arg.equals("-u")) { - numOfUsers = Integer.parseInt(iter.next()); - } - - if (arg.equals("-i")) { - internet = Boolean.parseBoolean(iter.next()); - } - } - - final String server = host+":"+port+testUrl; - s_logger.info("Starting test against server: " + server + " with " + numThreads + " thread(s)"); - if (cleanUp) s_logger.info("Clean up is enabled, each test will wait " + sleepTime + " ms before cleaning up"); - - if (numOfUsers > 0) { - s_logger.info("Pre-generating users for test of size : " + numOfUsers); - users = new String[numOfUsers]; - Random ran = new Random(); - for (int i = 0; i < numOfUsers; i++) { - users[i] = Math.abs(ran.nextInt()) + "-user"; - } - } - - for (int i = 0; i < numThreads; i++) { - new Thread(new Runnable() { - public void run() { - do { - String username = null; - try { - long now = System.currentTimeMillis(); - Random ran = new Random(); - if (users != null) { - username = users[Math.abs(ran.nextInt()) % numOfUsers]; - } else { - username = Math.abs(ran.nextInt())+"-user"; - } - NDC.push(username); - - String url = server+"?email="+username+"&password="+username+"&command=deploy"; - s_logger.info("Launching test for user: " + username + " with url: " + url); - HttpClient client = new HttpClient(); - HttpMethod method = new GetMethod(url); - int responseCode = client.executeMethod(method); - boolean success = false; - String reason = null; - if (responseCode == 200) { - if (internet) { - s_logger.info("Deploy successful...waiting 5 minute before SSH tests"); - Thread.sleep(300000L); // Wait 60 seconds so the linux VM can boot up. - - s_logger.info("Begin Linux SSH test"); - reason = sshTest(method.getResponseHeader("linuxIP").getValue()); - - if (reason == null) { - s_logger.info("Linux SSH test successful"); - s_logger.info("Begin Windows SSH test"); - reason = sshWinTest(method.getResponseHeader("windowsIP").getValue()); - } - } - if (reason == null) { - if (internet) { - s_logger.info("Windows SSH test successful"); - } else { - s_logger.info("deploy test successful....now cleaning up"); - if (cleanUp) { - s_logger.info("Waiting " + sleepTime + " ms before cleaning up vms"); - Thread.sleep(sleepTime); - } else { - success = true; - } - } - if (users == null) { - s_logger.info("Sending cleanup command"); - url = server+"?email="+username+"&password="+username+"&command=cleanup"; - } else { - s_logger.info("Sending stop DomR / destroy VM command"); - url = server+"?email="+username+"&password="+username+"&command=stopDomR"; - } - method = new GetMethod(url); - responseCode = client.executeMethod(method); - if (responseCode == 200) { - success = true; - } else { - reason = method.getStatusText(); - } - } else { - // Just stop but don't destroy the VMs/Routers - s_logger.info("SSH test failed with reason '" + reason + "', stopping VMs"); - url = server+"?email="+username+"&password="+username+"&command=stop"; - responseCode = client.executeMethod(new GetMethod(url)); - } - } else { - // Just stop but don't destroy the VMs/Routers - reason = method.getStatusText(); - s_logger.info("Deploy test failed with reason '" + reason + "', stopping VMs"); - url = server+"?email="+username+"&password="+username+"&command=stop"; - client.executeMethod(new GetMethod(url)); - } - - if (success) { - s_logger.info("***** Completed test for user : " + username + " in " + ((System.currentTimeMillis() - now) / 1000L) + " seconds"); - } else { - s_logger.info("##### FAILED test for user : " + username + " in " + ((System.currentTimeMillis() - now) / 1000L) + " seconds with reason : " + reason); - } - } catch (Exception e) { - s_logger.warn("Error in thread", e); - try { - HttpClient client = new HttpClient(); - String url = server+"?email="+username+"&password="+username+"&command=stop"; - client.executeMethod(new GetMethod(url)); - } catch (Exception e1) { - } - } finally { - NDC.clear(); - } - } while (repeat); - } - }).start(); - } - } catch (Exception e) { - s_logger.error(e); - } - } - - private static String sshWinTest(String host) { - if (host == null) { - s_logger.info("Did not receive a host back from test, ignoring win ssh test"); - return null; - } - - // We will retry 5 times before quitting - int retry = 0; - - while (true) { - try { - if (retry > 0) { - s_logger.info("Retry attempt : " + retry + " ...sleeping 300 seconds before next attempt"); - Thread.sleep(300000); - } - - s_logger.info("Attempting to SSH into windows host " + host + " with retry attempt: " + retry); - - Connection conn = new Connection(host); - conn.connect(null, 60000, 60000); - - s_logger.info("SSHed successfully into windows host " + host); - boolean success = false; - boolean isAuthenticated = conn.authenticateWithPassword("vmops", "vmops"); - if (isAuthenticated == false) { - return "Authentication failed"; - } - SCPClient scp = new SCPClient(conn); - - scp.put("wget.exe", ""); - - Session sess = conn.openSession(); - s_logger.info("Executing : wget http://172.16.0.220/dump.bin"); - sess.execCommand("wget http://172.16.0.220/dump.bin && dir dump.bin"); - - InputStream stdout = sess.getStdout(); - InputStream stderr = sess.getStderr(); - - byte[] buffer = new byte[8192]; - while (true) { - if ((stdout.available() == 0) && (stderr.available() == 0)) { - int conditions = sess.waitForCondition(ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA - | ChannelCondition.EOF, 120000); - - if ((conditions & ChannelCondition.TIMEOUT) != 0) { - s_logger.info("Timeout while waiting for data from peer."); - return null; - } - - if ((conditions & ChannelCondition.EOF) != 0) { - if ((conditions & (ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA)) == 0) { - break; - } - } - } - - while (stdout.available() > 0) { - success = true; - int len = stdout.read(buffer); - if (len > 0) // this check is somewhat paranoid - s_logger.info(new String(buffer, 0, len)); - } - - while (stderr.available() > 0) { - int len = stderr.read(buffer); - } - } - sess.close(); - conn.close(); - - if (success) { - return null; - } else { - retry++; - if (retry == MAX_RETRY_WIN) { - return "SSH Windows Network test fail"; - } - } - } catch (Exception e) { - retry++; - if (retry == MAX_RETRY_WIN) { - return "SSH Windows Network test fail with error " + e.getMessage(); - } - } - } - } - - private static String sshTest(String host) { - if (host == null) { - s_logger.info("Did not receive a host back from test, ignoring ssh test"); - return null; - } - - // We will retry 5 times before quitting - int retry = 0; - - while (true) { - try { - if (retry > 0) { - s_logger.info("Retry attempt : " + retry + " ...sleeping 120 seconds before next attempt"); - Thread.sleep(120000); - } - - s_logger.info("Attempting to SSH into linux host " + host + " with retry attempt: " + retry); - - Connection conn = new Connection(host); - conn.connect(null, 60000, 60000); - - s_logger.info("SSHed successfully into linux host " + host); - - boolean isAuthenticated = conn.authenticateWithPassword("root", "password"); - - if (isAuthenticated == false) { - return "Authentication failed"; - } - boolean success = false; - Session sess = conn.openSession(); - s_logger.info("Executing : wget http://172.16.0.220/dump.bin"); - sess.execCommand("wget http://172.16.0.220/dump.bin && ls -al dump.bin"); - - InputStream stdout = sess.getStdout(); - InputStream stderr = sess.getStderr(); - - byte[] buffer = new byte[8192]; - while (true) { - if ((stdout.available() == 0) && (stderr.available() == 0)) { - int conditions = sess.waitForCondition(ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA - | ChannelCondition.EOF, 120000); - - if ((conditions & ChannelCondition.TIMEOUT) != 0) { - s_logger.info("Timeout while waiting for data from peer."); - return null; - } - - if ((conditions & ChannelCondition.EOF) != 0) { - if ((conditions & (ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA)) == 0) { - break; - } - } - } - - while (stdout.available() > 0) { - success = true; - int len = stdout.read(buffer); - if (len > 0) // this check is somewhat paranoid - s_logger.info(new String(buffer, 0, len)); - } - - while (stderr.available() > 0) { - int len = stderr.read(buffer); - } - } - - sess.close(); - conn.close(); - - if (success) { - return null; - } else { - retry++; - if (retry == MAX_RETRY_LINUX) { - return "SSH Linux Network test fail"; - } - } - } catch (Exception e) { - retry++; - if (retry == MAX_RETRY_LINUX) { - return "SSH Linux Network test fail with error " + e.getMessage(); - } - } - } - } -} +package com.cloud.test.utils; + +import java.io.InputStream; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.HttpMethod; +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.log4j.Logger; +import org.apache.log4j.NDC; + +import com.trilead.ssh2.ChannelCondition; +import com.trilead.ssh2.Connection; +import com.trilead.ssh2.SCPClient; +import com.trilead.ssh2.Session; + +public class TestClient { + private static long sleepTime = 180000L; // default 0 + private static boolean cleanUp = true; + public static final Logger s_logger = Logger.getLogger(TestClient.class.getName()); + private static boolean repeat = true; + private static int numOfUsers = 0; + private static String[] users = null; + private static boolean internet = true; + + private static final int MAX_RETRY_LINUX = 5; + private static final int MAX_RETRY_WIN = 10; + + public static void main (String[] args) { + String host = "http://localhost"; + String port = "8080"; + String testUrl = "/client/test"; + int numThreads = 1; + + try { + // Parameters + List argsList = Arrays.asList(args); + Iterator iter = argsList.iterator(); + while (iter.hasNext()) { + String arg = iter.next(); + // host + if (arg.equals("-h")) { + host = "http://" + iter.next(); + } + + if (arg.equals("-p")) { + port = iter.next(); + } + + if (arg.equals("-t")) { + numThreads = Integer.parseInt(iter.next()); + } + + if (arg.equals("-s")) { + sleepTime = Long.parseLong(iter.next()); + } + + if (arg.equals("-c")) { + cleanUp = Boolean.parseBoolean(iter.next()); + if (!cleanUp) sleepTime = 0L; // no need to wait if we don't ever cleanup + } + + if (arg.equals("-r")) { + repeat = Boolean.parseBoolean(iter.next()); + } + + if (arg.equals("-u")) { + numOfUsers = Integer.parseInt(iter.next()); + } + + if (arg.equals("-i")) { + internet = Boolean.parseBoolean(iter.next()); + } + } + + final String server = host+":"+port+testUrl; + s_logger.info("Starting test against server: " + server + " with " + numThreads + " thread(s)"); + if (cleanUp) s_logger.info("Clean up is enabled, each test will wait " + sleepTime + " ms before cleaning up"); + + if (numOfUsers > 0) { + s_logger.info("Pre-generating users for test of size : " + numOfUsers); + users = new String[numOfUsers]; + Random ran = new Random(); + for (int i = 0; i < numOfUsers; i++) { + users[i] = Math.abs(ran.nextInt()) + "-user"; + } + } + + for (int i = 0; i < numThreads; i++) { + new Thread(new Runnable() { + public void run() { + do { + String username = null; + try { + long now = System.currentTimeMillis(); + Random ran = new Random(); + if (users != null) { + username = users[Math.abs(ran.nextInt()) % numOfUsers]; + } else { + username = Math.abs(ran.nextInt())+"-user"; + } + NDC.push(username); + + String url = server+"?email="+username+"&password="+username+"&command=deploy"; + s_logger.info("Launching test for user: " + username + " with url: " + url); + HttpClient client = new HttpClient(); + HttpMethod method = new GetMethod(url); + int responseCode = client.executeMethod(method); + boolean success = false; + String reason = null; + if (responseCode == 200) { + if (internet) { + s_logger.info("Deploy successful...waiting 5 minute before SSH tests"); + Thread.sleep(300000L); // Wait 60 seconds so the linux VM can boot up. + + s_logger.info("Begin Linux SSH test"); + reason = sshTest(method.getResponseHeader("linuxIP").getValue()); + + if (reason == null) { + s_logger.info("Linux SSH test successful"); + s_logger.info("Begin Windows SSH test"); + reason = sshWinTest(method.getResponseHeader("windowsIP").getValue()); + } + } + if (reason == null) { + if (internet) { + s_logger.info("Windows SSH test successful"); + } else { + s_logger.info("deploy test successful....now cleaning up"); + if (cleanUp) { + s_logger.info("Waiting " + sleepTime + " ms before cleaning up vms"); + Thread.sleep(sleepTime); + } else { + success = true; + } + } + if (users == null) { + s_logger.info("Sending cleanup command"); + url = server+"?email="+username+"&password="+username+"&command=cleanup"; + } else { + s_logger.info("Sending stop DomR / destroy VM command"); + url = server+"?email="+username+"&password="+username+"&command=stopDomR"; + } + method = new GetMethod(url); + responseCode = client.executeMethod(method); + if (responseCode == 200) { + success = true; + } else { + reason = method.getStatusText(); + } + } else { + // Just stop but don't destroy the VMs/Routers + s_logger.info("SSH test failed with reason '" + reason + "', stopping VMs"); + url = server+"?email="+username+"&password="+username+"&command=stop"; + responseCode = client.executeMethod(new GetMethod(url)); + } + } else { + // Just stop but don't destroy the VMs/Routers + reason = method.getStatusText(); + s_logger.info("Deploy test failed with reason '" + reason + "', stopping VMs"); + url = server+"?email="+username+"&password="+username+"&command=stop"; + client.executeMethod(new GetMethod(url)); + } + + if (success) { + s_logger.info("***** Completed test for user : " + username + " in " + ((System.currentTimeMillis() - now) / 1000L) + " seconds"); + } else { + s_logger.info("##### FAILED test for user : " + username + " in " + ((System.currentTimeMillis() - now) / 1000L) + " seconds with reason : " + reason); + } + } catch (Exception e) { + s_logger.warn("Error in thread", e); + try { + HttpClient client = new HttpClient(); + String url = server+"?email="+username+"&password="+username+"&command=stop"; + client.executeMethod(new GetMethod(url)); + } catch (Exception e1) { + } + } finally { + NDC.clear(); + } + } while (repeat); + } + }).start(); + } + } catch (Exception e) { + s_logger.error(e); + } + } + + private static String sshWinTest(String host) { + if (host == null) { + s_logger.info("Did not receive a host back from test, ignoring win ssh test"); + return null; + } + + // We will retry 5 times before quitting + int retry = 0; + + while (true) { + try { + if (retry > 0) { + s_logger.info("Retry attempt : " + retry + " ...sleeping 300 seconds before next attempt"); + Thread.sleep(300000); + } + + s_logger.info("Attempting to SSH into windows host " + host + " with retry attempt: " + retry); + + Connection conn = new Connection(host); + conn.connect(null, 60000, 60000); + + s_logger.info("SSHed successfully into windows host " + host); + boolean success = false; + boolean isAuthenticated = conn.authenticateWithPassword("vmops", "vmops"); + if (isAuthenticated == false) { + return "Authentication failed"; + } + SCPClient scp = new SCPClient(conn); + + scp.put("wget.exe", ""); + + Session sess = conn.openSession(); + s_logger.info("Executing : wget http://172.16.0.220/dump.bin"); + sess.execCommand("wget http://172.16.0.220/dump.bin && dir dump.bin"); + + InputStream stdout = sess.getStdout(); + InputStream stderr = sess.getStderr(); + + byte[] buffer = new byte[8192]; + while (true) { + if ((stdout.available() == 0) && (stderr.available() == 0)) { + int conditions = sess.waitForCondition(ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA + | ChannelCondition.EOF, 120000); + + if ((conditions & ChannelCondition.TIMEOUT) != 0) { + s_logger.info("Timeout while waiting for data from peer."); + return null; + } + + if ((conditions & ChannelCondition.EOF) != 0) { + if ((conditions & (ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA)) == 0) { + break; + } + } + } + + while (stdout.available() > 0) { + success = true; + int len = stdout.read(buffer); + if (len > 0) // this check is somewhat paranoid + s_logger.info(new String(buffer, 0, len)); + } + + while (stderr.available() > 0) { + int len = stderr.read(buffer); + } + } + sess.close(); + conn.close(); + + if (success) { + return null; + } else { + retry++; + if (retry == MAX_RETRY_WIN) { + return "SSH Windows Network test fail"; + } + } + } catch (Exception e) { + retry++; + if (retry == MAX_RETRY_WIN) { + return "SSH Windows Network test fail with error " + e.getMessage(); + } + } + } + } + + private static String sshTest(String host) { + if (host == null) { + s_logger.info("Did not receive a host back from test, ignoring ssh test"); + return null; + } + + // We will retry 5 times before quitting + int retry = 0; + + while (true) { + try { + if (retry > 0) { + s_logger.info("Retry attempt : " + retry + " ...sleeping 120 seconds before next attempt"); + Thread.sleep(120000); + } + + s_logger.info("Attempting to SSH into linux host " + host + " with retry attempt: " + retry); + + Connection conn = new Connection(host); + conn.connect(null, 60000, 60000); + + s_logger.info("SSHed successfully into linux host " + host); + + boolean isAuthenticated = conn.authenticateWithPassword("root", "password"); + + if (isAuthenticated == false) { + return "Authentication failed"; + } + boolean success = false; + Session sess = conn.openSession(); + s_logger.info("Executing : wget http://172.16.0.220/dump.bin"); + sess.execCommand("wget http://172.16.0.220/dump.bin && ls -al dump.bin"); + + InputStream stdout = sess.getStdout(); + InputStream stderr = sess.getStderr(); + + byte[] buffer = new byte[8192]; + while (true) { + if ((stdout.available() == 0) && (stderr.available() == 0)) { + int conditions = sess.waitForCondition(ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA + | ChannelCondition.EOF, 120000); + + if ((conditions & ChannelCondition.TIMEOUT) != 0) { + s_logger.info("Timeout while waiting for data from peer."); + return null; + } + + if ((conditions & ChannelCondition.EOF) != 0) { + if ((conditions & (ChannelCondition.STDOUT_DATA | ChannelCondition.STDERR_DATA)) == 0) { + break; + } + } + } + + while (stdout.available() > 0) { + success = true; + int len = stdout.read(buffer); + if (len > 0) // this check is somewhat paranoid + s_logger.info(new String(buffer, 0, len)); + } + + while (stderr.available() > 0) { + int len = stderr.read(buffer); + } + } + + sess.close(); + conn.close(); + + if (success) { + return null; + } else { + retry++; + if (retry == MAX_RETRY_LINUX) { + return "SSH Linux Network test fail"; + } + } + } catch (Exception e) { + retry++; + if (retry == MAX_RETRY_LINUX) { + return "SSH Linux Network test fail with error " + e.getMessage(); + } + } + } + } +} diff --git a/test/src/com/cloud/test/utils/UtilsForTest.java b/test/src/com/cloud/test/utils/UtilsForTest.java index 4c09b118fc0..a53a1949d72 100644 --- a/test/src/com/cloud/test/utils/UtilsForTest.java +++ b/test/src/com/cloud/test/utils/UtilsForTest.java @@ -10,8 +10,8 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.test.utils; - +package com.cloud.test.utils; + import java.io.InputStream; import java.math.BigInteger; import java.security.MessageDigest; @@ -33,201 +33,201 @@ import org.w3c.dom.NodeList; import com.cloud.utils.encoding.Base64; import com.cloud.utils.exception.CloudRuntimeException; - -public class UtilsForTest { - - private static DocumentBuilderFactory factory = DocumentBuilderFactory - .newInstance(); - - public static boolean verifyTags (Map params) { - boolean result = true; - for (String value : params.keySet()) { - if (params.get(value) == null) { - result=false; - } - } - return result; - } - - public static boolean verifyTagValues (Map params, Map pattern) { - boolean result = true; - - if (pattern != null) { - for (String value : pattern.keySet()) { - if (!pattern.get(value).equals(params.get(value))) { - result=false; - System.out.println("Tag " + value + " has " + params.get(value) + " while expected value is: " + pattern.get(value)); - } - } - } - return result; - } - - - public static Map parseXML(InputStream is, - String[] tagNames) { - Map returnValues = new HashMap(); - try { - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - Document doc = docBuilder.parse(is); - Element rootElement = doc.getDocumentElement(); - - for (int i = 0; i < tagNames.length; i++) { - NodeList targetNodes = rootElement - .getElementsByTagName(tagNames[i]); - if (targetNodes.getLength() <= 0) { - System.out.println("no " + tagNames[i] - + " tag in the response"); - returnValues.put(tagNames[i], null); - } else { - returnValues.put(tagNames[i], targetNodes.item(0) - .getTextContent()); - } - } - } catch (Exception ex) { + +public class UtilsForTest { + + private static DocumentBuilderFactory factory = DocumentBuilderFactory + .newInstance(); + + public static boolean verifyTags (Map params) { + boolean result = true; + for (String value : params.keySet()) { + if (params.get(value) == null) { + result=false; + } + } + return result; + } + + public static boolean verifyTagValues (Map params, Map pattern) { + boolean result = true; + + if (pattern != null) { + for (String value : pattern.keySet()) { + if (!pattern.get(value).equals(params.get(value))) { + result=false; + System.out.println("Tag " + value + " has " + params.get(value) + " while expected value is: " + pattern.get(value)); + } + } + } + return result; + } + + + public static Map parseXML(InputStream is, + String[] tagNames) { + Map returnValues = new HashMap(); + try { + DocumentBuilder docBuilder = factory.newDocumentBuilder(); + Document doc = docBuilder.parse(is); + Element rootElement = doc.getDocumentElement(); + + for (int i = 0; i < tagNames.length; i++) { + NodeList targetNodes = rootElement + .getElementsByTagName(tagNames[i]); + if (targetNodes.getLength() <= 0) { + System.out.println("no " + tagNames[i] + + " tag in the response"); + returnValues.put(tagNames[i], null); + } else { + returnValues.put(tagNames[i], targetNodes.item(0) + .getTextContent()); + } + } + } catch (Exception ex) { System.out.println("error processing XML"); - ex.printStackTrace(); - } - return returnValues; - } - - - public static ArrayList> parseMulXML (InputStream is, String[] tagNames){ - ArrayList> returnValues = new ArrayList>(); - - try { - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - Document doc = docBuilder.parse(is); - Element rootElement = doc.getDocumentElement(); - for (int i = 0; i < tagNames.length; i++) { - NodeList targetNodes = rootElement - .getElementsByTagName(tagNames[i]); - if (targetNodes.getLength() <= 0) { - System.out.println("no " + tagNames[i] - + " tag in XML response...returning null"); - } else { - for (int j = 0; j < targetNodes.getLength(); j++) { - HashMap valueList = new HashMap (); - Node node = targetNodes.item(j); - //parse child nodes - NodeList child = node.getChildNodes(); - for (int c=0; c getSingleValueFromXML(InputStream is, - String[] tagNames) { - Map returnValues = new HashMap(); - try { - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - Document doc = docBuilder.parse(is); - Element rootElement = doc.getDocumentElement(); - - for (int i = 0; i < tagNames.length; i++) { - NodeList targetNodes = rootElement - .getElementsByTagName(tagNames[i]); - if (targetNodes.getLength() <= 0) { - System.out.println("no " + tagNames[i] - + " tag in XML response...returning null"); - } else { - returnValues.put(tagNames[i], targetNodes.item(0) - .getTextContent()); - } - } - } catch (Exception ex) { + ex.printStackTrace(); + } + return returnValues; + } + + + public static ArrayList> parseMulXML (InputStream is, String[] tagNames){ + ArrayList> returnValues = new ArrayList>(); + + try { + DocumentBuilder docBuilder = factory.newDocumentBuilder(); + Document doc = docBuilder.parse(is); + Element rootElement = doc.getDocumentElement(); + for (int i = 0; i < tagNames.length; i++) { + NodeList targetNodes = rootElement + .getElementsByTagName(tagNames[i]); + if (targetNodes.getLength() <= 0) { + System.out.println("no " + tagNames[i] + + " tag in XML response...returning null"); + } else { + for (int j = 0; j < targetNodes.getLength(); j++) { + HashMap valueList = new HashMap (); + Node node = targetNodes.item(j); + //parse child nodes + NodeList child = node.getChildNodes(); + for (int c=0; c getSingleValueFromXML(InputStream is, + String[] tagNames) { + Map returnValues = new HashMap(); + try { + DocumentBuilder docBuilder = factory.newDocumentBuilder(); + Document doc = docBuilder.parse(is); + Element rootElement = doc.getDocumentElement(); + + for (int i = 0; i < tagNames.length; i++) { + NodeList targetNodes = rootElement + .getElementsByTagName(tagNames[i]); + if (targetNodes.getLength() <= 0) { + System.out.println("no " + tagNames[i] + + " tag in XML response...returning null"); + } else { + returnValues.put(tagNames[i], targetNodes.item(0) + .getTextContent()); + } + } + } catch (Exception ex) { System.out.println("error processing XML"); - ex.printStackTrace(); - } - return returnValues; - } - - - public static Map> getMultipleValuesFromXML( - InputStream is, String[] tagNames) { - Map> returnValues = new HashMap>(); - try { - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - Document doc = docBuilder.parse(is); - Element rootElement = doc.getDocumentElement(); - for (int i = 0; i < tagNames.length; i++) { - NodeList targetNodes = rootElement - .getElementsByTagName(tagNames[i]); - if (targetNodes.getLength() <= 0) { - System.out.println("no " + tagNames[i] - + " tag in XML response...returning null"); - } else { - List valueList = new ArrayList(); - for (int j = 0; j < targetNodes.getLength(); j++) { - Node node = targetNodes.item(j); - valueList.add(node.getTextContent()); - } - returnValues.put(tagNames[i], valueList); - } - } - } catch (Exception ex) { - System.out.println(ex); - } - return returnValues; - } - - - - public static String signRequest(String request, String key) { - try { - Mac mac = Mac.getInstance("HmacSHA1"); - SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), - "HmacSHA1"); - mac.init(keySpec); - mac.update(request.getBytes()); + ex.printStackTrace(); + } + return returnValues; + } + + + public static Map> getMultipleValuesFromXML( + InputStream is, String[] tagNames) { + Map> returnValues = new HashMap>(); + try { + DocumentBuilder docBuilder = factory.newDocumentBuilder(); + Document doc = docBuilder.parse(is); + Element rootElement = doc.getDocumentElement(); + for (int i = 0; i < tagNames.length; i++) { + NodeList targetNodes = rootElement + .getElementsByTagName(tagNames[i]); + if (targetNodes.getLength() <= 0) { + System.out.println("no " + tagNames[i] + + " tag in XML response...returning null"); + } else { + List valueList = new ArrayList(); + for (int j = 0; j < targetNodes.getLength(); j++) { + Node node = targetNodes.item(j); + valueList.add(node.getTextContent()); + } + returnValues.put(tagNames[i], valueList); + } + } + } catch (Exception ex) { + System.out.println(ex); + } + return returnValues; + } + + + + public static String signRequest(String request, String key) { + try { + Mac mac = Mac.getInstance("HmacSHA1"); + SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), + "HmacSHA1"); + mac.init(keySpec); + mac.update(request.getBytes()); byte[] encryptedBytes = mac.doFinal(); - //System.out.println("HmacSHA1 hash: " + encryptedBytes); - return Base64.encodeBytes(encryptedBytes); - } catch (Exception ex) { + //System.out.println("HmacSHA1 hash: " + encryptedBytes); + return Base64.encodeBytes(encryptedBytes); + } catch (Exception ex) { System.out.println("unable to sign request"); - ex.printStackTrace(); - } - return null; - } - -} + ex.printStackTrace(); + } + return null; + } + +} From 7b7d51cecd0ff8f457f75e2e3ea9ff10d411412b Mon Sep 17 00:00:00 2001 From: David Nalley Date: Tue, 26 Jun 2012 11:19:58 -0400 Subject: [PATCH 08/37] apply chip childers licensing patches for the test directory https://reviews.apache.org/r/5444/ --- test/bindirbak/cloud-run-test.in | 18 ++++++++++++ test/integration/__init__.py | 16 ++++++++++ test/integration/component/__init__.py | 27 +++++++++-------- test/integration/component/test_accounts.py | 27 +++++++++-------- .../component/test_blocker_bugs.py | 27 +++++++++-------- .../component/test_egress_rules.py | 29 ++++++++++--------- test/integration/component/test_eip_elb.py | 29 ++++++++++--------- .../component/test_high_availability.py | 29 ++++++++++--------- .../component/test_network_offering.py | 29 ++++++++++--------- .../component/test_project_configs.py | 29 ++++++++++--------- .../component/test_project_limits.py | 27 +++++++++-------- .../component/test_project_resources.py | 27 +++++++++-------- .../component/test_project_usage.py | 27 +++++++++-------- test/integration/component/test_projects.py | 27 +++++++++-------- .../component/test_resource_limits.py | 27 +++++++++-------- test/integration/component/test_routers.py | 27 +++++++++-------- .../component/test_security_groups.py | 27 +++++++++-------- test/integration/component/test_snapshots.py | 27 +++++++++-------- test/integration/component/test_templates.py | 27 +++++++++-------- test/integration/component/test_usage.py | 27 +++++++++-------- test/integration/component/test_volumes.py | 27 +++++++++-------- test/integration/lib/__init__.py | 27 +++++++++-------- test/integration/lib/base.py | 29 ++++++++++--------- test/integration/lib/common.py | 29 ++++++++++--------- test/integration/lib/utils.py | 29 ++++++++++--------- test/integration/smoke/__init__.py | 27 +++++++++-------- test/integration/smoke/test_disk_offerings.py | 27 +++++++++-------- test/integration/smoke/test_hosts.py | 27 +++++++++-------- test/integration/smoke/test_iso.py | 27 +++++++++-------- test/integration/smoke/test_network.py | 27 +++++++++-------- .../integration/smoke/test_primary_storage.py | 27 +++++++++-------- test/integration/smoke/test_routers.py | 27 +++++++++-------- .../smoke/test_secondary_storage.py | 27 +++++++++-------- .../smoke/test_service_offerings.py | 27 +++++++++-------- test/integration/smoke/test_snapshots.py | 27 +++++++++-------- test/integration/smoke/test_ssvm.py | 27 +++++++++-------- test/integration/smoke/test_templates.py | 27 +++++++++-------- test/integration/smoke/test_vm_life_cycle.py | 27 +++++++++-------- test/integration/smoke/test_volumes.py | 27 +++++++++-------- test/scripts/bootstrap-regression.sh | 26 ++++++++++------- test/scripts/build-env.sh | 26 ++++++++++------- test/scripts/certDeleteEC2.sh | 26 ++++++++++------- test/scripts/certSubmitEC2.sh | 26 ++++++++++------- test/scripts/checkLog.sh | 26 ++++++++++------- test/scripts/checkOutOfMemory.sh | 26 ++++++++++------- test/scripts/cleanparallel.sh | 26 ++++++++++------- test/scripts/deploy-and-run-regression.sh | 26 ++++++++++------- test/scripts/deploy.sh | 26 ++++++++++------- test/scripts/deploycluster.sh | 26 ++++++++++------- test/scripts/executeUserAPI.sh | 26 ++++++++++------- test/scripts/invoke.sh | 26 ++++++++++------- test/scripts/regression.sh | 26 ++++++++++------- test/scripts/run.sh | 26 ++++++++++------- test/scripts/script_lock_test/test.sh | 26 ++++++++++------- test/scripts/script_lock_test/test_task.sh | 26 ++++++++++------- test/scripts/sign.sh | 26 ++++++++++------- test/scripts/signEC2.sh | 26 ++++++++++------- test/scripts/usage/allocated.sh | 26 ++++++++++------- test/scripts/usage/network.sh | 26 ++++++++++------- test/scripts/usage/running.sh | 26 ++++++++++------- test/scripts/usage/volume_usage.sh | 26 ++++++++++------- test/scripts/xen/corrupttemplate.sh | 26 ++++++++++------- test/scripts/xen/createfaketemplate.sh | 26 ++++++++++------- test/scripts/xen/killvm.sh | 26 ++++++++++------- test/scripts/xen/listtemplate.sh | 26 ++++++++++------- test/scripts/xen/listvdi.sh | 26 ++++++++++------- test/scripts/xen/listvm.sh | 26 ++++++++++------- test/scripts/xen/ms.sh | 26 ++++++++++------- test/scripts/xen/removetemplate.sh | 26 ++++++++++------- test/scripts/xen/shutdown.sh | 26 ++++++++++------- test/scripts/xen/sleep.sh | 26 ++++++++++------- test/scripts/xen/ssh.sh | 26 ++++++++++------- test/src/com/cloud/sample/Base64.java | 28 ++++++++++-------- .../cloud/sample/UserCloudAPIExecutor.java | 28 ++++++++++-------- .../cloud/test/longrun/BuildGuestNetwork.java | 28 ++++++++++-------- .../test/longrun/PerformanceWithAPI.java | 28 ++++++++++-------- test/src/com/cloud/test/longrun/User.java | 28 ++++++++++-------- .../cloud/test/longrun/VirtualMachine.java | 28 ++++++++++-------- .../com/cloud/test/longrun/guestNetwork.java | 28 ++++++++++-------- .../com/cloud/test/regression/ApiCommand.java | 28 ++++++++++-------- .../com/cloud/test/regression/ConfigTest.java | 28 ++++++++++-------- .../test/regression/DelegatedAdminTest.java | 28 ++++++++++-------- .../src/com/cloud/test/regression/Deploy.java | 28 ++++++++++-------- .../cloud/test/regression/EventsApiTest.java | 28 ++++++++++-------- test/src/com/cloud/test/regression/HA.java | 28 ++++++++++-------- .../test/regression/LoadBalancingTest.java | 28 ++++++++++-------- .../test/regression/PortForwardingTest.java | 28 ++++++++++-------- .../com/cloud/test/regression/SanityTest.java | 28 ++++++++++-------- test/src/com/cloud/test/regression/Test.java | 28 ++++++++++-------- .../com/cloud/test/regression/TestCase.java | 28 ++++++++++-------- .../cloud/test/regression/TestCaseEngine.java | 28 ++++++++++-------- .../com/cloud/test/regression/VMApiTest.java | 28 ++++++++++-------- test/src/com/cloud/test/stress/SshTest.java | 28 ++++++++++-------- .../test/stress/StressTestDirectAttach.java | 28 ++++++++++-------- .../cloud/test/stress/TestClientWithAPI.java | 28 ++++++++++-------- test/src/com/cloud/test/stress/WgetTest.java | 28 ++++++++++-------- .../test/ui/AbstractSeleniumTestCase.java | 28 ++++++++++-------- .../com/cloud/test/ui/AddAndDeleteAISO.java | 28 ++++++++++-------- .../cloud/test/ui/AddAndDeleteATemplate.java | 28 ++++++++++-------- .../src/com/cloud/test/ui/UIScenarioTest.java | 28 ++++++++++-------- .../com/cloud/test/utils/ConsoleProxy.java | 28 ++++++++++-------- .../com/cloud/test/utils/IpSqlGenerator.java | 28 ++++++++++-------- .../com/cloud/test/utils/ProxyLoadTemp.java | 28 ++++++++++-------- test/src/com/cloud/test/utils/SignEC2.java | 28 ++++++++++-------- .../src/com/cloud/test/utils/SignRequest.java | 28 ++++++++++-------- .../cloud/test/utils/SqlDataGenerator.java | 28 ++++++++++-------- test/src/com/cloud/test/utils/SubmitCert.java | 28 ++++++++++-------- test/src/com/cloud/test/utils/TestClient.java | 28 ++++++++++-------- .../com/cloud/test/utils/UtilsForTest.java | 28 ++++++++++-------- 109 files changed, 1684 insertions(+), 1259 deletions(-) diff --git a/test/bindirbak/cloud-run-test.in b/test/bindirbak/cloud-run-test.in index 68b3932b35f..c3ec810b9c6 100755 --- a/test/bindirbak/cloud-run-test.in +++ b/test/bindirbak/cloud-run-test.in @@ -1,5 +1,23 @@ #!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + set -e LIBS=" diff --git a/test/integration/__init__.py b/test/integration/__init__.py index e69de29bb2d..978b68af62a 100644 --- a/test/integration/__init__.py +++ b/test/integration/__init__.py @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/integration/component/__init__.py b/test/integration/component/__init__.py index d65b5e89b69..978b68af62a 100644 --- a/test/integration/component/__init__.py +++ b/test/integration/component/__init__.py @@ -1,13 +1,16 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 \ No newline at end of file +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index c8a7a234bc4..87c8ee1f4cf 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Account """ #Import Local Modules diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py index 5da10b70b75..c0c676a5424 100644 --- a/test/integration/component/test_blocker_bugs.py +++ b/test/integration/component/test_blocker_bugs.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ Tests for Blocker bugs """ import marvin diff --git a/test/integration/component/test_egress_rules.py b/test/integration/component/test_egress_rules.py index 751a595bd77..d6bbb2a963d 100644 --- a/test/integration/component/test_egress_rules.py +++ b/test/integration/component/test_egress_rules.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 for Egresss & Ingress rules """ diff --git a/test/integration/component/test_eip_elb.py b/test/integration/component/test_eip_elb.py index ac11d6dab54..d740ea5ba1b 100644 --- a/test/integration/component/test_eip_elb.py +++ b/test/integration/component/test_eip_elb.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for elastic load balancing and elastic IP """ diff --git a/test/integration/component/test_high_availability.py b/test/integration/component/test_high_availability.py index 9d1ac019f4f..8365f4afbec 100644 --- a/test/integration/component/test_high_availability.py +++ b/test/integration/component/test_high_availability.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for high availability """ diff --git a/test/integration/component/test_network_offering.py b/test/integration/component/test_network_offering.py index 24e388c899e..d77da7712fc 100644 --- a/test/integration/component/test_network_offering.py +++ b/test/integration/component/test_network_offering.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for network offering """ diff --git a/test/integration/component/test_project_configs.py b/test/integration/component/test_project_configs.py index d397d9d2a48..a94c2c11875 100644 --- a/test/integration/component/test_project_configs.py +++ b/test/integration/component/test_project_configs.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Project """ #Import Local Modules diff --git a/test/integration/component/test_project_limits.py b/test/integration/component/test_project_limits.py index c69cc3238fc..9e41789e7cd 100644 --- a/test/integration/component/test_project_limits.py +++ b/test/integration/component/test_project_limits.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Resource limits """ #Import Local Modules diff --git a/test/integration/component/test_project_resources.py b/test/integration/component/test_project_resources.py index a98f860a67b..90c14cedc44 100644 --- a/test/integration/component/test_project_resources.py +++ b/test/integration/component/test_project_resources.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Resource creation """ #Import Local Modules diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index 5ecaa83accd..0ba92d47dc3 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Snapshots """ #Import Local Modules diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index e2167326db6..9c07fe14c70 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Project """ #Import Local Modules diff --git a/test/integration/component/test_resource_limits.py b/test/integration/component/test_resource_limits.py index c7a0c6c8c5b..e6d6d14196b 100644 --- a/test/integration/component/test_resource_limits.py +++ b/test/integration/component/test_resource_limits.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Resource limits """ #Import Local Modules diff --git a/test/integration/component/test_routers.py b/test/integration/component/test_routers.py index 7671e80f814..6aed7d5a1d4 100644 --- a/test/integration/component/test_routers.py +++ b/test/integration/component/test_routers.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for routers """ #Import Local Modules diff --git a/test/integration/component/test_security_groups.py b/test/integration/component/test_security_groups.py index 7e49d20446a..7e54eea0d14 100644 --- a/test/integration/component/test_security_groups.py +++ b/test/integration/component/test_security_groups.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 for Security groups """ diff --git a/test/integration/component/test_snapshots.py b/test/integration/component/test_snapshots.py index 8ab7ff7281e..612e8e6f71f 100644 --- a/test/integration/component/test_snapshots.py +++ b/test/integration/component/test_snapshots.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Snapshots """ #Import Local Modules diff --git a/test/integration/component/test_templates.py b/test/integration/component/test_templates.py index afad16c04b7..1be7a8455ab 100644 --- a/test/integration/component/test_templates.py +++ b/test/integration/component/test_templates.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Templates """ #Import Local Modules diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index ff41baecd77..ec9288ab7fd 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Snapshots """ #Import Local Modules diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index a20770b2851..fef9ced15dd 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ P1 tests for Volumes """ #Import Local Modules diff --git a/test/integration/lib/__init__.py b/test/integration/lib/__init__.py index d65b5e89b69..978b68af62a 100644 --- a/test/integration/lib/__init__.py +++ b/test/integration/lib/__init__.py @@ -1,13 +1,16 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 \ No newline at end of file +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/integration/lib/base.py b/test/integration/lib/base.py index 1f8a2f851c0..46aef006a60 100644 --- a/test/integration/lib/base.py +++ b/test/integration/lib/base.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ Base class for all Cloudstack resources -Virtual machine, Volume, Snapshot etc diff --git a/test/integration/lib/common.py b/test/integration/lib/common.py index 17f24d74770..11dd2c05f27 100644 --- a/test/integration/lib/common.py +++ b/test/integration/lib/common.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """Common functions """ diff --git a/test/integration/lib/utils.py b/test/integration/lib/utils.py index e4a28620c7c..3592502c8dc 100644 --- a/test/integration/lib/utils.py +++ b/test/integration/lib/utils.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """Utilities functions """ diff --git a/test/integration/smoke/__init__.py b/test/integration/smoke/__init__.py index d65b5e89b69..978b68af62a 100644 --- a/test/integration/smoke/__init__.py +++ b/test/integration/smoke/__init__.py @@ -1,13 +1,16 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 \ No newline at end of file +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/integration/smoke/test_disk_offerings.py b/test/integration/smoke/test_disk_offerings.py index f38e73ba2a7..f5ac59708bf 100644 --- a/test/integration/smoke/test_disk_offerings.py +++ b/test/integration/smoke/test_disk_offerings.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Disk offerings""" #Import Local Modules diff --git a/test/integration/smoke/test_hosts.py b/test/integration/smoke/test_hosts.py index 2fafb76a50b..78ed00f52cf 100644 --- a/test/integration/smoke/test_hosts.py +++ b/test/integration/smoke/test_hosts.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Hosts and Clusters """ #Import Local Modules diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py index e1f8dfeb4b7..358bbf88552 100644 --- a/test/integration/smoke/test_iso.py +++ b/test/integration/smoke/test_iso.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Templates ISO """ #Import Local Modules diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 5938094884f..e3015803e0c 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Network Life Cycle """ #Import Local Modules diff --git a/test/integration/smoke/test_primary_storage.py b/test/integration/smoke/test_primary_storage.py index efceebe3cda..7156991c3eb 100644 --- a/test/integration/smoke/test_primary_storage.py +++ b/test/integration/smoke/test_primary_storage.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Primary Storage """ #Import Local Modules diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py index 603ca672571..cd921accbe0 100644 --- a/test/integration/smoke/test_routers.py +++ b/test/integration/smoke/test_routers.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for routers """ #Import Local Modules diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py index 9f60593aa9b..de0fc5e7ac7 100644 --- a/test/integration/smoke/test_secondary_storage.py +++ b/test/integration/smoke/test_secondary_storage.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Secondary Storage """ #Import Local Modules diff --git a/test/integration/smoke/test_service_offerings.py b/test/integration/smoke/test_service_offerings.py index bf9ccd14a6c..fec3f4b84f0 100644 --- a/test/integration/smoke/test_service_offerings.py +++ b/test/integration/smoke/test_service_offerings.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Service offerings""" #Import Local Modules diff --git a/test/integration/smoke/test_snapshots.py b/test/integration/smoke/test_snapshots.py index 694e60e2b8f..510db0cfd35 100644 --- a/test/integration/smoke/test_snapshots.py +++ b/test/integration/smoke/test_snapshots.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Snapshots """ #Import Local Modules diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index f67d918f91f..40257d8011c 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for SSVM """ #Import Local Modules diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py index b17b93fda19..22309f4b57b 100644 --- a/test/integration/smoke/test_templates.py +++ b/test/integration/smoke/test_templates.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Templates ISO """ #Import Local Modules diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index 40d17665900..529887268fb 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Virtual Machine Life Cycle """ #Import Local Modules diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 7ea16837c26..f413b933662 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -1,16 +1,19 @@ -# -*- encoding: utf-8 -*- -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. """ BVT tests for Volumes """ #Import Local Modules diff --git a/test/scripts/bootstrap-regression.sh b/test/scripts/bootstrap-regression.sh index aae61ed6774..8328d1042a1 100755 --- a/test/scripts/bootstrap-regression.sh +++ b/test/scripts/bootstrap-regression.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/build-env.sh b/test/scripts/build-env.sh index 7a4034dfd67..2a9a58626f0 100755 --- a/test/scripts/build-env.sh +++ b/test/scripts/build-env.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/certDeleteEC2.sh b/test/scripts/certDeleteEC2.sh index 0a02c53f95b..ed4947ac5b4 100755 --- a/test/scripts/certDeleteEC2.sh +++ b/test/scripts/certDeleteEC2.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/certSubmitEC2.sh b/test/scripts/certSubmitEC2.sh index 3c2a8f63b8d..7ac915abf98 100755 --- a/test/scripts/certSubmitEC2.sh +++ b/test/scripts/certSubmitEC2.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/checkLog.sh b/test/scripts/checkLog.sh index 95c80b4bc01..82619ffc9fb 100755 --- a/test/scripts/checkLog.sh +++ b/test/scripts/checkLog.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/checkOutOfMemory.sh b/test/scripts/checkOutOfMemory.sh index a3c04928676..08dccdafafa 100755 --- a/test/scripts/checkOutOfMemory.sh +++ b/test/scripts/checkOutOfMemory.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/cleanparallel.sh b/test/scripts/cleanparallel.sh index 29db4409e36..fe72da7da69 100755 --- a/test/scripts/cleanparallel.sh +++ b/test/scripts/cleanparallel.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/deploy-and-run-regression.sh b/test/scripts/deploy-and-run-regression.sh index c4c37397a29..5c2ad983b25 100755 --- a/test/scripts/deploy-and-run-regression.sh +++ b/test/scripts/deploy-and-run-regression.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/deploy.sh b/test/scripts/deploy.sh index c8310becc1c..6b58e888a33 100755 --- a/test/scripts/deploy.sh +++ b/test/scripts/deploy.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/deploycluster.sh b/test/scripts/deploycluster.sh index 549ceaef7a7..636a56b5e99 100755 --- a/test/scripts/deploycluster.sh +++ b/test/scripts/deploycluster.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/executeUserAPI.sh b/test/scripts/executeUserAPI.sh index 00cec036f0d..55107bc2b32 100755 --- a/test/scripts/executeUserAPI.sh +++ b/test/scripts/executeUserAPI.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/invoke.sh b/test/scripts/invoke.sh index 062bb53675b..2d8405f84a6 100755 --- a/test/scripts/invoke.sh +++ b/test/scripts/invoke.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/regression.sh b/test/scripts/regression.sh index e9ec188ed39..7a7c9e062aa 100755 --- a/test/scripts/regression.sh +++ b/test/scripts/regression.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/run.sh b/test/scripts/run.sh index 718da15a2ad..987f70e6180 100755 --- a/test/scripts/run.sh +++ b/test/scripts/run.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/script_lock_test/test.sh b/test/scripts/script_lock_test/test.sh index b01ad930578..f50b27bd605 100755 --- a/test/scripts/script_lock_test/test.sh +++ b/test/scripts/script_lock_test/test.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. rm /tmp/biglock* echo diff --git a/test/scripts/script_lock_test/test_task.sh b/test/scripts/script_lock_test/test_task.sh index 7f0cb900629..21d722ed21f 100755 --- a/test/scripts/script_lock_test/test_task.sh +++ b/test/scripts/script_lock_test/test_task.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. source ../../../patches/systemvm/debian/config/root/func.sh diff --git a/test/scripts/sign.sh b/test/scripts/sign.sh index 850843723d8..db807c4122f 100755 --- a/test/scripts/sign.sh +++ b/test/scripts/sign.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/signEC2.sh b/test/scripts/signEC2.sh index a9bff92267d..78ca108e5d7 100755 --- a/test/scripts/signEC2.sh +++ b/test/scripts/signEC2.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/usage/allocated.sh b/test/scripts/usage/allocated.sh index f79405ffea1..7ae57376023 100755 --- a/test/scripts/usage/allocated.sh +++ b/test/scripts/usage/allocated.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/usage/network.sh b/test/scripts/usage/network.sh index 45f608cb2b3..81d6afdac2d 100755 --- a/test/scripts/usage/network.sh +++ b/test/scripts/usage/network.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/usage/running.sh b/test/scripts/usage/running.sh index ffbee00b082..bbb9f14eb8b 100755 --- a/test/scripts/usage/running.sh +++ b/test/scripts/usage/running.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/usage/volume_usage.sh b/test/scripts/usage/volume_usage.sh index b23fec04cb7..c18493b0049 100755 --- a/test/scripts/usage/volume_usage.sh +++ b/test/scripts/usage/volume_usage.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/corrupttemplate.sh b/test/scripts/xen/corrupttemplate.sh index 31598654114..528dcf150f6 100755 --- a/test/scripts/xen/corrupttemplate.sh +++ b/test/scripts/xen/corrupttemplate.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/createfaketemplate.sh b/test/scripts/xen/createfaketemplate.sh index 948b5a75dec..a68a0c3aeda 100755 --- a/test/scripts/xen/createfaketemplate.sh +++ b/test/scripts/xen/createfaketemplate.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/killvm.sh b/test/scripts/xen/killvm.sh index 34e9e056198..43b81c90ec2 100755 --- a/test/scripts/xen/killvm.sh +++ b/test/scripts/xen/killvm.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/listtemplate.sh b/test/scripts/xen/listtemplate.sh index 7b35d902d55..bf3c58991f6 100755 --- a/test/scripts/xen/listtemplate.sh +++ b/test/scripts/xen/listtemplate.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/listvdi.sh b/test/scripts/xen/listvdi.sh index 6368c905df4..cf20bc6e786 100755 --- a/test/scripts/xen/listvdi.sh +++ b/test/scripts/xen/listvdi.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/listvm.sh b/test/scripts/xen/listvm.sh index 9d70b40cc07..cd58e786b06 100755 --- a/test/scripts/xen/listvm.sh +++ b/test/scripts/xen/listvm.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/ms.sh b/test/scripts/xen/ms.sh index ad2914d37bc..c06b1193183 100755 --- a/test/scripts/xen/ms.sh +++ b/test/scripts/xen/ms.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/removetemplate.sh b/test/scripts/xen/removetemplate.sh index 540941be046..dc7a63a48c4 100755 --- a/test/scripts/xen/removetemplate.sh +++ b/test/scripts/xen/removetemplate.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/shutdown.sh b/test/scripts/xen/shutdown.sh index 1d6eb20f637..69c51fef9ab 100755 --- a/test/scripts/xen/shutdown.sh +++ b/test/scripts/xen/shutdown.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/sleep.sh b/test/scripts/xen/sleep.sh index 52be6d11cb5..f06798d0f15 100755 --- a/test/scripts/xen/sleep.sh +++ b/test/scripts/xen/sleep.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/scripts/xen/ssh.sh b/test/scripts/xen/ssh.sh index 989bf69fcac..b918c74ea3d 100755 --- a/test/scripts/xen/ssh.sh +++ b/test/scripts/xen/ssh.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/test/src/com/cloud/sample/Base64.java b/test/src/com/cloud/sample/Base64.java index ae38ff12480..5d822e31e66 100644 --- a/test/src/com/cloud/sample/Base64.java +++ b/test/src/com/cloud/sample/Base64.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.sample; /** diff --git a/test/src/com/cloud/sample/UserCloudAPIExecutor.java b/test/src/com/cloud/sample/UserCloudAPIExecutor.java index 7a2880860fb..0917409e6db 100644 --- a/test/src/com/cloud/sample/UserCloudAPIExecutor.java +++ b/test/src/com/cloud/sample/UserCloudAPIExecutor.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.sample; import java.io.FileInputStream; diff --git a/test/src/com/cloud/test/longrun/BuildGuestNetwork.java b/test/src/com/cloud/test/longrun/BuildGuestNetwork.java index 236c9ea46a4..3775e19ab9b 100644 --- a/test/src/com/cloud/test/longrun/BuildGuestNetwork.java +++ b/test/src/com/cloud/test/longrun/BuildGuestNetwork.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.longrun; import java.util.Arrays; diff --git a/test/src/com/cloud/test/longrun/PerformanceWithAPI.java b/test/src/com/cloud/test/longrun/PerformanceWithAPI.java index 0e67d2611d8..b33fa452ae4 100644 --- a/test/src/com/cloud/test/longrun/PerformanceWithAPI.java +++ b/test/src/com/cloud/test/longrun/PerformanceWithAPI.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.longrun; import java.io.IOException; diff --git a/test/src/com/cloud/test/longrun/User.java b/test/src/com/cloud/test/longrun/User.java index 7ff4674eb1a..f601f010789 100644 --- a/test/src/com/cloud/test/longrun/User.java +++ b/test/src/com/cloud/test/longrun/User.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.longrun; import java.util.ArrayList; import java.util.Map; diff --git a/test/src/com/cloud/test/longrun/VirtualMachine.java b/test/src/com/cloud/test/longrun/VirtualMachine.java index 24cd2069658..1d75953b2b3 100644 --- a/test/src/com/cloud/test/longrun/VirtualMachine.java +++ b/test/src/com/cloud/test/longrun/VirtualMachine.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.longrun; import java.io.InputStream; diff --git a/test/src/com/cloud/test/longrun/guestNetwork.java b/test/src/com/cloud/test/longrun/guestNetwork.java index e9bafcd8256..a4254e17d94 100644 --- a/test/src/com/cloud/test/longrun/guestNetwork.java +++ b/test/src/com/cloud/test/longrun/guestNetwork.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.longrun; import java.util.ArrayList; import java.util.Random; diff --git a/test/src/com/cloud/test/regression/ApiCommand.java b/test/src/com/cloud/test/regression/ApiCommand.java index ed6186ab142..cf197268fd9 100644 --- a/test/src/com/cloud/test/regression/ApiCommand.java +++ b/test/src/com/cloud/test/regression/ApiCommand.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import java.io.File; diff --git a/test/src/com/cloud/test/regression/ConfigTest.java b/test/src/com/cloud/test/regression/ConfigTest.java index 366cb27f927..7e4ca64de17 100644 --- a/test/src/com/cloud/test/regression/ConfigTest.java +++ b/test/src/com/cloud/test/regression/ConfigTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import java.util.HashMap; diff --git a/test/src/com/cloud/test/regression/DelegatedAdminTest.java b/test/src/com/cloud/test/regression/DelegatedAdminTest.java index 6ade35f8512..510fe04b4a1 100644 --- a/test/src/com/cloud/test/regression/DelegatedAdminTest.java +++ b/test/src/com/cloud/test/regression/DelegatedAdminTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; diff --git a/test/src/com/cloud/test/regression/Deploy.java b/test/src/com/cloud/test/regression/Deploy.java index c3875bd0484..02580b9348b 100644 --- a/test/src/com/cloud/test/regression/Deploy.java +++ b/test/src/com/cloud/test/regression/Deploy.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import java.util.ArrayList; diff --git a/test/src/com/cloud/test/regression/EventsApiTest.java b/test/src/com/cloud/test/regression/EventsApiTest.java index 8e5e9e5d6da..d929899d23e 100644 --- a/test/src/com/cloud/test/regression/EventsApiTest.java +++ b/test/src/com/cloud/test/regression/EventsApiTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import java.sql.Statement; diff --git a/test/src/com/cloud/test/regression/HA.java b/test/src/com/cloud/test/regression/HA.java index cdf2a1c052f..1060511b948 100644 --- a/test/src/com/cloud/test/regression/HA.java +++ b/test/src/com/cloud/test/regression/HA.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import org.apache.log4j.Logger; diff --git a/test/src/com/cloud/test/regression/LoadBalancingTest.java b/test/src/com/cloud/test/regression/LoadBalancingTest.java index 531af8faf95..6910b0de39a 100644 --- a/test/src/com/cloud/test/regression/LoadBalancingTest.java +++ b/test/src/com/cloud/test/regression/LoadBalancingTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import java.util.HashMap; diff --git a/test/src/com/cloud/test/regression/PortForwardingTest.java b/test/src/com/cloud/test/regression/PortForwardingTest.java index 2942edace53..73522989181 100644 --- a/test/src/com/cloud/test/regression/PortForwardingTest.java +++ b/test/src/com/cloud/test/regression/PortForwardingTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import java.util.HashMap; diff --git a/test/src/com/cloud/test/regression/SanityTest.java b/test/src/com/cloud/test/regression/SanityTest.java index 343cbbf11a5..07b370fa518 100644 --- a/test/src/com/cloud/test/regression/SanityTest.java +++ b/test/src/com/cloud/test/regression/SanityTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import org.w3c.dom.Element; diff --git a/test/src/com/cloud/test/regression/Test.java b/test/src/com/cloud/test/regression/Test.java index b17deeacdaa..328721c705f 100644 --- a/test/src/com/cloud/test/regression/Test.java +++ b/test/src/com/cloud/test/regression/Test.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import java.util.ArrayList; diff --git a/test/src/com/cloud/test/regression/TestCase.java b/test/src/com/cloud/test/regression/TestCase.java index 3eefa4c1507..ae605607168 100644 --- a/test/src/com/cloud/test/regression/TestCase.java +++ b/test/src/com/cloud/test/regression/TestCase.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import java.io.File; diff --git a/test/src/com/cloud/test/regression/TestCaseEngine.java b/test/src/com/cloud/test/regression/TestCaseEngine.java index 7895268ea83..0496314061d 100644 --- a/test/src/com/cloud/test/regression/TestCaseEngine.java +++ b/test/src/com/cloud/test/regression/TestCaseEngine.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import java.io.File; diff --git a/test/src/com/cloud/test/regression/VMApiTest.java b/test/src/com/cloud/test/regression/VMApiTest.java index 917b5bf9d01..5685f078a39 100644 --- a/test/src/com/cloud/test/regression/VMApiTest.java +++ b/test/src/com/cloud/test/regression/VMApiTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.regression; import java.util.HashMap; diff --git a/test/src/com/cloud/test/stress/SshTest.java b/test/src/com/cloud/test/stress/SshTest.java index e6f0edd1ad9..9dbf4c2b754 100644 --- a/test/src/com/cloud/test/stress/SshTest.java +++ b/test/src/com/cloud/test/stress/SshTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.stress; import java.util.Arrays; diff --git a/test/src/com/cloud/test/stress/StressTestDirectAttach.java b/test/src/com/cloud/test/stress/StressTestDirectAttach.java index 18c42f9eac4..a4afb804f5e 100644 --- a/test/src/com/cloud/test/stress/StressTestDirectAttach.java +++ b/test/src/com/cloud/test/stress/StressTestDirectAttach.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.stress; import java.io.IOException; diff --git a/test/src/com/cloud/test/stress/TestClientWithAPI.java b/test/src/com/cloud/test/stress/TestClientWithAPI.java index 23493aa67b1..84cb087841b 100644 --- a/test/src/com/cloud/test/stress/TestClientWithAPI.java +++ b/test/src/com/cloud/test/stress/TestClientWithAPI.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.stress; import java.io.IOException; diff --git a/test/src/com/cloud/test/stress/WgetTest.java b/test/src/com/cloud/test/stress/WgetTest.java index 28e74081493..21af7ee9807 100644 --- a/test/src/com/cloud/test/stress/WgetTest.java +++ b/test/src/com/cloud/test/stress/WgetTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.stress; import java.io.InputStream; diff --git a/test/src/com/cloud/test/ui/AbstractSeleniumTestCase.java b/test/src/com/cloud/test/ui/AbstractSeleniumTestCase.java index 0a857fb60e3..1f3724460ea 100644 --- a/test/src/com/cloud/test/ui/AbstractSeleniumTestCase.java +++ b/test/src/com/cloud/test/ui/AbstractSeleniumTestCase.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.ui; import org.junit.AfterClass; diff --git a/test/src/com/cloud/test/ui/AddAndDeleteAISO.java b/test/src/com/cloud/test/ui/AddAndDeleteAISO.java index 90634728f3c..c8e5997553b 100644 --- a/test/src/com/cloud/test/ui/AddAndDeleteAISO.java +++ b/test/src/com/cloud/test/ui/AddAndDeleteAISO.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.ui; import org.junit.Test; diff --git a/test/src/com/cloud/test/ui/AddAndDeleteATemplate.java b/test/src/com/cloud/test/ui/AddAndDeleteATemplate.java index 7046bdef585..29404bf477c 100644 --- a/test/src/com/cloud/test/ui/AddAndDeleteATemplate.java +++ b/test/src/com/cloud/test/ui/AddAndDeleteATemplate.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.ui; import org.junit.Test; diff --git a/test/src/com/cloud/test/ui/UIScenarioTest.java b/test/src/com/cloud/test/ui/UIScenarioTest.java index 2faa9e8823d..32619b05b36 100644 --- a/test/src/com/cloud/test/ui/UIScenarioTest.java +++ b/test/src/com/cloud/test/ui/UIScenarioTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.ui; import org.junit.Test; diff --git a/test/src/com/cloud/test/utils/ConsoleProxy.java b/test/src/com/cloud/test/utils/ConsoleProxy.java index cd4741c67ee..2783b2374bb 100644 --- a/test/src/com/cloud/test/utils/ConsoleProxy.java +++ b/test/src/com/cloud/test/utils/ConsoleProxy.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.utils; import java.io.BufferedReader; diff --git a/test/src/com/cloud/test/utils/IpSqlGenerator.java b/test/src/com/cloud/test/utils/IpSqlGenerator.java index 1a90c20b6ee..9bb802e1f7a 100644 --- a/test/src/com/cloud/test/utils/IpSqlGenerator.java +++ b/test/src/com/cloud/test/utils/IpSqlGenerator.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.utils; import java.io.DataOutputStream; diff --git a/test/src/com/cloud/test/utils/ProxyLoadTemp.java b/test/src/com/cloud/test/utils/ProxyLoadTemp.java index da72ed0ab1f..e2052b35c93 100644 --- a/test/src/com/cloud/test/utils/ProxyLoadTemp.java +++ b/test/src/com/cloud/test/utils/ProxyLoadTemp.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.utils; import java.io.BufferedReader; diff --git a/test/src/com/cloud/test/utils/SignEC2.java b/test/src/com/cloud/test/utils/SignEC2.java index 6344ad3e53e..30fb5a26008 100644 --- a/test/src/com/cloud/test/utils/SignEC2.java +++ b/test/src/com/cloud/test/utils/SignEC2.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.utils; import java.io.FileInputStream; diff --git a/test/src/com/cloud/test/utils/SignRequest.java b/test/src/com/cloud/test/utils/SignRequest.java index cbb7864f406..cebcbd1cd91 100644 --- a/test/src/com/cloud/test/utils/SignRequest.java +++ b/test/src/com/cloud/test/utils/SignRequest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.utils; import java.net.URLEncoder; diff --git a/test/src/com/cloud/test/utils/SqlDataGenerator.java b/test/src/com/cloud/test/utils/SqlDataGenerator.java index 5060cd8dc09..c2f31df282c 100644 --- a/test/src/com/cloud/test/utils/SqlDataGenerator.java +++ b/test/src/com/cloud/test/utils/SqlDataGenerator.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.utils; import java.io.DataOutputStream; diff --git a/test/src/com/cloud/test/utils/SubmitCert.java b/test/src/com/cloud/test/utils/SubmitCert.java index 648805a4c22..a57afd0663c 100644 --- a/test/src/com/cloud/test/utils/SubmitCert.java +++ b/test/src/com/cloud/test/utils/SubmitCert.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.utils; import java.io.BufferedReader; diff --git a/test/src/com/cloud/test/utils/TestClient.java b/test/src/com/cloud/test/utils/TestClient.java index f2ce4ef1ec8..59fd7e37e6b 100644 --- a/test/src/com/cloud/test/utils/TestClient.java +++ b/test/src/com/cloud/test/utils/TestClient.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.utils; import java.io.InputStream; diff --git a/test/src/com/cloud/test/utils/UtilsForTest.java b/test/src/com/cloud/test/utils/UtilsForTest.java index a53a1949d72..500cea587c7 100644 --- a/test/src/com/cloud/test/utils/UtilsForTest.java +++ b/test/src/com/cloud/test/utils/UtilsForTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.test.utils; import java.io.InputStream; From 80b8515347d2f51a978a231bdf351ae34dd2702f Mon Sep 17 00:00:00 2001 From: bfederle Date: Tue, 26 Jun 2012 10:23:33 -0700 Subject: [PATCH 09/37] CS-15315: Fix overlay positioning Original patch by: olga.smola reviewed-by: brian --- ui/css/cloudstack3.css | 1 + ui/scripts/ui/widgets/overlay.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index ffa0aebbf51..d1d53b34934 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -2831,6 +2831,7 @@ Dialogs*/ -webkit-box-shadow: 0px -4px 15px #4C4A4A; -o-box-shadow: 0px -4px 15px #4C4A4A; box-shadow: 0px -4px 15px #4C4A4A; + position:absolute; } .ui-dialog .ui-widget-content { diff --git a/ui/scripts/ui/widgets/overlay.js b/ui/scripts/ui/widgets/overlay.js index 296b58a1a3d..ecf12e6aedd 100644 --- a/ui/scripts/ui/widgets/overlay.js +++ b/ui/scripts/ui/widgets/overlay.js @@ -43,4 +43,8 @@ return this; }; + + $(window).bind('resize scroll', function() { + $('.overlay').css( 'top', $(window).scrollTop()); + }); })(window.jQuery); From cbe1f3e4c437085c20008ef43f1aa99e8d47da5b Mon Sep 17 00:00:00 2001 From: bfederle Date: Tue, 26 Jun 2012 13:30:36 -0700 Subject: [PATCH 10/37] CS-15287 Support validation on edit detail view Original patch by: olga.smola reviewed-by: brian --- ui/css/cloudstack3.css | 6 ++ ui/scripts/accounts.js | 33 ++++++----- ui/scripts/configuration.js | 24 +++++--- ui/scripts/templates.js | 12 ++-- ui/scripts/ui/widgets/detailView.js | 90 ++++++++++++++++++++++------- 5 files changed, 119 insertions(+), 46 deletions(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index d1d53b34934..573afe9daf9 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -1641,6 +1641,12 @@ div.details div.detail-group td.value input[type=text] { width: 93%; } +div.details .main-groups label.error { + position: absolute; + right: 10%; + top: 6px; +} + /*** Actions*/ div.detail-group.actions { padding: 0; diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index eafe5c5f271..6f30963e242 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -514,7 +514,8 @@ { name: { label: 'label.name', - isEditable: true + isEditable: true, + validation: { required: true } } }, { @@ -816,16 +817,16 @@ label: 'label.new.password', isPassword: true, validation: { required: true }, - id: 'newPassword' + id: 'newPassword' }, - 'password-confirm': { - label: 'label.confirm.password', - validation: { - required: true, - equalTo: '#newPassword' - }, - isPassword: true - } + 'password-confirm': { + label: 'label.confirm.password', + validation: { + required: true, + equalTo: '#newPassword' + }, + isPassword: true + } } }, action: function(args) { @@ -979,7 +980,8 @@ { username: { label: 'label.name', - isEditable: true + isEditable: true, + validation: { required: true } } }, { @@ -997,15 +999,18 @@ domain: { label: 'label.domain' }, email: { label: 'label.email', - isEditable: true + isEditable: true, + validation: { required: true, email: true } }, firstname: { label: 'label.first.name', - isEditable: true + isEditable: true, + validation: { required: true } }, lastname: { label: 'label.last.name', - isEditable: true + isEditable: true, + validation: { required: true } }, timezone: { label: 'label.timezone', diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 4a8f9586d90..766dcf32f7b 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -285,14 +285,16 @@ { name: { label: 'label.name', - isEditable: true + isEditable: true, + validation: { required: true } } }, { id: { label: 'label.id' }, displaytext: { label: 'label.description', - isEditable: true + isEditable: true, + validation: { required: true } }, storagetype: { label: 'label.storage.type' }, cpunumber: { label: 'label.num.cpu.cores' }, @@ -615,14 +617,16 @@ { name: { label: 'label.name', - isEditable: true + isEditable: true, + validation: { required: true } } }, { id: { label: 'label.id' }, displaytext: { label: 'label.description', - isEditable: true + isEditable: true, + validation: { required: true } }, systemvmtype: { label: 'label.system.vm.type', @@ -911,14 +915,16 @@ { name: { label: 'label.name', - isEditable: true + isEditable: true, + validation: { required: true } } }, { id: { label: 'label.id' }, displaytext: { label: 'label.description', - isEditable: true + isEditable: true, + validation: { required: true } }, iscustomized: { label: 'label.custom.disk.size', @@ -1701,14 +1707,16 @@ { name: { label: 'label.name', - isEditable: true + isEditable: true, + validation: { required: true } } }, { id: { label: 'label.id' }, displaytext: { label: 'label.description', - isEditable: true + isEditable: true, + validation: { required: true } }, state: { label: 'label.state' }, guestiptype: { diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index bf34f925fb7..811a27a7c66 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -579,7 +579,8 @@ { name: { label: 'label.name', - isEditable: true + isEditable: true, + validation: { required: true } } }, { @@ -588,7 +589,8 @@ zoneid: { label: 'label.zone.id' }, displaytext: { label: 'label.description', - isEditable: true + isEditable: true, + validation: { required: true } }, hypervisor: { label: 'label.hypervisor' }, templatetype: { label: 'label.type' }, @@ -1114,7 +1116,8 @@ { name: { label: 'label.name', - isEditable: true + isEditable: true, + validation: { required: true } } }, { @@ -1123,7 +1126,8 @@ zoneid: { label: 'label.zone.id' }, displaytext: { label: 'label.description', - isEditable: true + isEditable: true, + validation: { required: true } }, isready: { label: 'state.Ready', converter:cloudStack.converters.toBooleanText }, status: { label: 'label.status' }, diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js index 80e99f6e372..1ac609f2745 100644 --- a/ui/scripts/ui/widgets/detailView.js +++ b/ui/scripts/ui/widgets/detailView.js @@ -326,6 +326,18 @@ } }); }; + + var removeEditForm = function() { + // Remove Edit form + var $form = $detailView.find('form'); + if ($form.size()) { + var $mainGroups = $form.find('div.main-groups').detach(); + $form.parent('div').append($mainGroups); + $form.remove(); + } + //Remove required labels + $detailView.find('span.field-required').remove(); + } // Put in original values var cancelEdits = function($inputs, $editButton) { @@ -340,6 +352,8 @@ $editButton.fadeOut('fast', function() { $editButton.remove(); }); + + removeEditForm(); }; var applyEdits = function($inputs, $editButton) { @@ -381,6 +395,7 @@ notificationArgs, function() {}, [] ); replaceListViewItem($detailView, data); + removeEditForm(); } else { $loading.appendTo($detailView); cloudStack.ui.notifications.add( @@ -389,6 +404,7 @@ replaceListViewItem($detailView, data); convertInputs($inputs); + removeEditForm(); $loading.remove(); }, [], function() { @@ -407,17 +423,24 @@ } }; - $editButton.click(function() { - var $inputs = $detailView.find('input, select'); + $editButton.click(function() { + var $inputs = $detailView.find('input, select'), + $form = $detailView.find('form'); if ($(this).hasClass('done')) { - applyEdits($inputs, $editButton); + if (!$form.valid()) { + // Ignore hidden field validation + if ($form.find('input.error:visible, select.error:visible').size()) { + return false; + } + } + applyEdits($inputs, $editButton); } else { // Cancel cancelEdits($inputs, $editButton); } }); - - $detailView.find('td.value span').each(function() { + + $detailView.find('td.value span').each(function() { var name = $(this).closest('tr').data('detail-view-field'); var $value = $(this); if (!$value.data('detail-view-is-editable')) return true; @@ -426,6 +449,7 @@ var selectData = $value.data('detail-view-editable-select'); var isBoolean = $value.data('detail-view-editable-boolean'); var data = !isBoolean ? cloudStack.sanitizeReverse($value.html()) : $value.data('detail-view-boolean-value'); + var rules = $value.data('validation-rules') ? $value.data('validation-rules') : {}; $value.html(''); @@ -467,13 +491,36 @@ name: name, type: 'text', value: data - }).data('original-value', data) + }).data('original-value', data) ); } + + if (rules && rules.required) { + var $required = $('').addClass('field-required').text(' *'); + $value.parent('td.value').prev('td.name').append($required); + } return true; }); + if ($detailView.find('td.value span:data(detail-view-is-editable)').size()) { + var $detailsEdit = $detailView.find('div.main-groups').detach(), + $detailsEditForm = $('
    ').append($detailsEdit); + + $detailView.find('div.details').append($detailsEditForm); + } + + // Setup form validation + $detailView.find('form').validate(); + $detailView.find('form').find('input, select').each(function() { + var data = $(this).parent('span').data('validation-rules'); + if (data) { + $(this).rules('add', data); + } else { + $(this).rules('add', {}); + } + }); + return $detailView; } }; @@ -689,23 +736,26 @@ //??? /* - if("pollAgainIfValueIsIn" in value) { - if ((content in value.pollAgainIfValueIsIn) && (value.pollAgainFn != null)) { - //poll again - var intervalKey = setInterval(function() { - var toClearInterval = value.pollAgainFn(context); - if(toClearInterval == true) { - clearInterval(intervalKey); - $('.detail-view .toolbar .button.refresh').click(); //click Refresh button to refresh detailView - } - }, 2000); - } - } - */ - + if("pollAgainIfValueIsIn" in value) { + if ((content in value.pollAgainIfValueIsIn) && (value.pollAgainFn != null)) { + //poll again + var intervalKey = setInterval(function() { + var toClearInterval = value.pollAgainFn(context); + if(toClearInterval == true) { + clearInterval(intervalKey); + $('.detail-view .toolbar .button.refresh').click(); //click Refresh button to refresh detailView + } + }, 2000); + } + } + */ + $name.html(_l(value.label)); $value.html(_s(content)); + // Set up validation metadata + $value.data('validation-rules', value.validation); + // Set up editable metadata if(typeof(value.isEditable) == 'function') $value.data('detail-view-is-editable', value.isEditable()); From df32adb1d55ebed1a3a6a8b078e0bf952ac0882d Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Tue, 26 Jun 2012 13:35:57 -0700 Subject: [PATCH 11/37] adding build-cloud-plugins.xml, this will seperate out plug-in building --- build.xml | 1 + build/build-cloud-plugins.xml | 268 ++++++++++++++++++++++++++++++++++ build/build-cloud.xml | 52 +------ build/package.xml | 2 +- 4 files changed, 272 insertions(+), 51 deletions(-) create mode 100755 build/build-cloud-plugins.xml diff --git a/build.xml b/build.xml index e9e4bef6145..4004117931a 100755 --- a/build.xml +++ b/build.xml @@ -21,6 +21,7 @@ + diff --git a/build/build-cloud-plugins.xml b/build/build-cloud-plugins.xml new file mode 100755 index 00000000000..a21a4c3f4f5 --- /dev/null +++ b/build/build-cloud-plugins.xml @@ -0,0 +1,268 @@ + + + + + + + + + + + + + Cloud Stack ant build file for building all the plugins + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/build-cloud.xml b/build/build-cloud.xml index f95768a489c..b8ad09edc30 100755 --- a/build/build-cloud.xml +++ b/build/build-cloud.xml @@ -586,58 +586,10 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/package.xml b/build/package.xml index 0c2ca3a9b4b..2b5a74b123a 100755 --- a/build/package.xml +++ b/build/package.xml @@ -156,7 +156,7 @@ - + From 4e9a97177f5b8cb94d18139e0513b870ede895a7 Mon Sep 17 00:00:00 2001 From: bfederle Date: Tue, 26 Jun 2012 13:43:16 -0700 Subject: [PATCH 12/37] CS-15290: Fix 'Path' field validation Original patch by: olga.smola reviewed-by: brian --- ui/scripts/system.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 541aabc45d0..6d3b765871a 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7535,7 +7535,8 @@ //$('li[input_group="nfs"]', $dialogAddPool).show(); $form.find('.form-item[rel=path]').css('display', 'inline-block'); //$dialogAddPool.find("#add_pool_path_container").find("label").text(g_dictionary["label.path"]+":"); - $form.find('.form-item[rel=path]').find(".name").find("label").text("Path:"); + var $required = $form.find('.form-item[rel=path]').find(".name").find("label span"); + $form.find('.form-item[rel=path]').find(".name").find("label").text("Path:").prepend($required); //$('li[input_group="iscsi"]', $dialogAddPool).hide(); $form.find('.form-item[rel=iqn]').hide(); @@ -7557,7 +7558,8 @@ //$('li[input_group="nfs"]', $dialogAddPool).show(); $form.find('.form-item[rel=path]').css('display', 'inline-block'); //$dialogAddPool.find("#add_pool_path_container").find("label").text(g_dictionary["label.path"]+":"); - $form.find('.form-item[rel=path]').find(".name").find("label").text("Path:"); + var $required = $form.find('.form-item[rel=path]').find(".name").find("label span"); + $form.find('.form-item[rel=path]').find(".name").find("label").text("Path:").prepend($required); //$('li[input_group="iscsi"]', $dialogAddPool).hide(); $form.find('.form-item[rel=iqn]').hide(); @@ -7578,8 +7580,9 @@ //$('li[input_group="nfs"]', $dialogAddPool).show(); $form.find('.form-item[rel=path]').css('display', 'inline-block'); - //$dialogAddPool.find("#add_pool_path_container").find("label").text(g_dictionary["label.SR.name"]+":"); - $form.find('.form-item[rel=path]').find(".name").find("label").text("SR Name-Label:"); + //$dialogAddPool.find("#add_pool_path_container").find("label").text(g_dictionary["label.SR.name"]+":"); + var $required = $form.find('.form-item[rel=path]').find(".name").find("label span"); + $form.find('.form-item[rel=path]').find(".name").find("label").text("SR Name-Label:").prepend($required); //$('li[input_group="iscsi"]', $dialogAddPool).hide(); $form.find('.form-item[rel=iqn]').hide(); @@ -7660,7 +7663,8 @@ //$('li[input_group="nfs"]', $dialogAddPool).show(); $form.find('.form-item[rel=path]').css('display', 'inline-block'); - $form.find('.form-item[rel=path]').find(".name").find("label").text("Path:"); + var $required = $form.find('.form-item[rel=path]').find(".name").find("label span"); + $form.find('.form-item[rel=path]').find(".name").find("label").text("Path:").prepend($required); //$('li[input_group="iscsi"]', $dialogAddPool).hide(); $form.find('.form-item[rel=iqn]').hide(); From eb5e02e4e1fde8f196dd0a27aa33def590df2dd8 Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Tue, 26 Jun 2012 14:18:42 -0700 Subject: [PATCH 13/37] moving out MD5 authenticator to plugins/user-authenticators --- build/build-cloud-plugins.xml | 8 +- plugins/user-authenticators/md5/.classpath | 10 ++ plugins/user-authenticators/md5/.project | 17 +++ plugins/user-authenticators/md5/build.xml | 128 ++++++++++++++++++ .../server/auth/MD5UserAuthenticator.java | 0 5 files changed, 161 insertions(+), 2 deletions(-) create mode 100755 plugins/user-authenticators/md5/.classpath create mode 100755 plugins/user-authenticators/md5/.project create mode 100755 plugins/user-authenticators/md5/build.xml rename {server => plugins/user-authenticators/md5}/src/com/cloud/server/auth/MD5UserAuthenticator.java (100%) diff --git a/build/build-cloud-plugins.xml b/build/build-cloud-plugins.xml index a21a4c3f4f5..fad40908ae4 100755 --- a/build/build-cloud-plugins.xml +++ b/build/build-cloud-plugins.xml @@ -236,14 +236,18 @@ - - + + + + + + diff --git a/plugins/user-authenticators/md5/.classpath b/plugins/user-authenticators/md5/.classpath new file mode 100755 index 00000000000..e39771ada09 --- /dev/null +++ b/plugins/user-authenticators/md5/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/plugins/user-authenticators/md5/.project b/plugins/user-authenticators/md5/.project new file mode 100755 index 00000000000..2565593397d --- /dev/null +++ b/plugins/user-authenticators/md5/.project @@ -0,0 +1,17 @@ + + + md5-user-authenticator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/user-authenticators/md5/build.xml b/plugins/user-authenticators/md5/build.xml new file mode 100755 index 00000000000..eee2fc70bff --- /dev/null +++ b/plugins/user-authenticators/md5/build.xml @@ -0,0 +1,128 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/server/auth/MD5UserAuthenticator.java b/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java similarity index 100% rename from server/src/com/cloud/server/auth/MD5UserAuthenticator.java rename to plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java From 3ceb8d5667cdc827ff285247189c239c70a46b59 Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Tue, 26 Jun 2012 14:33:27 -0700 Subject: [PATCH 14/37] moving out plaintext authenticator to plugins/user-authenticators --- build/build-cloud-plugins.xml | 14 +- .../user-authenticators/plain-text/.classpath | 10 + .../user-authenticators/plain-text/.project | 17 ++ .../user-authenticators/plain-text/build.xml | 128 +++++++++++++ .../auth/PlainTextUserAuthenticator.java | 174 +++++++++--------- 5 files changed, 252 insertions(+), 91 deletions(-) create mode 100755 plugins/user-authenticators/plain-text/.classpath create mode 100755 plugins/user-authenticators/plain-text/.project create mode 100755 plugins/user-authenticators/plain-text/build.xml rename {server => plugins/user-authenticators/plain-text}/src/com/cloud/server/auth/PlainTextUserAuthenticator.java (97%) diff --git a/build/build-cloud-plugins.xml b/build/build-cloud-plugins.xml index fad40908ae4..efd84334213 100755 --- a/build/build-cloud-plugins.xml +++ b/build/build-cloud-plugins.xml @@ -236,19 +236,25 @@ - - + + - + - + + + + + + + diff --git a/plugins/user-authenticators/plain-text/.classpath b/plugins/user-authenticators/plain-text/.classpath new file mode 100755 index 00000000000..e39771ada09 --- /dev/null +++ b/plugins/user-authenticators/plain-text/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/plugins/user-authenticators/plain-text/.project b/plugins/user-authenticators/plain-text/.project new file mode 100755 index 00000000000..98414afbab5 --- /dev/null +++ b/plugins/user-authenticators/plain-text/.project @@ -0,0 +1,17 @@ + + + plaintext-user-authenticator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/user-authenticators/plain-text/build.xml b/plugins/user-authenticators/plain-text/build.xml new file mode 100755 index 00000000000..a59bb5d9e65 --- /dev/null +++ b/plugins/user-authenticators/plain-text/build.xml @@ -0,0 +1,128 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/server/auth/PlainTextUserAuthenticator.java b/plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java similarity index 97% rename from server/src/com/cloud/server/auth/PlainTextUserAuthenticator.java rename to plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java index 11de1e76632..f05a8cd815f 100644 --- a/server/src/com/cloud/server/auth/PlainTextUserAuthenticator.java +++ b/plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java @@ -1,87 +1,87 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.server.auth; - -import java.math.BigInteger; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Map; - -import javax.ejb.Local; -import javax.naming.ConfigurationException; - -import org.apache.log4j.Logger; - -import com.cloud.server.ManagementServer; -import com.cloud.user.UserAccount; -import com.cloud.user.dao.UserAccountDao; -import com.cloud.utils.component.ComponentLocator; -import com.cloud.utils.exception.CloudRuntimeException; - - -@Local(value={UserAuthenticator.class}) -public class PlainTextUserAuthenticator extends DefaultUserAuthenticator { - public static final Logger s_logger = Logger.getLogger(PlainTextUserAuthenticator.class); - - private UserAccountDao _userAccountDao; - - @Override - public boolean authenticate(String username, String password, Long domainId, Map requestParameters ) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Retrieving user: " + username); - } - UserAccount user = _userAccountDao.getUserAccount(username, domainId); - if (user == null) { - s_logger.debug("Unable to find user with " + username + " in domain " + domainId); - return false; - } - - - MessageDigest md5; - try { - md5 = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - throw new CloudRuntimeException("Error", e); - } - md5.reset(); - BigInteger pwInt = new BigInteger(1, md5.digest(password.getBytes())); - - // make sure our MD5 hash value is 32 digits long... - StringBuffer sb = new StringBuffer(); - String pwStr = pwInt.toString(16); - int padding = 32 - pwStr.length(); - for (int i = 0; i < padding; i++) { - sb.append('0'); - } - sb.append(pwStr); - - - // Will: The MD5Authenticator is now a straight pass-through comparison of the - // the passwords because we will not assume that the password passed in has - // already been MD5 hashed. I am keeping the above code in case this requirement changes - // or people need examples of how to MD5 hash passwords in java. - if (!user.getPassword().equals(sb.toString())) { - s_logger.debug("Password does not match"); - return false; - } - return true; - } - - public boolean configure(String name, Map params) - throws ConfigurationException { - super.configure(name, params); - ComponentLocator locator = ComponentLocator.getLocator(ManagementServer.Name); - _userAccountDao = locator.getDao(UserAccountDao.class); - return true; - } -} +// Copyright 2012 Citrix Systems, Inc. Licensed under the +// Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. Citrix Systems, Inc. +// reserves all rights not expressly granted by the License. +// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Automatically generated by addcopyright.py at 04/03/2012 +package com.cloud.server.auth; + +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Map; + +import javax.ejb.Local; +import javax.naming.ConfigurationException; + +import org.apache.log4j.Logger; + +import com.cloud.server.ManagementServer; +import com.cloud.user.UserAccount; +import com.cloud.user.dao.UserAccountDao; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.exception.CloudRuntimeException; + + +@Local(value={UserAuthenticator.class}) +public class PlainTextUserAuthenticator extends DefaultUserAuthenticator { + public static final Logger s_logger = Logger.getLogger(PlainTextUserAuthenticator.class); + + private UserAccountDao _userAccountDao; + + @Override + public boolean authenticate(String username, String password, Long domainId, Map requestParameters ) { + if (s_logger.isDebugEnabled()) { + s_logger.debug("Retrieving user: " + username); + } + UserAccount user = _userAccountDao.getUserAccount(username, domainId); + if (user == null) { + s_logger.debug("Unable to find user with " + username + " in domain " + domainId); + return false; + } + + + MessageDigest md5; + try { + md5 = MessageDigest.getInstance("MD5"); + } catch (NoSuchAlgorithmException e) { + throw new CloudRuntimeException("Error", e); + } + md5.reset(); + BigInteger pwInt = new BigInteger(1, md5.digest(password.getBytes())); + + // make sure our MD5 hash value is 32 digits long... + StringBuffer sb = new StringBuffer(); + String pwStr = pwInt.toString(16); + int padding = 32 - pwStr.length(); + for (int i = 0; i < padding; i++) { + sb.append('0'); + } + sb.append(pwStr); + + + // Will: The MD5Authenticator is now a straight pass-through comparison of the + // the passwords because we will not assume that the password passed in has + // already been MD5 hashed. I am keeping the above code in case this requirement changes + // or people need examples of how to MD5 hash passwords in java. + if (!user.getPassword().equals(sb.toString())) { + s_logger.debug("Password does not match"); + return false; + } + return true; + } + + public boolean configure(String name, Map params) + throws ConfigurationException { + super.configure(name, params); + ComponentLocator locator = ComponentLocator.getLocator(ManagementServer.Name); + _userAccountDao = locator.getDao(UserAccountDao.class); + return true; + } +} From cefbbb385086a8cd536ca8c7ca43355e651204cb Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Tue, 26 Jun 2012 15:17:25 -0700 Subject: [PATCH 15/37] moving random storage allocator to plugins/storage-allocators --- build/build-cloud-plugins.xml | 15 +- plugins/storage-allocators/random/.classpath | 10 ++ plugins/storage-allocators/random/.project | 17 +++ plugins/storage-allocators/random/build.xml | 128 ++++++++++++++++++ .../allocator/RandomStoragePoolAllocator.java | 0 5 files changed, 168 insertions(+), 2 deletions(-) create mode 100755 plugins/storage-allocators/random/.classpath create mode 100755 plugins/storage-allocators/random/.project create mode 100755 plugins/storage-allocators/random/build.xml rename {server => plugins/storage-allocators/random}/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java (100%) diff --git a/build/build-cloud-plugins.xml b/build/build-cloud-plugins.xml index efd84334213..7c13c8759fe 100755 --- a/build/build-cloud-plugins.xml +++ b/build/build-cloud-plugins.xml @@ -184,9 +184,9 @@ - + - + @@ -234,6 +234,17 @@ + + + + + + + + + + + diff --git a/plugins/storage-allocators/random/.classpath b/plugins/storage-allocators/random/.classpath new file mode 100755 index 00000000000..e39771ada09 --- /dev/null +++ b/plugins/storage-allocators/random/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/plugins/storage-allocators/random/.project b/plugins/storage-allocators/random/.project new file mode 100755 index 00000000000..cdb8361d0bd --- /dev/null +++ b/plugins/storage-allocators/random/.project @@ -0,0 +1,17 @@ + + + random-storage-allocator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/storage-allocators/random/build.xml b/plugins/storage-allocators/random/build.xml new file mode 100755 index 00000000000..e5fcebebbc8 --- /dev/null +++ b/plugins/storage-allocators/random/build.xml @@ -0,0 +1,128 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java b/plugins/storage-allocators/random/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java similarity index 100% rename from server/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java rename to plugins/storage-allocators/random/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java From 367e32adbc294c52a991866d1cf6e94b3d473201 Mon Sep 17 00:00:00 2001 From: olgasmola Date: Mon, 25 Jun 2012 14:41:47 +0300 Subject: [PATCH 16/37] CS-15329: Instances with Error states appear in Instances list after creating. --- ui/scripts/instances.js | 15 ++++++++++++++- ui/scripts/sharedFunctions.js | 9 ++++++++- ui/scripts/ui/widgets/listView.js | 12 +++++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index 4a143607cf2..969a6572a96 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -541,6 +541,7 @@ dataType: "json", success: function(json) { var jid = json.deployvirtualmachineresponse.jobid; + var vmid = json.deployvirtualmachineresponse.id; args.response.success( {_custom: {jobId: jid, @@ -552,7 +553,19 @@ }, getActionFilter: function() { return vmActionfilter; - } + }, + getUpdatedData: function() { + var item; + $.ajax({ + url: createURL("listVirtualMachines&id="+vmid), + dataType: "json", + async: false, + success: function(json) { + item = json.listvirtualmachinesresponse.virtualmachine[0]; + } + }); + return item; + } } } ); diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index b1d771c67f2..8fc5c78a796 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -86,7 +86,14 @@ var pollAsyncJobResult = function(args) { } else if (result.jobstatus == 2) { // Failed var msg = (result.jobresult.errortext == null)? "": result.jobresult.errortext; - args.error({message: msg}); + if (args._custom.getUpdatedData != null && args._custom.getActionFilter != null) { + args.error({message: msg, updatedData: args._custom.getUpdatedData(), actionFilter: args._custom.getActionFilter()}); + } else if (args._custom.getUpdatedData != null && args._custom.getActionFilter == null) { + args.error({message: msg, updatedData: args._custom.getUpdatedData()}); + } + else { + args.error({message: msg}); + } } } }, diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js index 92a862428a4..c893b1fd5ed 100644 --- a/ui/scripts/ui/widgets/listView.js +++ b/ui/scripts/ui/widgets/listView.js @@ -97,7 +97,17 @@ // Error function(args) { - $item.remove(); + if (args && args.updatedData) { + if ($item.is(':visible') && !isHeader) { + replaceItem( + $item, + args.updatedData, + args.actionFilter + ); + } + } else { + $item.remove(); + } } ); } From 550b22576f1566248c1fc25d2566745ae4d6017c Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Tue, 26 Jun 2012 16:41:10 -0700 Subject: [PATCH 17/37] Moving out XenServer support code into plugins/hypervisors/xen --- build/build-cloud-plugins.xml | 10 +- plugins/hypervisors/xen/.classpath | 11 ++ plugins/hypervisors/xen/.project | 23 +++ plugins/hypervisors/xen/build.xml | 135 ++++++++++++++++++ .../src/com/cloud/ha/XenServerFencer.java | 0 .../com/cloud/hypervisor/XenServerGuru.java | 0 .../xen/discoverer/XcpServerDiscoverer.java | 0 .../hypervisor/xen/resource/CitrixHelper.java | 0 .../xen/resource/CitrixResourceBase.java | 0 .../xen/resource/XcpServerResource.java | 0 .../xen/resource/XenServer56FP1Resource.java | 0 .../xen/resource/XenServer56Resource.java | 0 .../xen/resource/XenServer56SP2Resource.java | 0 .../xen/resource/XenServer600Resource.java | 0 .../xen/resource/XenServer602Resource.java | 0 .../xen/resource/XenServerConnectionPool.java | 0 .../xen/resource/XenServerPoolVms.java | 0 .../baremetal/BareMetalResourceBase.java | 1 - .../migration/Db21to22MigrationUtil.java | 6 +- 19 files changed, 182 insertions(+), 4 deletions(-) create mode 100755 plugins/hypervisors/xen/.classpath create mode 100755 plugins/hypervisors/xen/.project create mode 100755 plugins/hypervisors/xen/build.xml rename {server => plugins/hypervisors/xen}/src/com/cloud/ha/XenServerFencer.java (100%) rename {server => plugins/hypervisors/xen}/src/com/cloud/hypervisor/XenServerGuru.java (100%) rename {server => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java (100%) rename {core => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java (100%) rename {core => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java (100%) rename {core => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java (100%) rename {core => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java (100%) rename {core => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java (100%) rename {core => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java (100%) rename {core => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java (100%) rename {core => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java (100%) rename {core => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java (100%) rename {core => plugins/hypervisors/xen}/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java (100%) diff --git a/build/build-cloud-plugins.xml b/build/build-cloud-plugins.xml index 7c13c8759fe..0ca33964895 100755 --- a/build/build-cloud-plugins.xml +++ b/build/build-cloud-plugins.xml @@ -198,8 +198,8 @@ - - + + @@ -207,6 +207,12 @@ + + + + + + diff --git a/plugins/hypervisors/xen/.classpath b/plugins/hypervisors/xen/.classpath new file mode 100755 index 00000000000..264f1700606 --- /dev/null +++ b/plugins/hypervisors/xen/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/plugins/hypervisors/xen/.project b/plugins/hypervisors/xen/.project new file mode 100755 index 00000000000..de9e357ff0e --- /dev/null +++ b/plugins/hypervisors/xen/.project @@ -0,0 +1,23 @@ + + + Xen + + + + + + org.python.pydev.PyDevBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + org.python.pydev.pythonNature + + diff --git a/plugins/hypervisors/xen/build.xml b/plugins/hypervisors/xen/build.xml new file mode 100755 index 00000000000..377d6b77a3d --- /dev/null +++ b/plugins/hypervisors/xen/build.xml @@ -0,0 +1,135 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/ha/XenServerFencer.java b/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java similarity index 100% rename from server/src/com/cloud/ha/XenServerFencer.java rename to plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java diff --git a/server/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java similarity index 100% rename from server/src/com/cloud/hypervisor/XenServerGuru.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java diff --git a/server/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java similarity index 100% rename from server/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java similarity index 100% rename from core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java rename to plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java diff --git a/server/src/com/cloud/baremetal/BareMetalResourceBase.java b/server/src/com/cloud/baremetal/BareMetalResourceBase.java index 7b4556c4f1b..7aa8f37bb8f 100755 --- a/server/src/com/cloud/baremetal/BareMetalResourceBase.java +++ b/server/src/com/cloud/baremetal/BareMetalResourceBase.java @@ -53,7 +53,6 @@ import com.cloud.api.ApiConstants; import com.cloud.host.Host.Type; import com.cloud.hypervisor.Hypervisor; import com.cloud.hypervisor.kvm.resource.KvmDummyResourceBase; -import com.cloud.hypervisor.xen.resource.CitrixResourceBase; import com.cloud.resource.ServerResource; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.script.OutputInterpreter; diff --git a/server/src/com/cloud/migration/Db21to22MigrationUtil.java b/server/src/com/cloud/migration/Db21to22MigrationUtil.java index 3625b19227a..7f4cdb51b35 100755 --- a/server/src/com/cloud/migration/Db21to22MigrationUtil.java +++ b/server/src/com/cloud/migration/Db21to22MigrationUtil.java @@ -36,7 +36,6 @@ import com.cloud.domain.dao.DomainDao; import com.cloud.host.HostVO; import com.cloud.host.dao.HostDao; import com.cloud.hypervisor.Hypervisor.HypervisorType; -import com.cloud.hypervisor.xen.resource.XenServerConnectionPool; import com.cloud.resource.ResourceManager; import com.cloud.user.Account; import com.cloud.user.dao.AccountDao; @@ -81,6 +80,9 @@ public class Db21to22MigrationUtil { /* add guid in cluster table */ private void setupClusterGuid() { + + //FIXME moving out XenServer code out of server. This upgrade step need to be taken care of + /* XenServerConnectionPool _connPool = XenServerConnectionPool.getInstance(); List clusters = _clusterDao.listByHyTypeWithoutGuid(HypervisorType.XenServer.toString()); for (ClusterVO cluster : clusters) { @@ -114,8 +116,10 @@ public class Db21to22MigrationUtil { break; } } + */ } + /** * This method migrates the zones based on bug: 7204 * based on the param direct.attach.untagged.vlan.enabled, we update zone to basic or advanced for 2.2 From 8197f1f07c1dc6762ea60a06e7b9bbe65ba68857 Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Tue, 26 Jun 2012 19:48:55 -0700 Subject: [PATCH 18/37] moving out VMWAre and Nexus VSM support code into plugins/hypervisors/vmware --- build/build-cloud-plugins.xml | 9 +- client/tomcatconf/components.xml.in | 3 + .../hyperv/resource/HypervResource.java | 2 +- plugins/hypervisors/vmware/.classpath | 12 + plugins/hypervisors/vmware/.project | 23 + plugins/hypervisors/vmware/build.xml | 135 ++ .../api/commands/DeleteCiscoNexusVSMCmd.java | 0 .../api/commands/DisableCiscoNexusVSMCmd.java | 0 .../api/commands/EnableCiscoNexusVSMCmd.java | 0 .../api/commands/ListCiscoNexusVSMsCmd.java | 0 .../api/response/CiscoNexusVSMResponse.java | 0 .../src/com/cloud/ha/VmwareFencer.java | 0 .../src/com/cloud/ha/VmwareInvestigator.java | 0 .../com/cloud/hypervisor/guru/VMwareGuru.java | 0 .../hypervisor/vmware/VmwareCleanupMaid.java | 0 .../vmware/VmwareServerDiscoverer.java | 386 +++--- .../vmware/manager/VmwareHostService.java | 0 .../vmware/manager/VmwareManager.java | 0 .../vmware/manager}/VmwareManagerImpl.java | 5 +- .../vmware/manager/VmwareStorageManager.java | 0 .../manager/VmwareStorageManagerImpl.java | 160 +-- .../vmware/manager/VmwareStorageMount.java | 0 .../vmware/resource/VmwareContextFactory.java | 0 .../vmware/resource/VmwareResource.java | 1107 +++++++++-------- .../cloud/network/CiscoNexusVSMDevice.java | 112 +- .../CiscoNexusVSMDeviceManagerImpl.java | 95 +- .../cloud/network/CiscoNexusVSMDeviceVO.java | 0 .../network/dao/CiscoNexusVSMDeviceDao.java | 0 .../dao/CiscoNexusVSMDeviceDaoImpl.java | 0 .../network/element/CiscoNexusVSMElement.java | 0 .../element/CiscoNexusVSMElementService.java | 0 .../PremiumSecondaryStorageResource.java | 0 .../VmwareSecondaryStorageContextFactory.java | 0 ...VmwareSecondaryStorageResourceHandler.java | 0 .../DefaultComponentLibrary.java | 5 - .../PremiumComponentLibrary.java | 2 - .../cloud/resource/ResourceManagerImpl.java | 95 -- .../src/com/cloud/utils/ssh}/SshHelper.java | 2 +- 38 files changed, 1162 insertions(+), 991 deletions(-) create mode 100755 plugins/hypervisors/vmware/.classpath create mode 100755 plugins/hypervisors/vmware/.project create mode 100755 plugins/hypervisors/vmware/build.xml rename {server => plugins/hypervisors/vmware}/src/com/cloud/api/commands/DeleteCiscoNexusVSMCmd.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/api/commands/DisableCiscoNexusVSMCmd.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/api/commands/EnableCiscoNexusVSMCmd.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/api/commands/ListCiscoNexusVSMsCmd.java (100%) rename {api => plugins/hypervisors/vmware}/src/com/cloud/api/response/CiscoNexusVSMResponse.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/ha/VmwareFencer.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/ha/VmwareInvestigator.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/hypervisor/guru/VMwareGuru.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java (98%) rename {core => plugins/hypervisors/vmware}/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java (100%) rename {core => plugins/hypervisors/vmware}/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java (100%) rename {server/src/com/cloud/hypervisor/vmware => plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager}/VmwareManagerImpl.java (99%) rename {core => plugins/hypervisors/vmware}/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java (100%) rename {core => plugins/hypervisors/vmware}/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java (99%) rename {core => plugins/hypervisors/vmware}/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java (100%) rename {core => plugins/hypervisors/vmware}/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java (100%) rename {core => plugins/hypervisors/vmware}/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java (99%) rename {api => plugins/hypervisors/vmware}/src/com/cloud/network/CiscoNexusVSMDevice.java (97%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java (72%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/network/CiscoNexusVSMDeviceVO.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/network/element/CiscoNexusVSMElement.java (100%) rename {server => plugins/hypervisors/vmware}/src/com/cloud/network/element/CiscoNexusVSMElementService.java (100%) rename {core => plugins/hypervisors/vmware}/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java (100%) rename {core => plugins/hypervisors/vmware}/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java (100%) rename {core => plugins/hypervisors/vmware}/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java (100%) rename {core/src/com/cloud/hypervisor/vmware/resource => utils/src/com/cloud/utils/ssh}/SshHelper.java (99%) diff --git a/build/build-cloud-plugins.xml b/build/build-cloud-plugins.xml index 0ca33964895..53dc1d34d85 100755 --- a/build/build-cloud-plugins.xml +++ b/build/build-cloud-plugins.xml @@ -198,8 +198,8 @@ - - + + @@ -212,6 +212,11 @@ + + + + + diff --git a/client/tomcatconf/components.xml.in b/client/tomcatconf/components.xml.in index 58541a59606..5add24cfd55 100755 --- a/client/tomcatconf/components.xml.in +++ b/client/tomcatconf/components.xml.in @@ -157,11 +157,14 @@ + + + diff --git a/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java b/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java index 6f47b547182..868a81e4b82 100755 --- a/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java +++ b/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java @@ -96,7 +96,7 @@ import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.agent.api.to.VolumeTO; import com.cloud.host.Host.Type; import com.cloud.hypervisor.Hypervisor.HypervisorType; -import com.cloud.hypervisor.vmware.resource.SshHelper; +import com.cloud.utils.ssh.SshHelper; import com.cloud.resource.ServerResource; import com.cloud.resource.ServerResourceBase; import com.cloud.serializer.GsonHelper; diff --git a/plugins/hypervisors/vmware/.classpath b/plugins/hypervisors/vmware/.classpath new file mode 100755 index 00000000000..74eb425c5d7 --- /dev/null +++ b/plugins/hypervisors/vmware/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/plugins/hypervisors/vmware/.project b/plugins/hypervisors/vmware/.project new file mode 100755 index 00000000000..f53a2a299a5 --- /dev/null +++ b/plugins/hypervisors/vmware/.project @@ -0,0 +1,23 @@ + + + vmware + + + + + + org.python.pydev.PyDevBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + org.python.pydev.pythonNature + + diff --git a/plugins/hypervisors/vmware/build.xml b/plugins/hypervisors/vmware/build.xml new file mode 100755 index 00000000000..f6bcd435ae4 --- /dev/null +++ b/plugins/hypervisors/vmware/build.xml @@ -0,0 +1,135 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/api/commands/DeleteCiscoNexusVSMCmd.java b/plugins/hypervisors/vmware/src/com/cloud/api/commands/DeleteCiscoNexusVSMCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/DeleteCiscoNexusVSMCmd.java rename to plugins/hypervisors/vmware/src/com/cloud/api/commands/DeleteCiscoNexusVSMCmd.java diff --git a/server/src/com/cloud/api/commands/DisableCiscoNexusVSMCmd.java b/plugins/hypervisors/vmware/src/com/cloud/api/commands/DisableCiscoNexusVSMCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/DisableCiscoNexusVSMCmd.java rename to plugins/hypervisors/vmware/src/com/cloud/api/commands/DisableCiscoNexusVSMCmd.java diff --git a/server/src/com/cloud/api/commands/EnableCiscoNexusVSMCmd.java b/plugins/hypervisors/vmware/src/com/cloud/api/commands/EnableCiscoNexusVSMCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/EnableCiscoNexusVSMCmd.java rename to plugins/hypervisors/vmware/src/com/cloud/api/commands/EnableCiscoNexusVSMCmd.java diff --git a/server/src/com/cloud/api/commands/ListCiscoNexusVSMsCmd.java b/plugins/hypervisors/vmware/src/com/cloud/api/commands/ListCiscoNexusVSMsCmd.java similarity index 100% rename from server/src/com/cloud/api/commands/ListCiscoNexusVSMsCmd.java rename to plugins/hypervisors/vmware/src/com/cloud/api/commands/ListCiscoNexusVSMsCmd.java diff --git a/api/src/com/cloud/api/response/CiscoNexusVSMResponse.java b/plugins/hypervisors/vmware/src/com/cloud/api/response/CiscoNexusVSMResponse.java similarity index 100% rename from api/src/com/cloud/api/response/CiscoNexusVSMResponse.java rename to plugins/hypervisors/vmware/src/com/cloud/api/response/CiscoNexusVSMResponse.java diff --git a/server/src/com/cloud/ha/VmwareFencer.java b/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareFencer.java similarity index 100% rename from server/src/com/cloud/ha/VmwareFencer.java rename to plugins/hypervisors/vmware/src/com/cloud/ha/VmwareFencer.java diff --git a/server/src/com/cloud/ha/VmwareInvestigator.java b/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareInvestigator.java similarity index 100% rename from server/src/com/cloud/ha/VmwareInvestigator.java rename to plugins/hypervisors/vmware/src/com/cloud/ha/VmwareInvestigator.java diff --git a/server/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java similarity index 100% rename from server/src/com/cloud/hypervisor/guru/VMwareGuru.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java diff --git a/server/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java similarity index 100% rename from server/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java diff --git a/server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java similarity index 98% rename from server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java index 65a10688608..af53daded02 100755 --- a/server/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java @@ -10,8 +10,8 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.hypervisor.vmware; - +package com.cloud.hypervisor.vmware; + import java.net.URI; import java.net.URLDecoder; import java.util.HashMap; @@ -64,42 +64,42 @@ import com.cloud.utils.component.ComponentLocator; import com.cloud.utils.component.Inject; import com.vmware.vim25.ClusterDasConfigInfo; import com.vmware.vim25.ManagedObjectReference; - -@Local(value=Discoverer.class) -public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter { - private static final Logger s_logger = Logger.getLogger(VmwareServerDiscoverer.class); - - @Inject ClusterDao _clusterDao; - @Inject VmwareManager _vmwareMgr; - @Inject AlertManager _alertMgr; - @Inject VMTemplateDao _tmpltDao; + +@Local(value=Discoverer.class) +public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter { + private static final Logger s_logger = Logger.getLogger(VmwareServerDiscoverer.class); + + @Inject ClusterDao _clusterDao; + @Inject VmwareManager _vmwareMgr; + @Inject AlertManager _alertMgr; + @Inject VMTemplateDao _tmpltDao; @Inject ClusterDetailsDao _clusterDetailsDao; @Inject HostDao _hostDao; @Inject - DataCenterDao _dcDao; + DataCenterDao _dcDao; @Inject ResourceManager _resourceMgr; @Inject CiscoNexusVSMDeviceDao _nexusDao; @Inject NetworkManager _netmgr; - - @Override - public Map> find(long dcId, Long podId, Long clusterId, URI url, - String username, String password, List hostTags) throws DiscoveryException { - - if(s_logger.isInfoEnabled()) - s_logger.info("Discover host. dc: " + dcId + ", pod: " + podId + ", cluster: " + clusterId + ", uri host: " + url.getHost()); - - if(podId == null) { - if(s_logger.isInfoEnabled()) - s_logger.info("No pod is assigned, assuming that it is not for vmware and skip it to next discoverer"); - return null; - } - - ClusterVO cluster = _clusterDao.findById(clusterId); - if(cluster == null || cluster.getHypervisorType() != HypervisorType.VMware) { - if(s_logger.isInfoEnabled()) - s_logger.info("invalid cluster id or cluster is not for VMware hypervisors"); - return null; + + @Override + public Map> find(long dcId, Long podId, Long clusterId, URI url, + String username, String password, List hostTags) throws DiscoveryException { + + if(s_logger.isInfoEnabled()) + s_logger.info("Discover host. dc: " + dcId + ", pod: " + podId + ", cluster: " + clusterId + ", uri host: " + url.getHost()); + + if(podId == null) { + if(s_logger.isInfoEnabled()) + s_logger.info("No pod is assigned, assuming that it is not for vmware and skip it to next discoverer"); + return null; + } + + ClusterVO cluster = _clusterDao.findById(clusterId); + if(cluster == null || cluster.getHypervisorType() != HypervisorType.VMware) { + if(s_logger.isInfoEnabled()) + s_logger.info("invalid cluster id or cluster is not for VMware hypervisors"); + return null; } List hosts = _resourceMgr.listAllHostsInCluster(clusterId); @@ -135,9 +135,9 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer } vsmCredentials = _vmwareMgr.getNexusVSMCredentialsByClusterId(clusterId); } - - VmwareContext context = null; - try { + + VmwareContext context = null; + try { context = VmwareContextFactory.create(url.getHost(), username, password); if (privateTrafficLabel != null) context.registerStockObject("privateTrafficLabel", privateTrafficLabel); @@ -147,64 +147,64 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer s_logger.info("Stocking credentials of Nexus VSM"); context.registerStockObject("vsmcredentials", vsmCredentials); } - } - List morHosts = _vmwareMgr.addHostToPodCluster(context, dcId, podId, clusterId, + } + List morHosts = _vmwareMgr.addHostToPodCluster(context, dcId, podId, clusterId, URLDecoder.decode(url.getPath())); if (morHosts == null) s_logger.info("Found 0 hosts."); if (privateTrafficLabel != null) context.uregisterStockObject("privateTrafficLabel"); - - if(morHosts == null) { - s_logger.error("Unable to find host or cluster based on url: " + URLDecoder.decode(url.getPath())); - return null; - } - - ManagedObjectReference morCluster = null; - Map clusterDetails = _clusterDetailsDao.findDetails(clusterId); - if(clusterDetails.get("url") != null) { - URI uriFromCluster = new URI(UriUtils.encodeURIComponent(clusterDetails.get("url"))); - morCluster = context.getHostMorByPath(URLDecoder.decode(uriFromCluster.getPath())); - - if(morCluster == null || !morCluster.getType().equalsIgnoreCase("ClusterComputeResource")) { - s_logger.warn("Cluster url does not point to a valid vSphere cluster, url: " + clusterDetails.get("url")); - return null; - } else { - ClusterMO clusterMo = new ClusterMO(context, morCluster); - ClusterDasConfigInfo dasConfig = clusterMo.getDasConfig(); - if(dasConfig != null && dasConfig.getEnabled() != null && dasConfig.getEnabled().booleanValue()) { - clusterDetails.put("NativeHA", "true"); - _clusterDetailsDao.persist(clusterId, clusterDetails); - } - } - } - - if(!validateDiscoveredHosts(context, morCluster, morHosts)) { - if(morCluster == null) - s_logger.warn("The discovered host is not standalone host, can not be added to a standalone cluster"); - else - s_logger.warn("The discovered host does not belong to the cluster"); - return null; - } - - Map> resources = new HashMap>(); - for(ManagedObjectReference morHost : morHosts) { - Map details = new HashMap(); - Map params = new HashMap(); - - HostMO hostMo = new HostMO(context, morHost); - details.put("url", hostMo.getHostName()); - details.put("username", username); - details.put("password", password); - String guid = morHost.getType() + ":" + morHost.get_value() + "@"+ url.getHost(); - details.put("guid", guid); - - params.put("url", hostMo.getHostName()); - params.put("username", username); - params.put("password", password); - params.put("zone", Long.toString(dcId)); - params.put("pod", Long.toString(podId)); - params.put("cluster", Long.toString(clusterId)); + + if(morHosts == null) { + s_logger.error("Unable to find host or cluster based on url: " + URLDecoder.decode(url.getPath())); + return null; + } + + ManagedObjectReference morCluster = null; + Map clusterDetails = _clusterDetailsDao.findDetails(clusterId); + if(clusterDetails.get("url") != null) { + URI uriFromCluster = new URI(UriUtils.encodeURIComponent(clusterDetails.get("url"))); + morCluster = context.getHostMorByPath(URLDecoder.decode(uriFromCluster.getPath())); + + if(morCluster == null || !morCluster.getType().equalsIgnoreCase("ClusterComputeResource")) { + s_logger.warn("Cluster url does not point to a valid vSphere cluster, url: " + clusterDetails.get("url")); + return null; + } else { + ClusterMO clusterMo = new ClusterMO(context, morCluster); + ClusterDasConfigInfo dasConfig = clusterMo.getDasConfig(); + if(dasConfig != null && dasConfig.getEnabled() != null && dasConfig.getEnabled().booleanValue()) { + clusterDetails.put("NativeHA", "true"); + _clusterDetailsDao.persist(clusterId, clusterDetails); + } + } + } + + if(!validateDiscoveredHosts(context, morCluster, morHosts)) { + if(morCluster == null) + s_logger.warn("The discovered host is not standalone host, can not be added to a standalone cluster"); + else + s_logger.warn("The discovered host does not belong to the cluster"); + return null; + } + + Map> resources = new HashMap>(); + for(ManagedObjectReference morHost : morHosts) { + Map details = new HashMap(); + Map params = new HashMap(); + + HostMO hostMo = new HostMO(context, morHost); + details.put("url", hostMo.getHostName()); + details.put("username", username); + details.put("password", password); + String guid = morHost.getType() + ":" + morHost.get_value() + "@"+ url.getHost(); + details.put("guid", guid); + + params.put("url", hostMo.getHostName()); + params.put("username", username); + params.put("password", password); + params.put("zone", Long.toString(dcId)); + params.put("pod", Long.toString(podId)); + params.put("cluster", Long.toString(clusterId)); params.put("guid", guid); if (privateTrafficLabel != null) { params.put("private.network.vswitch.name", privateTrafficLabel); @@ -214,113 +214,113 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer } if (guestTrafficLabel != null) { params.put("guest.network.vswitch.name", guestTrafficLabel); - } - - VmwareResource resource = new VmwareResource(); - try { - resource.configure("VMware", params); - } catch (ConfigurationException e) { - _alertMgr.sendAlert(AlertManager.ALERT_TYPE_HOST, dcId, podId, "Unable to add " + url.getHost(), "Error is " + e.getMessage()); - s_logger.warn("Unable to instantiate " + url.getHost(), e); - } - resource.start(); - - resources.put(resource, details); - } - - // place a place holder guid derived from cluster ID - cluster.setGuid(UUID.nameUUIDFromBytes(String.valueOf(clusterId).getBytes()).toString()); - _clusterDao.update(clusterId, cluster); - - return resources; + } + + VmwareResource resource = new VmwareResource(); + try { + resource.configure("VMware", params); + } catch (ConfigurationException e) { + _alertMgr.sendAlert(AlertManager.ALERT_TYPE_HOST, dcId, podId, "Unable to add " + url.getHost(), "Error is " + e.getMessage()); + s_logger.warn("Unable to instantiate " + url.getHost(), e); + } + resource.start(); + + resources.put(resource, details); + } + + // place a place holder guid derived from cluster ID + cluster.setGuid(UUID.nameUUIDFromBytes(String.valueOf(clusterId).getBytes()).toString()); + _clusterDao.update(clusterId, cluster); + + return resources; } catch (DiscoveredWithErrorException e) { throw e; - } catch (Exception e) { - s_logger.warn("Unable to connect to Vmware vSphere server. service address: " + url.getHost()); - return null; - } finally { - if(context != null) - context.close(); - } - } - - private boolean validateDiscoveredHosts(VmwareContext context, ManagedObjectReference morCluster, List morHosts) throws Exception { - if(morCluster == null) { - for(ManagedObjectReference morHost : morHosts) { - ManagedObjectReference morParent = (ManagedObjectReference)context.getServiceUtil().getDynamicProperty(morHost, "parent"); - if(morParent.getType().equalsIgnoreCase("ClusterComputeResource")) - return false; - } - } else { - for(ManagedObjectReference morHost : morHosts) { - ManagedObjectReference morParent = (ManagedObjectReference)context.getServiceUtil().getDynamicProperty(morHost, "parent"); - if(!morParent.getType().equalsIgnoreCase("ClusterComputeResource")) - return false; - - if(!morParent.get_value().equals(morCluster.get_value())) - return false; - } - } - - return true; - } - - @Override - public void postDiscovery(List hosts, long msId) { - // do nothing - } - - @Override - public boolean matchHypervisor(String hypervisor) { - if(hypervisor == null) - return true; - - return Hypervisor.HypervisorType.VMware.toString().equalsIgnoreCase(hypervisor); - } - - @Override - public Hypervisor.HypervisorType getHypervisorType() { - return Hypervisor.HypervisorType.VMware; - } - - @Override - public boolean configure(String name, Map params) throws ConfigurationException { - if(s_logger.isInfoEnabled()) - s_logger.info("Configure VmwareServerDiscoverer, discover name: " + name); - - super.configure(name, params); - - ComponentLocator locator = ComponentLocator.getCurrentLocator(); - ConfigurationDao configDao = locator.getDao(ConfigurationDao.class); - if (configDao == null) { - throw new ConfigurationException("Unable to get the configuration dao."); - } - - createVmwareToolsIso(); - - if(s_logger.isInfoEnabled()) { + } catch (Exception e) { + s_logger.warn("Unable to connect to Vmware vSphere server. service address: " + url.getHost()); + return null; + } finally { + if(context != null) + context.close(); + } + } + + private boolean validateDiscoveredHosts(VmwareContext context, ManagedObjectReference morCluster, List morHosts) throws Exception { + if(morCluster == null) { + for(ManagedObjectReference morHost : morHosts) { + ManagedObjectReference morParent = (ManagedObjectReference)context.getServiceUtil().getDynamicProperty(morHost, "parent"); + if(morParent.getType().equalsIgnoreCase("ClusterComputeResource")) + return false; + } + } else { + for(ManagedObjectReference morHost : morHosts) { + ManagedObjectReference morParent = (ManagedObjectReference)context.getServiceUtil().getDynamicProperty(morHost, "parent"); + if(!morParent.getType().equalsIgnoreCase("ClusterComputeResource")) + return false; + + if(!morParent.get_value().equals(morCluster.get_value())) + return false; + } + } + + return true; + } + + @Override + public void postDiscovery(List hosts, long msId) { + // do nothing + } + + @Override + public boolean matchHypervisor(String hypervisor) { + if(hypervisor == null) + return true; + + return Hypervisor.HypervisorType.VMware.toString().equalsIgnoreCase(hypervisor); + } + + @Override + public Hypervisor.HypervisorType getHypervisorType() { + return Hypervisor.HypervisorType.VMware; + } + + @Override + public boolean configure(String name, Map params) throws ConfigurationException { + if(s_logger.isInfoEnabled()) + s_logger.info("Configure VmwareServerDiscoverer, discover name: " + name); + + super.configure(name, params); + + ComponentLocator locator = ComponentLocator.getCurrentLocator(); + ConfigurationDao configDao = locator.getDao(ConfigurationDao.class); + if (configDao == null) { + throw new ConfigurationException("Unable to get the configuration dao."); + } + + createVmwareToolsIso(); + + if(s_logger.isInfoEnabled()) { s_logger.info("VmwareServerDiscoverer has been successfully configured"); } - _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this); - return true; - } - - private void createVmwareToolsIso() { - String isoName = "vmware-tools.iso"; - VMTemplateVO tmplt = _tmpltDao.findByTemplateName(isoName); - Long id; - if (tmplt == null) { - id = _tmpltDao.getNextInSequence(Long.class, "id"); - VMTemplateVO template = new VMTemplateVO(id, isoName, isoName, ImageFormat.ISO, true, true, - TemplateType.PERHOST, null, null, true, 64, - Account.ACCOUNT_ID_SYSTEM, null, "VMware Tools Installer ISO", false, 1, false, HypervisorType.VMware); - _tmpltDao.persist(template); - } else { - id = tmplt.getId(); - tmplt.setTemplateType(TemplateType.PERHOST); - tmplt.setUrl(null); - _tmpltDao.update(id, tmplt); - } + _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this); + return true; + } + + private void createVmwareToolsIso() { + String isoName = "vmware-tools.iso"; + VMTemplateVO tmplt = _tmpltDao.findByTemplateName(isoName); + Long id; + if (tmplt == null) { + id = _tmpltDao.getNextInSequence(Long.class, "id"); + VMTemplateVO template = new VMTemplateVO(id, isoName, isoName, ImageFormat.ISO, true, true, + TemplateType.PERHOST, null, null, true, 64, + Account.ACCOUNT_ID_SYSTEM, null, "VMware Tools Installer ISO", false, 1, false, HypervisorType.VMware); + _tmpltDao.persist(template); + } else { + id = tmplt.getId(); + tmplt.setTemplateType(TemplateType.PERHOST); + tmplt.setUrl(null); + _tmpltDao.update(id, tmplt); + } } @Override @@ -359,6 +359,6 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer public boolean stop() { _resourceMgr.unregisterResourceStateAdapter(this.getClass().getSimpleName()); return super.stop(); - } -} - + } +} + diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java similarity index 100% rename from core/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java similarity index 100% rename from core/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java diff --git a/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java similarity index 99% rename from server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java index 90a040b2eb1..debb6fe38b2 100755 --- a/server/src/com/cloud/hypervisor/vmware/VmwareManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java @@ -10,7 +10,7 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.hypervisor.vmware; +package com.cloud.hypervisor.vmware.manager; import java.io.File; import java.io.IOException; @@ -54,6 +54,7 @@ import com.cloud.host.HostVO; import com.cloud.host.Status; import com.cloud.host.dao.HostDao; import com.cloud.hypervisor.Hypervisor.HypervisorType; +import com.cloud.hypervisor.vmware.VmwareCleanupMaid; import com.cloud.hypervisor.vmware.manager.VmwareManager; import com.cloud.hypervisor.vmware.manager.VmwareStorageManager; import com.cloud.hypervisor.vmware.manager.VmwareStorageManagerImpl; @@ -65,7 +66,7 @@ import com.cloud.hypervisor.vmware.mo.HypervisorHostHelper; import com.cloud.hypervisor.vmware.mo.TaskMO; import com.cloud.hypervisor.vmware.mo.VirtualEthernetCardType; import com.cloud.hypervisor.vmware.mo.VmwareHostType; -import com.cloud.hypervisor.vmware.resource.SshHelper; +import com.cloud.utils.ssh.SshHelper; import com.cloud.hypervisor.vmware.util.VmwareContext; import com.cloud.network.CiscoNexusVSMDeviceVO; import com.cloud.network.NetworkManager; diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java similarity index 100% rename from core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java similarity index 99% rename from core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java index afd13d106b3..b525e13654a 100644 --- a/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java @@ -123,11 +123,11 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { DatacenterMO dcMo = new DatacenterMO(context, hyperHost.getHyperHostDatacenter()); VirtualMachineMO templateMo = VmwareHelper.pickOneVmOnRunningHost(dcMo.findVmByNameAndLabel(templateUuidName), true); - - if (templateMo == null) { - if(s_logger.isInfoEnabled()) - s_logger.info("Template " + templateName + " is not setup yet, setup template from secondary storage with uuid name: " + templateUuidName); - ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPoolUuid()); + + if (templateMo == null) { + if(s_logger.isInfoEnabled()) + s_logger.info("Template " + templateName + " is not setup yet, setup template from secondary storage with uuid name: " + templateUuidName); + ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPoolUuid()); assert (morDs != null); DatastoreMO primaryStorageDatastoreMo = new DatastoreMO(context, morDs); @@ -171,8 +171,8 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { VmwareContext context = hostService.getServiceContext(cmd); VirtualMachineMO vmMo = null; - try { - VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd); + try { + VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd); morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPool().getUuid()); try { @@ -202,7 +202,7 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { // attach volume to worker VM String datastoreVolumePath = String.format("[%s] %s.vmdk", dsMo.getName(), volumePath); vmMo.attachDisk(new String[] { datastoreVolumePath }, morDs); - } + } } if (!vmMo.createSnapshot(snapshotUuid, "Snapshot taken for " + cmd.getSnapshotName(), false, false)) { @@ -340,79 +340,79 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { hyperHost, cmd, vmName, volumeId, cmd.getPool().getUuid(), volumePath, secondaryStorageURL, hostService.getWorkerName(context, cmd, 0)); - } else { - StorageFilerTO poolTO = cmd.getPool(); - - ManagedObjectReference morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, poolTO.getUuid()); - if (morDatastore == null) { - morDatastore = hyperHost.mountDatastore( - false, - poolTO.getHost(), 0, poolTO.getPath(), - poolTO.getUuid().replace("-", "")); - - if (morDatastore == null) { - throw new Exception("Unable to mount storage pool on host. storeUrl: " + poolTO.getHost() + ":/" + poolTO.getPath()); - } - } - - result = copyVolumeFromSecStorage( - hyperHost, volumeId, - new DatastoreMO(context, morDatastore), - secondaryStorageURL, volumePath); - } - return new CopyVolumeAnswer(cmd, true, null, result.first(), result.second()); - } catch (Throwable e) { - if (e instanceof RemoteException) { - hostService.invalidateServiceContext(context); - } + } else { + StorageFilerTO poolTO = cmd.getPool(); - String msg = "Unable to execute CopyVolumeCommand due to exception"; - s_logger.error(msg, e); - return new CopyVolumeAnswer(cmd, false, "CopyVolumeCommand failed due to exception: " + StringUtils.getExceptionStackInfo(e), null, null); - } - } - - @Override - public Answer execute(VmwareHostService hostService, CreateVolumeFromSnapshotCommand cmd) { - - String primaryStorageNameLabel = cmd.getPrimaryStoragePoolNameLabel(); - Long accountId = cmd.getAccountId(); - Long volumeId = cmd.getVolumeId(); - String secondaryStorageUrl = cmd.getSecondaryStorageUrl(); - String backedUpSnapshotUuid = cmd.getSnapshotUuid(); - - String details = null; - boolean success = false; - String newVolumeName = UUID.randomUUID().toString().replaceAll("-", ""); - - VmwareContext context = hostService.getServiceContext(cmd); - try { - VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd); - - ManagedObjectReference morPrimaryDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, primaryStorageNameLabel); - if (morPrimaryDs == null) { - String msg = "Unable to find datastore: " + primaryStorageNameLabel; - s_logger.error(msg); - throw new Exception(msg); - } - - DatastoreMO primaryDsMo = new DatastoreMO(hyperHost.getContext(), morPrimaryDs); - details = createVolumeFromSnapshot(hyperHost, primaryDsMo, - newVolumeName, accountId, volumeId, secondaryStorageUrl, backedUpSnapshotUuid); - if (details == null) { - success = true; - } - } catch (Throwable e) { - if (e instanceof RemoteException) { - hostService.invalidateServiceContext(context); - } - - s_logger.error("Unexpecpted exception ", e); - details = "CreateVolumeFromSnapshotCommand exception: " + StringUtils.getExceptionStackInfo(e); - } - - return new CreateVolumeFromSnapshotAnswer(cmd, success, details, newVolumeName); - } + ManagedObjectReference morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, poolTO.getUuid()); + if (morDatastore == null) { + morDatastore = hyperHost.mountDatastore( + false, + poolTO.getHost(), 0, poolTO.getPath(), + poolTO.getUuid().replace("-", "")); + + if (morDatastore == null) { + throw new Exception("Unable to mount storage pool on host. storeUrl: " + poolTO.getHost() + ":/" + poolTO.getPath()); + } + } + + result = copyVolumeFromSecStorage( + hyperHost, volumeId, + new DatastoreMO(context, morDatastore), + secondaryStorageURL, volumePath); + } + return new CopyVolumeAnswer(cmd, true, null, result.first(), result.second()); + } catch (Throwable e) { + if (e instanceof RemoteException) { + hostService.invalidateServiceContext(context); + } + + String msg = "Unable to execute CopyVolumeCommand due to exception"; + s_logger.error(msg, e); + return new CopyVolumeAnswer(cmd, false, "CopyVolumeCommand failed due to exception: " + StringUtils.getExceptionStackInfo(e), null, null); + } + } + + @Override + public Answer execute(VmwareHostService hostService, CreateVolumeFromSnapshotCommand cmd) { + + String primaryStorageNameLabel = cmd.getPrimaryStoragePoolNameLabel(); + Long accountId = cmd.getAccountId(); + Long volumeId = cmd.getVolumeId(); + String secondaryStorageUrl = cmd.getSecondaryStorageUrl(); + String backedUpSnapshotUuid = cmd.getSnapshotUuid(); + + String details = null; + boolean success = false; + String newVolumeName = UUID.randomUUID().toString().replaceAll("-", ""); + + VmwareContext context = hostService.getServiceContext(cmd); + try { + VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd); + + ManagedObjectReference morPrimaryDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, primaryStorageNameLabel); + if (morPrimaryDs == null) { + String msg = "Unable to find datastore: " + primaryStorageNameLabel; + s_logger.error(msg); + throw new Exception(msg); + } + + DatastoreMO primaryDsMo = new DatastoreMO(hyperHost.getContext(), morPrimaryDs); + details = createVolumeFromSnapshot(hyperHost, primaryDsMo, + newVolumeName, accountId, volumeId, secondaryStorageUrl, backedUpSnapshotUuid); + if (details == null) { + success = true; + } + } catch (Throwable e) { + if (e instanceof RemoteException) { + hostService.invalidateServiceContext(context); + } + + s_logger.error("Unexpecpted exception ", e); + details = "CreateVolumeFromSnapshotCommand exception: " + StringUtils.getExceptionStackInfo(e); + } + + return new CreateVolumeFromSnapshotAnswer(cmd, success, details, newVolumeName); + } // templateName: name in secondary storage // templateUuid: will be used at hypervisor layer diff --git a/core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java similarity index 100% rename from core/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java diff --git a/core/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java similarity index 100% rename from core/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java diff --git a/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java similarity index 99% rename from core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java rename to plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index f4771b8fc2a..a8c61f6fad8 100755 --- a/core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -188,6 +188,7 @@ import com.cloud.utils.exception.ExceptionUtil; import com.cloud.utils.mgmt.JmxUtil; import com.cloud.utils.mgmt.PropertyMapDynamicBean; import com.cloud.utils.net.NetUtils; +import com.cloud.utils.ssh.SshHelper; import com.cloud.vm.DiskProfile; import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachine.State; @@ -230,12 +231,12 @@ import com.vmware.vim25.VirtualMachineGuestOsIdentifier; import com.vmware.vim25.VirtualMachinePowerState; import com.vmware.vim25.VirtualMachineRuntimeInfo; import com.vmware.vim25.VirtualSCSISharing; - -public class VmwareResource implements StoragePoolResource, ServerResource, VmwareHostService { - private static final Logger s_logger = Logger.getLogger(VmwareResource.class); - - protected String _name; - + +public class VmwareResource implements StoragePoolResource, ServerResource, VmwareHostService { + private static final Logger s_logger = Logger.getLogger(VmwareResource.class); + + protected String _name; + protected final long _ops_timeout = 900000; // 15 minutes time out to time protected final int _shutdown_waitMs = 300000; // wait up to 5 minutes for shutdown @@ -789,23 +790,23 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa nicMasks &= ~(1 << publicNicInfo.first().intValue()); vmMo.setCustomFieldValue(CustomFieldConstants.CLOUD_NIC_MASK, String.valueOf(nicMasks)); - HostMO hostMo = vmMo.getRunningHost(); - List networks = vmMo.getNetworksWithDetails(); - for (NetworkDetails netDetails : networks) { - if (netDetails.getGCTag() != null && netDetails.getGCTag().equalsIgnoreCase("true")) { - if (netDetails.getVMMorsOnNetwork() == null || netDetails.getVMMorsOnNetwork().length == 1) { - cleanupNetwork(hostMo, netDetails); - } - } - } - } - - if (s_logger.isInfoEnabled()) { - s_logger.info("ipassoc command on domain router " + privateIpAddress + " completed"); - } - } - - private void plugPublicNic(VirtualMachineMO vmMo, final String vlanId, final String vifMacAddress) throws Exception { + HostMO hostMo = vmMo.getRunningHost(); + List networks = vmMo.getNetworksWithDetails(); + for (NetworkDetails netDetails : networks) { + if (netDetails.getGCTag() != null && netDetails.getGCTag().equalsIgnoreCase("true")) { + if (netDetails.getVMMorsOnNetwork() == null || netDetails.getVMMorsOnNetwork().length == 1) { + cleanupNetwork(hostMo, netDetails); + } + } + } + } + + if (s_logger.isInfoEnabled()) { + s_logger.info("ipassoc command on domain router " + privateIpAddress + " completed"); + } + } + + private void plugPublicNic(VirtualMachineMO vmMo, final String vlanId, final String vifMacAddress) throws Exception { // TODO : probably need to set traffic shaping Pair networkInfo = null; @@ -1446,33 +1447,33 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa if (vol.getType() != Volume.Type.ISO) { Pair volumeDsDetails = dataStoresDetails.get(vol.getPoolUuid()); assert (volumeDsDetails != null); - VirtualDevice device; - datastoreDiskPath = String.format("[%s] %s.vmdk", volumeDsDetails.second().getName(), vol.getPath()); - String chainInfo = vol.getChainInfo(); - - if (chainInfo != null && !chainInfo.isEmpty()) { - String[] diskChain = _gson.fromJson(chainInfo, String[].class); - if (diskChain == null || diskChain.length < 1) { - s_logger.warn("Empty previously-saved chain info, fall back to the original"); - device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, new String[] { datastoreDiskPath }, volumeDsDetails.first(), i, i + 1); - } else { - s_logger.info("Attach the disk with stored chain info: " + chainInfo); - for (int j = 0; j < diskChain.length; j++) { - diskChain[j] = String.format("[%s] %s", volumeDsDetails.second().getName(), diskChain[j]); - } - - device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, diskChain, volumeDsDetails.first(), i, i + 1); - } - } else { - device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, new String[] { datastoreDiskPath }, volumeDsDetails.first(), i, i + 1); - } - deviceConfigSpecArray[i].setDevice(device); - deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add); - - if(s_logger.isDebugEnabled()) - s_logger.debug("Prepare volume at new device " + _gson.toJson(device)); - - i++; + VirtualDevice device; + datastoreDiskPath = String.format("[%s] %s.vmdk", volumeDsDetails.second().getName(), vol.getPath()); + String chainInfo = vol.getChainInfo(); + + if (chainInfo != null && !chainInfo.isEmpty()) { + String[] diskChain = _gson.fromJson(chainInfo, String[].class); + if (diskChain == null || diskChain.length < 1) { + s_logger.warn("Empty previously-saved chain info, fall back to the original"); + device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, new String[] { datastoreDiskPath }, volumeDsDetails.first(), i, i + 1); + } else { + s_logger.info("Attach the disk with stored chain info: " + chainInfo); + for (int j = 0; j < diskChain.length; j++) { + diskChain[j] = String.format("[%s] %s", volumeDsDetails.second().getName(), diskChain[j]); + } + + device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, diskChain, volumeDsDetails.first(), i, i + 1); + } + } else { + device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey, new String[] { datastoreDiskPath }, volumeDsDetails.first(), i, i + 1); + } + deviceConfigSpecArray[i].setDevice(device); + deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add); + + if(s_logger.isDebugEnabled()) + s_logger.debug("Prepare volume at new device " + _gson.toJson(device)); + + i++; } } @@ -1496,11 +1497,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa nic = VmwareHelper.prepareNicDevice(vmMo, networkInfo.first(), nicDeviceType, networkInfo.second(), nicTo.getMac(), i, i + 1, true, true); } - deviceConfigSpecArray[i] = new VirtualDeviceConfigSpec(); - deviceConfigSpecArray[i].setDevice(nic); - deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add); - - if(s_logger.isDebugEnabled()) + deviceConfigSpecArray[i] = new VirtualDeviceConfigSpec(); + deviceConfigSpecArray[i].setDevice(nic); + deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add); + + if(s_logger.isDebugEnabled()) s_logger.debug("Prepare NIC at new device " + _gson.toJson(deviceConfigSpecArray[i])); // this is really a hacking for DomR, upon DomR startup, we will reset all the NIC allocation after eth3 @@ -1672,29 +1673,29 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa } poolMors.put(vol.getPoolUuid(), new Pair (morDataStore, new DatastoreMO(context, morDataStore))); } - } - } - return poolMors; - } - - private String getVlanInfo(NicTO nicTo, String defaultVlan) { - if (nicTo.getBroadcastType() == BroadcastDomainType.Native) { - return defaultVlan; - } - - if (nicTo.getBroadcastType() == BroadcastDomainType.Vlan) { - if (nicTo.getBroadcastUri() != null) { - return nicTo.getBroadcastUri().getHost(); - } else { - s_logger.warn("BroadcastType is not claimed as VLAN, but without vlan info in broadcast URI. Use vlan info from labeling: " + defaultVlan); - return defaultVlan; - } - } - - s_logger.warn("Unrecognized broadcast type in VmwareResource, type: " + nicTo.getBroadcastType().toString() + ". Use vlan info from labeling: " + defaultVlan); - return defaultVlan; - } - + } + } + return poolMors; + } + + private String getVlanInfo(NicTO nicTo, String defaultVlan) { + if (nicTo.getBroadcastType() == BroadcastDomainType.Native) { + return defaultVlan; + } + + if (nicTo.getBroadcastType() == BroadcastDomainType.Vlan) { + if (nicTo.getBroadcastUri() != null) { + return nicTo.getBroadcastUri().getHost(); + } else { + s_logger.warn("BroadcastType is not claimed as VLAN, but without vlan info in broadcast URI. Use vlan info from labeling: " + defaultVlan); + return defaultVlan; + } + } + + s_logger.warn("Unrecognized broadcast type in VmwareResource, type: " + nicTo.getBroadcastType().toString() + ". Use vlan info from labeling: " + defaultVlan); + return defaultVlan; + } + private Pair prepareNetworkFromNicInfo(HostMO hostMo, NicTO nicTo) throws Exception { Pair switchName = getTargetSwitch(nicTo); @@ -2338,131 +2339,131 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa if (pool.getType() != StoragePoolType.NetworkFilesystem && pool.getType() != StoragePoolType.VMFS) { throw new Exception("Unsupported storage pool type " + pool.getType()); - } - + } + ManagedObjectReference morDatastore = null; morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, pool.getUuid()); if(morDatastore == null) morDatastore = hyperHost.mountDatastore(pool.getType() == StoragePoolType.VMFS, pool.getHost(), - pool.getPort(), pool.getPath(), pool.getUuid().replace("-", "")); - - assert (morDatastore != null); - DatastoreSummary summary = new DatastoreMO(getServiceContext(), morDatastore).getSummary(); - long capacity = summary.getCapacity(); - long available = summary.getFreeSpace(); - Map tInfo = new HashMap(); - ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(cmd, capacity, available, tInfo); - return answer; - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String msg = "ModifyStoragePoolCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(msg, e); - return new Answer(cmd, false, msg); - } - } - - protected Answer execute(DeleteStoragePoolCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource DeleteStoragePoolCommand: " + _gson.toJson(cmd)); - } - - StorageFilerTO pool = cmd.getPool(); + pool.getPort(), pool.getPath(), pool.getUuid().replace("-", "")); + + assert (morDatastore != null); + DatastoreSummary summary = new DatastoreMO(getServiceContext(), morDatastore).getSummary(); + long capacity = summary.getCapacity(); + long available = summary.getFreeSpace(); + Map tInfo = new HashMap(); + ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(cmd, capacity, available, tInfo); + return answer; + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String msg = "ModifyStoragePoolCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(msg, e); + return new Answer(cmd, false, msg); + } + } + + protected Answer execute(DeleteStoragePoolCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource DeleteStoragePoolCommand: " + _gson.toJson(cmd)); + } + + StorageFilerTO pool = cmd.getPool(); try { // We will leave datastore cleanup management to vCenter. Since for cluster VMFS datastore, it will always // be mounted by vCenter. - - // VmwareHypervisorHost hyperHost = this.getHyperHost(getServiceContext()); - // hyperHost.unmountDatastore(pool.getUuid()); - Answer answer = new Answer(cmd, true, "success"); - return answer; - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String msg = "DeleteStoragePoolCommand (pool: " + pool.getHost() + ", path: " + pool.getPath() + ") failed due to " + VmwareHelper.getExceptionMessage(e); - return new Answer(cmd, false, msg); - } - } - - protected Answer execute(AttachVolumeCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource AttachVolumeCommand: " + _gson.toJson(cmd)); - } - - /* - * AttachVolumeCommand { "attach":true,"vmName":"i-2-1-KY","pooltype":"NetworkFilesystem", - * "volumeFolder":"/export/home/kelven/vmware-test/primary", "volumePath":"uuid", - * "volumeName":"volume name","deviceId":1 } - */ - try { - VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); - VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName()); - if (vmMo == null) { - String msg = "Unable to find the VM to execute AttachVolumeCommand, vmName: " + cmd.getVmName(); - s_logger.error(msg); - throw new Exception(msg); - } - - ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPoolUuid()); - if (morDs == null) { - String msg = "Unable to find the mounted datastore to execute AttachVolumeCommand, vmName: " + cmd.getVmName(); - s_logger.error(msg); - throw new Exception(msg); - } - - DatastoreMO dsMo = new DatastoreMO(getServiceContext(), morDs); - String datastoreVolumePath = String.format("[%s] %s.vmdk", dsMo.getName(), cmd.getVolumePath()); - - AttachVolumeAnswer answer = new AttachVolumeAnswer(cmd, cmd.getDeviceId()); - if (cmd.getAttach()) { - vmMo.attachDisk(new String[] { datastoreVolumePath }, morDs); - } else { - vmMo.removeAllSnapshots(); - vmMo.detachDisk(datastoreVolumePath, false); - } - - return answer; - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String msg = "AttachVolumeCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(msg, e); - return new AttachVolumeAnswer(cmd, msg); - } - } - - protected Answer execute(AttachIsoCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource AttachIsoCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); - VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName()); - if (vmMo == null) { - String msg = "Unable to find VM in vSphere to execute AttachIsoCommand, vmName: " + cmd.getVmName(); - s_logger.error(msg); - throw new Exception(msg); - } - - String storeUrl = cmd.getStoreUrl(); - if (storeUrl == null) { - if (!cmd.getIsoPath().equalsIgnoreCase("vmware-tools.iso")) { - String msg = "ISO store root url is not found in AttachIsoCommand"; - s_logger.error(msg); - throw new Exception(msg); - } else { - if (cmd.isAttach()) { - vmMo.mountToolsInstaller(); + + // VmwareHypervisorHost hyperHost = this.getHyperHost(getServiceContext()); + // hyperHost.unmountDatastore(pool.getUuid()); + Answer answer = new Answer(cmd, true, "success"); + return answer; + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String msg = "DeleteStoragePoolCommand (pool: " + pool.getHost() + ", path: " + pool.getPath() + ") failed due to " + VmwareHelper.getExceptionMessage(e); + return new Answer(cmd, false, msg); + } + } + + protected Answer execute(AttachVolumeCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource AttachVolumeCommand: " + _gson.toJson(cmd)); + } + + /* + * AttachVolumeCommand { "attach":true,"vmName":"i-2-1-KY","pooltype":"NetworkFilesystem", + * "volumeFolder":"/export/home/kelven/vmware-test/primary", "volumePath":"uuid", + * "volumeName":"volume name","deviceId":1 } + */ + try { + VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); + VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName()); + if (vmMo == null) { + String msg = "Unable to find the VM to execute AttachVolumeCommand, vmName: " + cmd.getVmName(); + s_logger.error(msg); + throw new Exception(msg); + } + + ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPoolUuid()); + if (morDs == null) { + String msg = "Unable to find the mounted datastore to execute AttachVolumeCommand, vmName: " + cmd.getVmName(); + s_logger.error(msg); + throw new Exception(msg); + } + + DatastoreMO dsMo = new DatastoreMO(getServiceContext(), morDs); + String datastoreVolumePath = String.format("[%s] %s.vmdk", dsMo.getName(), cmd.getVolumePath()); + + AttachVolumeAnswer answer = new AttachVolumeAnswer(cmd, cmd.getDeviceId()); + if (cmd.getAttach()) { + vmMo.attachDisk(new String[] { datastoreVolumePath }, morDs); + } else { + vmMo.removeAllSnapshots(); + vmMo.detachDisk(datastoreVolumePath, false); + } + + return answer; + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String msg = "AttachVolumeCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(msg, e); + return new AttachVolumeAnswer(cmd, msg); + } + } + + protected Answer execute(AttachIsoCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource AttachIsoCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); + VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName()); + if (vmMo == null) { + String msg = "Unable to find VM in vSphere to execute AttachIsoCommand, vmName: " + cmd.getVmName(); + s_logger.error(msg); + throw new Exception(msg); + } + + String storeUrl = cmd.getStoreUrl(); + if (storeUrl == null) { + if (!cmd.getIsoPath().equalsIgnoreCase("vmware-tools.iso")) { + String msg = "ISO store root url is not found in AttachIsoCommand"; + s_logger.error(msg); + throw new Exception(msg); + } else { + if (cmd.isAttach()) { + vmMo.mountToolsInstaller(); } else { vmMo.unmountToolsInstaller(); } @@ -2509,223 +2510,223 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa String msg = "AttachIsoCommand(detach) failed due to " + VmwareHelper.getExceptionMessage(e); s_logger.warn(msg, e); return new Answer(cmd, false, msg); - } - } - } - - private synchronized ManagedObjectReference prepareSecondaryDatastoreOnHost(String storeUrl) throws Exception { - String storeName = getSecondaryDatastoreUUID(storeUrl); - URI uri = new URI(storeUrl); - - VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); - ManagedObjectReference morDatastore = hyperHost.mountDatastore(false, uri.getHost(), 0, uri.getPath(), storeName.replace("-", "")); - + } + } + } + + private synchronized ManagedObjectReference prepareSecondaryDatastoreOnHost(String storeUrl) throws Exception { + String storeName = getSecondaryDatastoreUUID(storeUrl); + URI uri = new URI(storeUrl); + + VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext()); + ManagedObjectReference morDatastore = hyperHost.mountDatastore(false, uri.getHost(), 0, uri.getPath(), storeName.replace("-", "")); + if (morDatastore == null) - throw new Exception("Unable to mount secondary storage on host. storeUrl: " + storeUrl); - - return morDatastore; - } - - private static String getSecondaryDatastoreUUID(String storeUrl) { - return UUID.nameUUIDFromBytes(storeUrl.getBytes()).toString(); - } - - protected Answer execute(ValidateSnapshotCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource ValidateSnapshotCommand: " + _gson.toJson(cmd)); - } - - // the command is no longer available - String expectedSnapshotBackupUuid = null; - String actualSnapshotBackupUuid = null; - String actualSnapshotUuid = null; - return new ValidateSnapshotAnswer(cmd, false, "ValidateSnapshotCommand is not supported for vmware yet", expectedSnapshotBackupUuid, actualSnapshotBackupUuid, actualSnapshotUuid); - } - - protected Answer execute(ManageSnapshotCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource ManageSnapshotCommand: " + _gson.toJson(cmd)); - } - - long snapshotId = cmd.getSnapshotId(); - - /* - * "ManageSnapshotCommand", - * "{\"_commandSwitch\":\"-c\",\"_volumePath\":\"i-2-3-KY-ROOT\",\"_snapshotName\":\"i-2-3-KY_i-2-3-KY-ROOT_20101102203827\",\"_snapshotId\":1,\"_vmName\":\"i-2-3-KY\"}" - */ - boolean success = false; - String cmdSwitch = cmd.getCommandSwitch(); - String snapshotOp = "Unsupported snapshot command." + cmdSwitch; - if (cmdSwitch.equals(ManageSnapshotCommand.CREATE_SNAPSHOT)) { - snapshotOp = "create"; - } else if (cmdSwitch.equals(ManageSnapshotCommand.DESTROY_SNAPSHOT)) { - snapshotOp = "destroy"; - } - - String details = "ManageSnapshotCommand operation: " + snapshotOp + " Failed for snapshotId: " + snapshotId; - String snapshotUUID = null; + throw new Exception("Unable to mount secondary storage on host. storeUrl: " + storeUrl); + + return morDatastore; + } + + private static String getSecondaryDatastoreUUID(String storeUrl) { + return UUID.nameUUIDFromBytes(storeUrl.getBytes()).toString(); + } + + protected Answer execute(ValidateSnapshotCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource ValidateSnapshotCommand: " + _gson.toJson(cmd)); + } + + // the command is no longer available + String expectedSnapshotBackupUuid = null; + String actualSnapshotBackupUuid = null; + String actualSnapshotUuid = null; + return new ValidateSnapshotAnswer(cmd, false, "ValidateSnapshotCommand is not supported for vmware yet", expectedSnapshotBackupUuid, actualSnapshotBackupUuid, actualSnapshotUuid); + } + + protected Answer execute(ManageSnapshotCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource ManageSnapshotCommand: " + _gson.toJson(cmd)); + } + + long snapshotId = cmd.getSnapshotId(); + + /* + * "ManageSnapshotCommand", + * "{\"_commandSwitch\":\"-c\",\"_volumePath\":\"i-2-3-KY-ROOT\",\"_snapshotName\":\"i-2-3-KY_i-2-3-KY-ROOT_20101102203827\",\"_snapshotId\":1,\"_vmName\":\"i-2-3-KY\"}" + */ + boolean success = false; + String cmdSwitch = cmd.getCommandSwitch(); + String snapshotOp = "Unsupported snapshot command." + cmdSwitch; + if (cmdSwitch.equals(ManageSnapshotCommand.CREATE_SNAPSHOT)) { + snapshotOp = "create"; + } else if (cmdSwitch.equals(ManageSnapshotCommand.DESTROY_SNAPSHOT)) { + snapshotOp = "destroy"; + } + + String details = "ManageSnapshotCommand operation: " + snapshotOp + " Failed for snapshotId: " + snapshotId; + String snapshotUUID = null; // snapshot operation (create or destroy) is handled inside BackupSnapshotCommand(), we just fake // a success return here snapshotUUID = UUID.randomUUID().toString(); success = true; details = null; - - return new ManageSnapshotAnswer(cmd, snapshotId, snapshotUUID, success, details); - } - - protected Answer execute(BackupSnapshotCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource BackupSnapshotCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareContext context = getServiceContext(); - VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - - return mgr.getStorageManager().execute(this, cmd); - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String details = "BackupSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(details, e); - return new BackupSnapshotAnswer(cmd, false, details, null, true); - } - } - - - protected Answer execute(CreateVolumeFromSnapshotCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource CreateVolumeFromSnapshotCommand: " + _gson.toJson(cmd)); - } - - String details = null; - boolean success = false; - String newVolumeName = UUID.randomUUID().toString(); - - try { - VmwareContext context = getServiceContext(); - VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - return mgr.getStorageManager().execute(this, cmd); - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - details = "CreateVolumeFromSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(details, e); - } - - return new CreateVolumeFromSnapshotAnswer(cmd, success, details, newVolumeName); - } - - protected Answer execute(CreatePrivateTemplateFromVolumeCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource CreatePrivateTemplateFromVolumeCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareContext context = getServiceContext(); - VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - - return mgr.getStorageManager().execute(this, cmd); - - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String details = "CreatePrivateTemplateFromVolumeCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(details, e); - return new CreatePrivateTemplateAnswer(cmd, false, details); - } - } - - protected Answer execute(final UpgradeSnapshotCommand cmd) { - return new Answer(cmd, true, "success"); - } - - protected Answer execute(CreatePrivateTemplateFromSnapshotCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource CreatePrivateTemplateFromSnapshotCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - return mgr.getStorageManager().execute(this, cmd); - - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String details = "CreatePrivateTemplateFromSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(details, e); - return new CreatePrivateTemplateAnswer(cmd, false, details); - } - } - - protected Answer execute(GetStorageStatsCommand cmd) { - if (s_logger.isTraceEnabled()) { - s_logger.trace("Executing resource GetStorageStatsCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareContext context = getServiceContext(); - VmwareHypervisorHost hyperHost = getHyperHost(context); - ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getStorageId()); - - if (morDs != null) { - DatastoreMO datastoreMo = new DatastoreMO(context, morDs); - DatastoreSummary summary = datastoreMo.getSummary(); - assert (summary != null); - - long capacity = summary.getCapacity(); - long free = summary.getFreeSpace(); - long used = capacity - free; - - if (s_logger.isDebugEnabled()) { - s_logger.debug("Datastore summary info, storageId: " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype() + ", capacity: " + capacity - + ", free: " + free + ", used: " + used); - } - - if (summary.getCapacity() <= 0) { - s_logger.warn("Something is wrong with vSphere NFS datastore, rebooting ESX(ESXi) host should help"); - } - - return new GetStorageStatsAnswer(cmd, capacity, used); - } else { - String msg = "Could not find datastore for GetStorageStatsCommand storageId : " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype(); - - s_logger.error(msg); - return new GetStorageStatsAnswer(cmd, msg); - } - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String msg = "Unable to execute GetStorageStatsCommand(storageId : " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype() + ") due to " - + VmwareHelper.getExceptionMessage(e); - s_logger.error(msg, e); - return new GetStorageStatsAnswer(cmd, msg); - } - } - - protected Answer execute(GetVncPortCommand cmd) { - if (s_logger.isTraceEnabled()) { - s_logger.trace("Executing resource GetVncPortCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareContext context = getServiceContext(); + + return new ManageSnapshotAnswer(cmd, snapshotId, snapshotUUID, success, details); + } + + protected Answer execute(BackupSnapshotCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource BackupSnapshotCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareContext context = getServiceContext(); + VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + + return mgr.getStorageManager().execute(this, cmd); + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String details = "BackupSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(details, e); + return new BackupSnapshotAnswer(cmd, false, details, null, true); + } + } + + + protected Answer execute(CreateVolumeFromSnapshotCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource CreateVolumeFromSnapshotCommand: " + _gson.toJson(cmd)); + } + + String details = null; + boolean success = false; + String newVolumeName = UUID.randomUUID().toString(); + + try { + VmwareContext context = getServiceContext(); + VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + return mgr.getStorageManager().execute(this, cmd); + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + details = "CreateVolumeFromSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(details, e); + } + + return new CreateVolumeFromSnapshotAnswer(cmd, success, details, newVolumeName); + } + + protected Answer execute(CreatePrivateTemplateFromVolumeCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource CreatePrivateTemplateFromVolumeCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareContext context = getServiceContext(); + VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + + return mgr.getStorageManager().execute(this, cmd); + + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String details = "CreatePrivateTemplateFromVolumeCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(details, e); + return new CreatePrivateTemplateAnswer(cmd, false, details); + } + } + + protected Answer execute(final UpgradeSnapshotCommand cmd) { + return new Answer(cmd, true, "success"); + } + + protected Answer execute(CreatePrivateTemplateFromSnapshotCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource CreatePrivateTemplateFromSnapshotCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + return mgr.getStorageManager().execute(this, cmd); + + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String details = "CreatePrivateTemplateFromSnapshotCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(details, e); + return new CreatePrivateTemplateAnswer(cmd, false, details); + } + } + + protected Answer execute(GetStorageStatsCommand cmd) { + if (s_logger.isTraceEnabled()) { + s_logger.trace("Executing resource GetStorageStatsCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareContext context = getServiceContext(); + VmwareHypervisorHost hyperHost = getHyperHost(context); + ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getStorageId()); + + if (morDs != null) { + DatastoreMO datastoreMo = new DatastoreMO(context, morDs); + DatastoreSummary summary = datastoreMo.getSummary(); + assert (summary != null); + + long capacity = summary.getCapacity(); + long free = summary.getFreeSpace(); + long used = capacity - free; + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Datastore summary info, storageId: " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype() + ", capacity: " + capacity + + ", free: " + free + ", used: " + used); + } + + if (summary.getCapacity() <= 0) { + s_logger.warn("Something is wrong with vSphere NFS datastore, rebooting ESX(ESXi) host should help"); + } + + return new GetStorageStatsAnswer(cmd, capacity, used); + } else { + String msg = "Could not find datastore for GetStorageStatsCommand storageId : " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype(); + + s_logger.error(msg); + return new GetStorageStatsAnswer(cmd, msg); + } + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String msg = "Unable to execute GetStorageStatsCommand(storageId : " + cmd.getStorageId() + ", localPath: " + cmd.getLocalPath() + ", poolType: " + cmd.getPooltype() + ") due to " + + VmwareHelper.getExceptionMessage(e); + s_logger.error(msg, e); + return new GetStorageStatsAnswer(cmd, msg); + } + } + + protected Answer execute(GetVncPortCommand cmd) { + if (s_logger.isTraceEnabled()) { + s_logger.trace("Executing resource GetVncPortCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareContext context = getServiceContext(); VmwareHypervisorHost hyperHost = getHyperHost(context); assert(hyperHost instanceof HostMO); VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); @@ -2794,74 +2795,74 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa } protected Answer execute(ModifySshKeysCommand cmd) { - //do not log the command contents for this command. do NOT log the ssh keys - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource ModifySshKeysCommand."); - } - - return new Answer(cmd); - } - - protected Answer execute(PoolEjectCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource PoolEjectCommand: " + _gson.toJson(cmd)); - } - - return new Answer(cmd, false, "PoolEjectCommand is not available for vmware"); - } - - @Override - public PrimaryStorageDownloadAnswer execute(PrimaryStorageDownloadCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource PrimaryStorageDownloadCommand: " + _gson.toJson(cmd)); - } - - try { - VmwareContext context = getServiceContext(); - VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - return (PrimaryStorageDownloadAnswer) mgr.getStorageManager().execute(this, cmd); - } catch (Throwable e) { - if (e instanceof RemoteException) { - s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); - invalidateServiceContext(); - } - - String msg = "PrimaryStorageDownloadCommand failed due to " + VmwareHelper.getExceptionMessage(e); - s_logger.error(msg, e); - return new PrimaryStorageDownloadAnswer(msg); - } - } - - @Override - public Answer execute(DestroyCommand cmd) { - if (s_logger.isInfoEnabled()) { - s_logger.info("Executing resource DestroyCommand: " + _gson.toJson(cmd)); - } - - /* - * DestroyCommand content example - * - * {"volume": {"id":5,"name":"Volume1", "mountPoint":"/export/home/kelven/vmware-test/primary", - * "path":"6bb8762f-c34c-453c-8e03-26cc246ceec4", "size":0,"type":"DATADISK","resourceType": - * "STORAGE_POOL","storagePoolType":"NetworkFilesystem", "poolId":0,"deviceId":0 } } - * - * {"volume": {"id":1, "name":"i-2-1-KY-ROOT", "mountPoint":"/export/home/kelven/vmware-test/primary", - * "path":"i-2-1-KY-ROOT","size":0,"type":"ROOT", "resourceType":"STORAGE_POOL", "storagePoolType":"NetworkFilesystem", - * "poolId":0,"deviceId":0 } } - */ - - try { - VmwareContext context = getServiceContext(); - VmwareHypervisorHost hyperHost = getHyperHost(context); - VolumeTO vol = cmd.getVolume(); - - ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, vol.getPoolUuid()); - if (morDs == null) { - String msg = "Unable to find datastore based on volume mount point " + cmd.getVolume().getMountPoint(); - s_logger.error(msg); - throw new Exception(msg); - } - + //do not log the command contents for this command. do NOT log the ssh keys + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource ModifySshKeysCommand."); + } + + return new Answer(cmd); + } + + protected Answer execute(PoolEjectCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource PoolEjectCommand: " + _gson.toJson(cmd)); + } + + return new Answer(cmd, false, "PoolEjectCommand is not available for vmware"); + } + + @Override + public PrimaryStorageDownloadAnswer execute(PrimaryStorageDownloadCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource PrimaryStorageDownloadCommand: " + _gson.toJson(cmd)); + } + + try { + VmwareContext context = getServiceContext(); + VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + return (PrimaryStorageDownloadAnswer) mgr.getStorageManager().execute(this, cmd); + } catch (Throwable e) { + if (e instanceof RemoteException) { + s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context"); + invalidateServiceContext(); + } + + String msg = "PrimaryStorageDownloadCommand failed due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(msg, e); + return new PrimaryStorageDownloadAnswer(msg); + } + } + + @Override + public Answer execute(DestroyCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource DestroyCommand: " + _gson.toJson(cmd)); + } + + /* + * DestroyCommand content example + * + * {"volume": {"id":5,"name":"Volume1", "mountPoint":"/export/home/kelven/vmware-test/primary", + * "path":"6bb8762f-c34c-453c-8e03-26cc246ceec4", "size":0,"type":"DATADISK","resourceType": + * "STORAGE_POOL","storagePoolType":"NetworkFilesystem", "poolId":0,"deviceId":0 } } + * + * {"volume": {"id":1, "name":"i-2-1-KY-ROOT", "mountPoint":"/export/home/kelven/vmware-test/primary", + * "path":"i-2-1-KY-ROOT","size":0,"type":"ROOT", "resourceType":"STORAGE_POOL", "storagePoolType":"NetworkFilesystem", + * "poolId":0,"deviceId":0 } } + */ + + try { + VmwareContext context = getServiceContext(); + VmwareHypervisorHost hyperHost = getHyperHost(context); + VolumeTO vol = cmd.getVolume(); + + ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, vol.getPoolUuid()); + if (morDs == null) { + String msg = "Unable to find datastore based on volume mount point " + cmd.getVolume().getMountPoint(); + s_logger.error(msg); + throw new Exception(msg); + } + DatastoreMO dsMo = new DatastoreMO(context, morDs); ManagedObjectReference morDc = hyperHost.getHyperHostDatacenter(); @@ -3018,16 +3019,16 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa VmwareHypervisorHost hyperHost = getHyperHost(context); DatacenterMO dcMo = new DatacenterMO(context, hyperHost.getHyperHostDatacenter()); - ManagedObjectReference morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, pool.getUuid()); + ManagedObjectReference morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, pool.getUuid()); if (morDatastore == null) - throw new Exception("Unable to find datastore in vSphere"); - - DatastoreMO dsMo = new DatastoreMO(context, morDatastore); - - if (cmd.getDiskCharacteristics().getType() == Volume.Type.ROOT) { - if (cmd.getTemplateUrl() == null) { - // create a root volume for blank VM - String dummyVmName = getWorkerName(context, cmd, 0); + throw new Exception("Unable to find datastore in vSphere"); + + DatastoreMO dsMo = new DatastoreMO(context, morDatastore); + + if (cmd.getDiskCharacteristics().getType() == Volume.Type.ROOT) { + if (cmd.getTemplateUrl() == null) { + // create a root volume for blank VM + String dummyVmName = getWorkerName(context, cmd, 0); VirtualMachineMO vmMo = null; try { @@ -4027,23 +4028,23 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa _morHyperHost.setType(hostTokens[0]); _morHyperHost.set_value(hostTokens[1]); - VmwareContext context = getServiceContext(); - try { - VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - mgr.setupResourceStartupParams(params); - - CustomFieldsManagerMO cfmMo = new CustomFieldsManagerMO(context, context.getServiceContent().getCustomFieldsManager()); + VmwareContext context = getServiceContext(); + try { + VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + mgr.setupResourceStartupParams(params); + + CustomFieldsManagerMO cfmMo = new CustomFieldsManagerMO(context, context.getServiceContent().getCustomFieldsManager()); cfmMo.ensureCustomFieldDef("Datastore", CustomFieldConstants.CLOUD_UUID); if (mgr.getNexusVSwitchGlobalParameter()) { cfmMo.ensureCustomFieldDef("DistributedVirtualPortgroup", CustomFieldConstants.CLOUD_GC_DVP); - } else { + } else { cfmMo.ensureCustomFieldDef("Network", CustomFieldConstants.CLOUD_GC); - } + } cfmMo.ensureCustomFieldDef("VirtualMachine", CustomFieldConstants.CLOUD_UUID); cfmMo.ensureCustomFieldDef("VirtualMachine", CustomFieldConstants.CLOUD_NIC_MASK); - - VmwareHypervisorHost hostMo = this.getHyperHost(context); + + VmwareHypervisorHost hostMo = this.getHyperHost(context); _hostName = hostMo.getHyperHostName(); Map vsmCredentials; @@ -4057,17 +4058,17 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa _publicNetworkVSwitchName = mgr.getPublicVSwitchName(Long.parseLong(_dcId), HypervisorType.VMware); _guestNetworkVSwitchName = mgr.getGuestVSwitchName(Long.parseLong(_dcId), HypervisorType.VMware); } - - } catch (Exception e) { - s_logger.error("Unexpected Exception ", e); - } - + + } catch (Exception e) { + s_logger.error("Unexpected Exception ", e); + } + if(_privateNetworkVSwitchName == null) { _privateNetworkVSwitchName = (String) params.get("private.network.vswitch.name"); } - if(_publicNetworkVSwitchName == null) { + if(_publicNetworkVSwitchName == null) { _publicNetworkVSwitchName = (String) params.get("public.network.vswitch.name"); - } + } if(_guestNetworkVSwitchName == null) { _guestNetworkVSwitchName = (String) params.get("guest.network.vswitch.name"); } @@ -4102,42 +4103,42 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa if(value != null && value.equalsIgnoreCase("true")) _nexusVSwitch = true; - s_logger.info("VmwareResource network configuration info. private vSwitch: " + _privateNetworkVSwitchName + ", public vSwitch: " + _publicNetworkVSwitchName + ", guest network: " - + _guestNetworkVSwitchName); - - return true; - } - - @Override - public String getName() { - return _name; - } - - @Override - public boolean start() { - return true; - } - - @Override - public boolean stop() { - return true; - } - - private VmwareContext getServiceContext() { - return getServiceContext(null); - } - - private void invalidateServiceContext() { - invalidateServiceContext(null); - } - - private VmwareHypervisorHost getHyperHost(VmwareContext context) { - return getHyperHost(context, null); - } - - @Override - public synchronized VmwareContext getServiceContext(Command cmd) { - if (_serviceContext == null) { + s_logger.info("VmwareResource network configuration info. private vSwitch: " + _privateNetworkVSwitchName + ", public vSwitch: " + _publicNetworkVSwitchName + ", guest network: " + + _guestNetworkVSwitchName); + + return true; + } + + @Override + public String getName() { + return _name; + } + + @Override + public boolean start() { + return true; + } + + @Override + public boolean stop() { + return true; + } + + private VmwareContext getServiceContext() { + return getServiceContext(null); + } + + private void invalidateServiceContext() { + invalidateServiceContext(null); + } + + private VmwareHypervisorHost getHyperHost(VmwareContext context) { + return getHyperHost(context, null); + } + + @Override + public synchronized VmwareContext getServiceContext(Command cmd) { + if (_serviceContext == null) { try { _serviceContext = VmwareContextFactory.create(_vCenterAddress, _username, _password); VmwareHypervisorHost hyperHost = getHyperHost(_serviceContext, cmd); @@ -4162,23 +4163,23 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa if(bRefresh) firewallMo.refreshFirewall(); } - } catch (Exception e) { - s_logger.error("Unable to connect to vSphere server: " + _vCenterAddress, e); - throw new CloudRuntimeException("Unable to connect to vSphere server: " + _vCenterAddress); - } - } - return _serviceContext; - } - - @Override - public synchronized void invalidateServiceContext(VmwareContext context) { - if (_serviceContext != null) { - _serviceContext.close(); - } - _serviceContext = null; - } - - @Override + } catch (Exception e) { + s_logger.error("Unable to connect to vSphere server: " + _vCenterAddress, e); + throw new CloudRuntimeException("Unable to connect to vSphere server: " + _vCenterAddress); + } + } + return _serviceContext; + } + + @Override + public synchronized void invalidateServiceContext(VmwareContext context) { + if (_serviceContext != null) { + _serviceContext.close(); + } + _serviceContext = null; + } + + @Override public VmwareHypervisorHost getHyperHost(VmwareContext context, Command cmd) { if (_morHyperHost.getType().equalsIgnoreCase("HostSystem")) { return new HostMO(context, _morHyperHost); diff --git a/api/src/com/cloud/network/CiscoNexusVSMDevice.java b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDevice.java similarity index 97% rename from api/src/com/cloud/network/CiscoNexusVSMDevice.java rename to plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDevice.java index db0db55fa7d..c58a6a77a77 100644 --- a/api/src/com/cloud/network/CiscoNexusVSMDevice.java +++ b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDevice.java @@ -14,59 +14,59 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.network; - -public interface CiscoNexusVSMDevice { - - // This tells us whether the VSM is currently enabled or disabled. We may - // need this if we would like to carry out any sort of maintenance on the - // VSM or CS. - public enum VSMDeviceState { - Enabled, - Disabled - } - - // This tells us whether the VSM is currently configured with a standby (HA) - // or does not have any standby (Standalone). - public enum VSMConfigMode { - Standalone, - HA - } - - // This tells us whether the VSM is currently a primary or a standby VSM. - public enum VSMConfigState { - Primary, - Standby - } - - long getId(); - - public String getvsmName(); - - public long getHostId(); - - public String getUserName(); - - public String getPassword(); - - public String getipaddr(); - - public int getManagementVlan(); - - public int getControlVlan(); - - public int getPacketVlan(); - - public int getStorageVlan(); - - public long getvsmDomainId(); - - public VSMConfigMode getvsmConfigMode(); - - public VSMConfigState getvsmConfigState(); - - public VSMDeviceState getvsmDeviceState(); - - public String getUuid(); - -} +package com.cloud.network; + +public interface CiscoNexusVSMDevice { + + // This tells us whether the VSM is currently enabled or disabled. We may + // need this if we would like to carry out any sort of maintenance on the + // VSM or CS. + public enum VSMDeviceState { + Enabled, + Disabled + } + + // This tells us whether the VSM is currently configured with a standby (HA) + // or does not have any standby (Standalone). + public enum VSMConfigMode { + Standalone, + HA + } + + // This tells us whether the VSM is currently a primary or a standby VSM. + public enum VSMConfigState { + Primary, + Standby + } + + long getId(); + + public String getvsmName(); + + public long getHostId(); + + public String getUserName(); + + public String getPassword(); + + public String getipaddr(); + + public int getManagementVlan(); + + public int getControlVlan(); + + public int getPacketVlan(); + + public int getStorageVlan(); + + public long getvsmDomainId(); + + public VSMConfigMode getvsmConfigMode(); + + public VSMConfigState getvsmConfigState(); + + public VSMDeviceState getvsmDeviceState(); + + public String getUuid(); + +} diff --git a/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java similarity index 72% rename from server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java rename to plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java index e00564f1f10..69638587f7a 100644 --- a/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java @@ -21,6 +21,8 @@ import org.apache.log4j.Logger; import com.cloud.agent.api.StartupCommand; import com.cloud.api.ApiConstants; +import com.cloud.configuration.Config; +import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.dc.ClusterDetailsDao; import com.cloud.dc.ClusterVO; import com.cloud.dc.ClusterVSMMapVO; @@ -62,7 +64,8 @@ public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase { HostDetailsDao _hostDetailDao; @Inject PortProfileDao _ppDao; - + @Inject + ConfigurationDao _configDao; private static final org.apache.log4j.Logger s_logger = Logger.getLogger(ExternalLoadBalancerDeviceManagerImpl.class); @@ -312,4 +315,94 @@ public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase { // TODO Auto-generated method stub return null; } + + @DB + public boolean vliadateVsmCluster(String vsmIp, String vsmUser, String vsmPassword, long clusterId, String clusterName) throws ResourceInUseException { + // Check if we're associating a Cisco Nexus VSM with a vmware cluster. + if (Boolean.parseBoolean(_configDao.getValue(Config.VmwareUseNexusVSwitch.toString()))) { + + if(vsmIp != null && vsmUser != null && vsmPassword != null) { + NetconfHelper netconfClient; + try { + netconfClient = new NetconfHelper(vsmIp, vsmUser, vsmPassword); + netconfClient.disconnect(); + } catch (CloudRuntimeException e) { + String msg = "Invalid credentials supplied for user " + vsmUser + " for Cisco Nexus 1000v VSM at " + vsmIp; + s_logger.error(msg); + _clusterDao.remove(clusterId); + throw new CloudRuntimeException(msg); + } + + Transaction txn; + + // If VSM already exists and is mapped to a cluster, fail this operation. + CiscoNexusVSMDeviceVO vsm = _ciscoNexusVSMDeviceDao.getVSMbyIpaddress(vsmIp); + if(vsm != null) { + List clusterList = _clusterVSMDao.listByVSMId(vsm.getId()); + if (clusterList != null && !clusterList.isEmpty()) { + s_logger.error("Failed to add cluster: specified Nexus VSM is already associated with another cluster"); + _clusterDao.remove(clusterId); + ResourceInUseException ex = new ResourceInUseException("Failed to add cluster: specified Nexus VSM is already associated with another cluster with specified Id"); + ex.addProxyObject("cluster", clusterList.get(0).getClusterId(), "clusterId"); + throw ex; + } + } + // persist credentials to database if the VSM entry is not already in the db. + if (_ciscoNexusVSMDeviceDao.getVSMbyIpaddress(vsmIp) == null) { + vsm = new CiscoNexusVSMDeviceVO(vsmIp, vsmUser, vsmPassword); + txn = Transaction.currentTxn(); + try { + txn.start(); + vsm = _ciscoNexusVSMDeviceDao.persist(vsm); + txn.commit(); + } catch (Exception e) { + txn.rollback(); + s_logger.error("Failed to persist Cisco Nexus 1000v VSM details to database. Exception: " + e.getMessage()); + // Removing the cluster record which was added already because the persistence of Nexus VSM credentials has failed. + _clusterDao.remove(clusterId); + throw new CloudRuntimeException(e.getMessage()); + } + } + // Create a mapping between the cluster and the vsm. + vsm = _ciscoNexusVSMDeviceDao.getVSMbyIpaddress(vsmIp); + if (vsm != null) { + ClusterVSMMapVO connectorObj = new ClusterVSMMapVO(clusterId, vsm.getId()); + txn = Transaction.currentTxn(); + try { + txn.start(); + _clusterVSMDao.persist(connectorObj); + txn.commit(); + } catch (Exception e) { + txn.rollback(); + s_logger.error("Failed to associate Cisco Nexus 1000v VSM with cluster: " + clusterName + ". Exception: " + e.getMessage()); + _clusterDao.remove(clusterId); + throw new CloudRuntimeException(e.getMessage()); + } + } + } else { + String msg; + msg = "The global parameter " + Config.VmwareUseNexusVSwitch.toString() + + " is set to \"true\". Following mandatory parameters are not specified. "; + if(vsmIp == null) { + msg += "vsmipaddress: Management IP address of Cisco Nexus 1000v dvSwitch. "; + } + if(vsmUser == null) { + msg += "vsmusername: Name of a user account with admin privileges over Cisco Nexus 1000v dvSwitch. "; + } + if(vsmPassword == null) { + if(vsmUser != null) { + msg += "vsmpassword: Password of user account " + vsmUser + ". "; + } else { + msg += "vsmpassword: Password of user account with admin privileges over Cisco Nexus 1000v dvSwitch. "; + } + } + s_logger.error(msg); + // Cleaning up the cluster record as addCluster operation failed because Nexus dvSwitch credentials are supplied. + _clusterDao.remove(clusterId); + throw new CloudRuntimeException(msg); + } + return true; + } + return false; + } } diff --git a/server/src/com/cloud/network/CiscoNexusVSMDeviceVO.java b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceVO.java similarity index 100% rename from server/src/com/cloud/network/CiscoNexusVSMDeviceVO.java rename to plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceVO.java diff --git a/server/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java b/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java similarity index 100% rename from server/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java rename to plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java diff --git a/server/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java b/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java similarity index 100% rename from server/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java rename to plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java diff --git a/server/src/com/cloud/network/element/CiscoNexusVSMElement.java b/plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElement.java similarity index 100% rename from server/src/com/cloud/network/element/CiscoNexusVSMElement.java rename to plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElement.java diff --git a/server/src/com/cloud/network/element/CiscoNexusVSMElementService.java b/plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElementService.java similarity index 100% rename from server/src/com/cloud/network/element/CiscoNexusVSMElementService.java rename to plugins/hypervisors/vmware/src/com/cloud/network/element/CiscoNexusVSMElementService.java diff --git a/core/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java similarity index 100% rename from core/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java rename to plugins/hypervisors/vmware/src/com/cloud/storage/resource/PremiumSecondaryStorageResource.java diff --git a/core/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java similarity index 100% rename from core/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java rename to plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java diff --git a/core/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java similarity index 100% rename from core/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java rename to plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageResourceHandler.java diff --git a/server/src/com/cloud/configuration/DefaultComponentLibrary.java b/server/src/com/cloud/configuration/DefaultComponentLibrary.java index 3bfe84df25d..61b6861df89 100755 --- a/server/src/com/cloud/configuration/DefaultComponentLibrary.java +++ b/server/src/com/cloud/configuration/DefaultComponentLibrary.java @@ -71,7 +71,6 @@ import com.cloud.maint.dao.AgentUpgradeDaoImpl; import com.cloud.network.ExternalLoadBalancerUsageManagerImpl; import com.cloud.network.NetworkManagerImpl; import com.cloud.network.StorageNetworkManagerImpl; -import com.cloud.network.dao.CiscoNexusVSMDeviceDaoImpl; import com.cloud.network.dao.ExternalFirewallDeviceDaoImpl; import com.cloud.network.dao.ExternalLoadBalancerDeviceDaoImpl; import com.cloud.network.dao.FirewallRulesCidrsDaoImpl; @@ -94,8 +93,6 @@ import com.cloud.network.dao.PortProfileDaoImpl; import com.cloud.network.dao.RemoteAccessVpnDaoImpl; import com.cloud.network.dao.VirtualRouterProviderDaoImpl; import com.cloud.network.dao.VpnUserDaoImpl; -import com.cloud.network.element.CiscoNexusVSMElement; -import com.cloud.network.element.CiscoNexusVSMElementService; import com.cloud.network.element.VirtualRouterElement; import com.cloud.network.element.VirtualRouterElementService; import com.cloud.network.firewall.FirewallManagerImpl; @@ -316,7 +313,6 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com addDao("ExternalFirewallDeviceDao", ExternalFirewallDeviceDaoImpl.class); addDao("NetworkExternalLoadBalancerDao", NetworkExternalLoadBalancerDaoImpl.class); addDao("NetworkExternalFirewallDao", NetworkExternalFirewallDaoImpl.class); - addDao("CiscoNexusVSMDeviceDao", CiscoNexusVSMDeviceDaoImpl.class); addDao("ClusterVSMMapDao", ClusterVSMMapDaoImpl.class); addDao("PortProfileDao", PortProfileDaoImpl.class); addDao("PhysicalNetworkTrafficTypeDao", PhysicalNetworkTrafficTypeDaoImpl.class); @@ -412,7 +408,6 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com protected void populateServices() { addService("VirtualRouterElementService", VirtualRouterElementService.class, VirtualRouterElement.class); - addService("CiscoNexusVSMElementService", CiscoNexusVSMElementService.class, CiscoNexusVSMElement.class); } @Override diff --git a/server/src/com/cloud/configuration/PremiumComponentLibrary.java b/server/src/com/cloud/configuration/PremiumComponentLibrary.java index fd240f6e92a..1a656eb05db 100755 --- a/server/src/com/cloud/configuration/PremiumComponentLibrary.java +++ b/server/src/com/cloud/configuration/PremiumComponentLibrary.java @@ -23,7 +23,6 @@ import com.cloud.baremetal.PxeServerManager.PxeServerType; import com.cloud.baremetal.PxeServerManagerImpl; import com.cloud.baremetal.PxeServerService; import com.cloud.ha.HighAvailabilityManagerExtImpl; -import com.cloud.hypervisor.vmware.VmwareManagerImpl; import com.cloud.netapp.NetappManagerImpl; import com.cloud.netapp.dao.LunDaoImpl; import com.cloud.netapp.dao.PoolDaoImpl; @@ -60,7 +59,6 @@ public class PremiumComponentLibrary extends DefaultComponentLibrary { addManager("secondary storage vm manager", PremiumSecondaryStorageManagerImpl.class); addManager("HA Manager", HighAvailabilityManagerExtImpl.class); - addManager("VMWareManager", VmwareManagerImpl.class); addManager("ExternalNetworkManager", ExternalNetworkDeviceManagerImpl.class); addManager("BareMetalVmManager", BareMetalVmManagerImpl.class); addManager("ExternalDhcpManager", ExternalDhcpManagerImpl.class); diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java index 423e6dfa707..73935f12a3b 100755 --- a/server/src/com/cloud/resource/ResourceManagerImpl.java +++ b/server/src/com/cloud/resource/ResourceManagerImpl.java @@ -95,9 +95,7 @@ import com.cloud.host.dao.HostTagsDao; import com.cloud.hypervisor.Hypervisor; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.kvm.resource.KvmDummyResourceBase; -import com.cloud.network.CiscoNexusVSMDeviceVO; import com.cloud.network.IPAddressVO; -import com.cloud.network.dao.CiscoNexusVSMDeviceDao; import com.cloud.network.dao.IPAddressDao; import com.cloud.org.Cluster; import com.cloud.org.Grouping; @@ -173,10 +171,6 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma @Inject protected ClusterDao _clusterDao; @Inject - protected ClusterVSMMapDao _clusterVSMDao; - @Inject - protected CiscoNexusVSMDeviceDao _vsmDao; - @Inject protected CapacityDao _capacityDao; @Inject protected HostDao _hostDao; @@ -434,95 +428,6 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma clusterId = cluster.getId(); result.add(cluster); - // Check if we're associating a Cisco Nexus VSM with a vmware cluster. - if (hypervisorType == HypervisorType.VMware && - Boolean.parseBoolean(_configDao.getValue(Config.VmwareUseNexusVSwitch.toString()))) { - String vsmIp = cmd.getVSMIpaddress(); - String vsmUser = cmd.getVSMUsername(); - String vsmPassword = cmd.getVSMPassword(); - - if(vsmIp != null && vsmUser != null && vsmPassword != null) { - NetconfHelper netconfClient; - try { - netconfClient = new NetconfHelper(vsmIp, vsmUser, vsmPassword); - netconfClient.disconnect(); - } catch (CloudRuntimeException e) { - String msg = "Invalid credentials supplied for user " + vsmUser + " for Cisco Nexus 1000v VSM at " + vsmIp; - s_logger.error(msg); - _clusterDao.remove(clusterId); - throw new CloudRuntimeException(msg); - } - - Transaction txn; - - // If VSM already exists and is mapped to a cluster, fail this operation. - CiscoNexusVSMDeviceVO vsm = _vsmDao.getVSMbyIpaddress(vsmIp); - if(vsm != null) { - List clusterList = _clusterVSMDao.listByVSMId(vsm.getId()); - if (clusterList != null && !clusterList.isEmpty()) { - s_logger.error("Failed to add cluster: specified Nexus VSM is already associated with another cluster"); - _clusterDao.remove(clusterId); - ResourceInUseException ex = new ResourceInUseException("Failed to add cluster: specified Nexus VSM is already associated with another cluster with specified Id"); - ex.addProxyObject("cluster", clusterList.get(0).getClusterId(), "clusterId"); - throw ex; - } - } - // persist credentials to database if the VSM entry is not already in the db. - if (_vsmDao.getVSMbyIpaddress(vsmIp) == null) { - vsm = new CiscoNexusVSMDeviceVO(vsmIp, vsmUser, vsmPassword); - txn = Transaction.currentTxn(); - try { - txn.start(); - vsm = _vsmDao.persist(vsm); - txn.commit(); - } catch (Exception e) { - txn.rollback(); - s_logger.error("Failed to persist Cisco Nexus 1000v VSM details to database. Exception: " + e.getMessage()); - // Removing the cluster record which was added already because the persistence of Nexus VSM credentials has failed. - _clusterDao.remove(clusterId); - throw new CloudRuntimeException(e.getMessage()); - } - } - // Create a mapping between the cluster and the vsm. - vsm = _vsmDao.getVSMbyIpaddress(vsmIp); - if (vsm != null) { - ClusterVSMMapVO connectorObj = new ClusterVSMMapVO(clusterId, vsm.getId()); - txn = Transaction.currentTxn(); - try { - txn.start(); - _clusterVSMDao.persist(connectorObj); - txn.commit(); - } catch (Exception e) { - txn.rollback(); - s_logger.error("Failed to associate Cisco Nexus 1000v VSM with cluster: " + clusterName + ". Exception: " + e.getMessage()); - _clusterDao.remove(clusterId); - throw new CloudRuntimeException(e.getMessage()); - } - } - } else { - String msg; - msg = "The global parameter " + Config.VmwareUseNexusVSwitch.toString() + - " is set to \"true\". Following mandatory parameters are not specified. "; - if(vsmIp == null) { - msg += "vsmipaddress: Management IP address of Cisco Nexus 1000v dvSwitch. "; - } - if(vsmUser == null) { - msg += "vsmusername: Name of a user account with admin privileges over Cisco Nexus 1000v dvSwitch. "; - } - if(vsmPassword == null) { - if(vsmUser != null) { - msg += "vsmpassword: Password of user account " + vsmUser + ". "; - } else { - msg += "vsmpassword: Password of user account with admin privileges over Cisco Nexus 1000v dvSwitch. "; - } - } - s_logger.error(msg); - // Cleaning up the cluster record as addCluster operation failed because Nexus dvSwitch credentials are supplied. - _clusterDao.remove(clusterId); - throw new CloudRuntimeException(msg); - } - } - if (clusterType == Cluster.ClusterType.CloudManaged) { return result; } diff --git a/core/src/com/cloud/hypervisor/vmware/resource/SshHelper.java b/utils/src/com/cloud/utils/ssh/SshHelper.java similarity index 99% rename from core/src/com/cloud/hypervisor/vmware/resource/SshHelper.java rename to utils/src/com/cloud/utils/ssh/SshHelper.java index e85e9ca7a3a..f29b368cbe5 100755 --- a/core/src/com/cloud/hypervisor/vmware/resource/SshHelper.java +++ b/utils/src/com/cloud/utils/ssh/SshHelper.java @@ -10,7 +10,7 @@ // limitations under the License. // // Automatically generated by addcopyright.py at 04/03/2012 -package com.cloud.hypervisor.vmware.resource; +package com.cloud.utils.ssh; import java.io.File; import java.io.InputStream; From d03fb2a7e2af8d7b682445f42312797c7efa0f3d Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 22 Jun 2012 15:14:45 -0700 Subject: [PATCH 19/37] cloudstack 3.0 UI - (1) to distinguish between getUpdatedItem() and getUpdatedData(), rename getUpdatedData() to getUpdatedItemWhenAsyncJobFails() since it's being called only when async job fails. (2) fix the space problem (tab size is not 2) from patch. --- ui/scripts/instances.js | 26 +++++++++++++------------- ui/scripts/sharedFunctions.js | 16 ++++++++-------- ui/scripts/ui/widgets/listView.js | 22 +++++++++++----------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index 969a6572a96..77688c978a6 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -541,7 +541,7 @@ dataType: "json", success: function(json) { var jid = json.deployvirtualmachineresponse.jobid; - var vmid = json.deployvirtualmachineresponse.id; + var vmid = json.deployvirtualmachineresponse.id; args.response.success( {_custom: {jobId: jid, @@ -554,18 +554,18 @@ getActionFilter: function() { return vmActionfilter; }, - getUpdatedData: function() { - var item; - $.ajax({ - url: createURL("listVirtualMachines&id="+vmid), - dataType: "json", - async: false, - success: function(json) { - item = json.listvirtualmachinesresponse.virtualmachine[0]; - } - }); - return item; - } + getUpdatedItemWhenAsyncJobFails: function() { + var item; + $.ajax({ + url: createURL("listVirtualMachines&id="+vmid), + dataType: "json", + async: false, + success: function(json) { + item = json.listvirtualmachinesresponse.virtualmachine[0]; + } + }); + return item; + } } } ); diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 8fc5c78a796..cf437afed52 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -86,14 +86,14 @@ var pollAsyncJobResult = function(args) { } else if (result.jobstatus == 2) { // Failed var msg = (result.jobresult.errortext == null)? "": result.jobresult.errortext; - if (args._custom.getUpdatedData != null && args._custom.getActionFilter != null) { - args.error({message: msg, updatedData: args._custom.getUpdatedData(), actionFilter: args._custom.getActionFilter()}); - } else if (args._custom.getUpdatedData != null && args._custom.getActionFilter == null) { - args.error({message: msg, updatedData: args._custom.getUpdatedData()}); - } - else { - args.error({message: msg}); - } + if (args._custom.getUpdatedItemWhenAsyncJobFails != null && args._custom.getActionFilter != null) { + args.error({message: msg, updatedData: args._custom.getUpdatedItemWhenAsyncJobFails(), actionFilter: args._custom.getActionFilter()}); + } else if (args._custom.getUpdatedItemWhenAsyncJobFails != null && args._custom.getActionFilter == null) { + args.error({message: msg, updatedData: args._custom.getUpdatedItemWhenAsyncJobFails()}); + } + else { + args.error({message: msg}); + } } } }, diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js index c893b1fd5ed..9ba57301c34 100644 --- a/ui/scripts/ui/widgets/listView.js +++ b/ui/scripts/ui/widgets/listView.js @@ -97,17 +97,17 @@ // Error function(args) { - if (args && args.updatedData) { - if ($item.is(':visible') && !isHeader) { - replaceItem( - $item, - args.updatedData, - args.actionFilter - ); - } - } else { - $item.remove(); - } + if (args && args.updatedData) { + if ($item.is(':visible') && !isHeader) { + replaceItem( + $item, + args.updatedData, + args.actionFilter + ); + } + } else { + $item.remove(); + } } ); } From a30fe62b116e6f192bc2a52cfa51b3280693699f Mon Sep 17 00:00:00 2001 From: olgasmola Date: Mon, 18 Jun 2012 16:04:37 +0300 Subject: [PATCH 20/37] CS-14047: Return the user to the log in page when login time out. --- ui/scripts/cloudStack.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index 1decd685637..3293c2540f0 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -66,14 +66,31 @@ dataType: 'json', cache: false, error: function(data) { - cloudStack.dialog.notice({ message: parseXMLHttpResponse(data) }); + var clickAction = false; + if (isValidJsonString(data.responseText)) { + var json = JSON.parse(data.responseText); + if (json != null) { + var property; + for(property in json) {} + var errorObj = json[property]; + if(errorObj.errorcode == 401 && errorObj.errortext == "unable to verify user credentials and/or request signature") { + clickAction = function() { + $('#user-options a').eq(0).trigger('click'); + }; + } + } + } + cloudStack.dialog.notice({ message: parseXMLHttpResponse(data), clickAction: clickAction }); }, - beforeSend: function(XMLHttpRequest) { + beforeSend: function(XMLHttpRequest) { if (g_mySession == $.cookie("JSESSIONID")) { return true; } else { - cloudStack.dialog.notice({ message: _l('label.session.expired') }); + var clickAction = function() { + $('#user-options a').eq(0).trigger('click'); + }; + cloudStack.dialog.notice({ message: _l('label.session.expired'), clickAction: clickAction }); return false; } } From af1d5d00f7c072a9fd7a168bb67b9124faaf499b Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 27 Jun 2012 13:52:06 -0700 Subject: [PATCH 21/37] cloudstack 3.0 UI - fix space problem from a patch --- ui/scripts/cloudStack.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index 3293c2540f0..1d2dbe8f438 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -66,21 +66,21 @@ dataType: 'json', cache: false, error: function(data) { - var clickAction = false; - if (isValidJsonString(data.responseText)) { - var json = JSON.parse(data.responseText); - if (json != null) { - var property; - for(property in json) {} - var errorObj = json[property]; - if(errorObj.errorcode == 401 && errorObj.errortext == "unable to verify user credentials and/or request signature") { - clickAction = function() { - $('#user-options a').eq(0).trigger('click'); - }; + var clickAction = false; + if (isValidJsonString(data.responseText)) { + var json = JSON.parse(data.responseText); + if (json != null) { + var property; + for(property in json) {} + var errorObj = json[property]; + if(errorObj.errorcode == 401 && errorObj.errortext == "unable to verify user credentials and/or request signature") { + clickAction = function() { + $('#user-options a').eq(0).trigger('click'); + }; + } + } } - } - } - cloudStack.dialog.notice({ message: parseXMLHttpResponse(data), clickAction: clickAction }); + cloudStack.dialog.notice({ message: parseXMLHttpResponse(data), clickAction: clickAction }); }, beforeSend: function(XMLHttpRequest) { if (g_mySession == $.cookie("JSESSIONID")) { From 6015df9137a8e92f91aea479a4db08570fe51ab2 Mon Sep 17 00:00:00 2001 From: bfederle Date: Wed, 27 Jun 2012 16:20:30 -0700 Subject: [PATCH 22/37] CS-13535: Error handling for add domain operation Original patch by: olga.smola reviewed-by: jessica, r5583 --- ui/scripts/domains.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/scripts/domains.js b/ui/scripts/domains.js index b288e24db22..439f73a3947 100644 --- a/ui/scripts/domains.js +++ b/ui/scripts/domains.js @@ -172,6 +172,10 @@ success: function(json) { var item = json.createdomainresponse.domain; args.response.success({data: item}); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); } }); }, From 3938c24b45159640d605d7f9a4166af21e6dbf05 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 27 Jun 2012 16:42:43 -0700 Subject: [PATCH 23/37] CS-15356: cloudstack 3.0 API - updateZone API - when internaldns2 parameter is not being passed to updateZone API, leave it as is (i.e. remain original value of internaldns2). --- .../src/com/cloud/configuration/ConfigurationManagerImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index d4891086ffe..078916e4e19 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -1427,6 +1427,10 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura internalDns1 = zone.getInternalDns1(); } + if (internalDns2 == null) { + internalDns2 = zone.getInternalDns2(); + } + if (guestCidr == null) { guestCidr = zone.getGuestNetworkCidr(); } From 5f6387e113871554c2947b5b0bc2fa8678c7b453 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Wed, 27 Jun 2012 23:28:34 -0700 Subject: [PATCH 24/37] add clouddev --- build.xml | 1 + build/build-clouddev.xml | 93 + .../xen/discoverer/XcpServerDiscoverer.java | 81 +- .../xen/resource/CitrixResourceBase.java | 44 +- .../xen/resource/XcpOssResource.java | 127 ++ .../vm/hypervisor/xenserver/xcposs/NFSSR.py | 258 +++ .../xcposs/copy_vhd_from_secondarystorage.sh | 184 ++ .../xcposs/copy_vhd_to_secondarystorage.sh | 126 ++ .../create_privatetemplate_from_snapshot.sh | 134 ++ scripts/vm/hypervisor/xenserver/xcposs/patch | 49 + scripts/vm/hypervisor/xenserver/xcposs/vmops | 1519 +++++++++++++++++ .../hypervisor/xenserver/xcposs/vmopsSnapshot | 552 ++++++ .../hypervisor/xenserver/xcposs/vmopspremium | 129 ++ .../consoleproxy/ConsoleProxyManagerImpl.java | 4 +- .../VirtualNetworkApplianceManagerImpl.java | 4 +- .../SecondaryStorageManagerImpl.java | 4 +- server/src/com/cloud/test/DatabaseConfig.java | 2 + setup/db/clouddev.sql | 33 + setup/db/deploy-db-clouddev.sh | 23 + 19 files changed, 3322 insertions(+), 45 deletions(-) create mode 100644 build/build-clouddev.xml create mode 100644 plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java create mode 100644 scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py create mode 100644 scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_from_secondarystorage.sh create mode 100644 scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_to_secondarystorage.sh create mode 100644 scripts/vm/hypervisor/xenserver/xcposs/create_privatetemplate_from_snapshot.sh create mode 100644 scripts/vm/hypervisor/xenserver/xcposs/patch create mode 100644 scripts/vm/hypervisor/xenserver/xcposs/vmops create mode 100644 scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot create mode 100644 scripts/vm/hypervisor/xenserver/xcposs/vmopspremium create mode 100644 setup/db/clouddev.sql create mode 100644 setup/db/deploy-db-clouddev.sh diff --git a/build.xml b/build.xml index 4004117931a..9e217ff5080 100755 --- a/build.xml +++ b/build.xml @@ -27,6 +27,7 @@ + diff --git a/build/build-clouddev.xml b/build/build-clouddev.xml new file mode 100644 index 00000000000..d557ef6b883 --- /dev/null +++ b/build/build-clouddev.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java index 8a6c60546d0..4fd202beedc 100755 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java @@ -59,6 +59,7 @@ import com.cloud.host.Status; import com.cloud.hypervisor.Hypervisor; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.xen.resource.CitrixResourceBase; +import com.cloud.hypervisor.xen.resource.XcpOssResource; import com.cloud.hypervisor.xen.resource.XcpServerResource; import com.cloud.hypervisor.xen.resource.XenServer56FP1Resource; import com.cloud.hypervisor.xen.resource.XenServer56Resource; @@ -253,8 +254,15 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L String hostAddr = record.address; String prodVersion = record.softwareVersion.get("product_version"); + if (prodVersion == null) { + prodVersion = record.softwareVersion.get("platform_version"); + } String xenVersion = record.softwareVersion.get("xen"); String hostOS = record.softwareVersion.get("product_brand"); + if (hostOS == null) { + hostOS = record.softwareVersion.get("platform_name"); + } + String hostOSVer = prodVersion; String hostKernelVer = record.softwareVersion.get("linux"); @@ -400,34 +408,49 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L } protected CitrixResourceBase createServerResource(long dcId, Long podId, Host.Record record) { - String prodBrand = record.softwareVersion.get("product_brand").trim(); - String prodVersion = record.softwareVersion.get("product_version").trim(); - - if(prodBrand.equals("XCP") && (prodVersion.equals("1.0.0") || prodVersion.equals("1.1.0") || prodVersion.equals("5.6.100") || prodVersion.startsWith("1.4") )) - return new XcpServerResource(); + String prodBrand = record.softwareVersion.get("product_brand"); + if (prodBrand == null) { + prodBrand = record.softwareVersion.get("platform_name").trim(); + } else { + prodBrand = prodBrand.trim(); + } + String prodVersion = record.softwareVersion.get("product_version"); + if (prodVersion == null) { + prodVersion = record.softwareVersion.get("platform_version").trim(); + } else { + prodVersion = prodVersion.trim(); + } - if(prodBrand.equals("XenServer") && prodVersion.equals("5.6.0")) - return new XenServer56Resource(); - - if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.0")) - return new XenServer600Resource(); - - if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.2")) - return new XenServer602Resource(); + if(prodBrand.equals("XCP") && (prodVersion.equals("1.0.0") || prodVersion.equals("1.1.0") || prodVersion.equals("5.6.100") || prodVersion.startsWith("1.4") )) + return new XcpServerResource(); + + if(prodBrand.equals("XenServer") && prodVersion.equals("5.6.0")) + return new XenServer56Resource(); + + if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.0")) + return new XenServer600Resource(); + + if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.2")) + return new XenServer602Resource(); + + if(prodBrand.equals("XenServer") && prodVersion.equals("5.6.100")) { + String prodVersionTextShort = record.softwareVersion.get("product_version_text_short").trim(); + if("5.6 SP2".equals(prodVersionTextShort)) { + return new XenServer56SP2Resource(); + } else if("5.6 FP1".equals(prodVersionTextShort)) { + return new XenServer56FP1Resource(); + } + } + + if (prodBrand.equals("XCP_Kronos")) { + return new XcpOssResource(); + } + + String msg = "Only support XCP 1.0.0, 1.1.0, 1.5 beta; XenServer 5.6, XenServer 5.6 FP1, XenServer 5.6 SP2, Xenserver 6.0, 6.0.2 but this one is " + prodBrand + " " + prodVersion; + _alertMgr.sendAlert(AlertManager.ALERT_TYPE_HOST, dcId, podId, msg, msg); + s_logger.debug(msg); + throw new RuntimeException(msg); - if(prodBrand.equals("XenServer") && prodVersion.equals("5.6.100")) { - String prodVersionTextShort = record.softwareVersion.get("product_version_text_short").trim(); - if("5.6 SP2".equals(prodVersionTextShort)) { - return new XenServer56SP2Resource(); - } else if("5.6 FP1".equals(prodVersionTextShort)) { - return new XenServer56FP1Resource(); - } - } - - String msg = "Only support XCP 1.0.0, 1.1.0, 1.5 beta; XenServer 5.6, XenServer 5.6 FP1, XenServer 5.6 SP2, Xenserver 6.0, 6.0.2 but this one is " + prodBrand + " " + prodVersion; - _alertMgr.sendAlert(AlertManager.ALERT_TYPE_HOST, dcId, podId, msg, msg); - s_logger.debug(msg); - throw new RuntimeException(msg); } protected void serverConfig() { @@ -457,8 +480,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L Boolean.parseBoolean(value); value = _params.get("xen.check.hvm"); - _checkHvm = value == null ? true : Boolean.parseBoolean(value); - + _checkHvm = false; _connPool = XenServerConnectionPool.getInstance(); _agentMgr.registerForHostEvents(this, true, false, true); @@ -567,7 +589,10 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L } else if("5.6 FP1".equals(prodVersionTextShort)) { resource = XenServer56FP1Resource.class.getName(); } + } else if (prodBrand.equals("XCP_Kronos")) { + resource = XcpOssResource.class.getName(); } + if( resource == null ){ String msg = "Only support XCP 1.0.0, 1.1.0, 1.5 beta; XenServer 5.6, 5.6 FP1, 5.6 SP2 and Xenserver 6.0 , 6.0.2 but this one is " + prodBrand + " " + prodVersion; s_logger.debug(msg); diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 39172423e36..496aeb33020 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -286,7 +286,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe protected List _tmpDom0Vif = new ArrayList(); public enum SRType { - NFS, LVM, ISCSI, ISO, LVMOISCSI, LVMOHBA, EXT; + NFS, LVM, ISCSI, ISO, LVMOISCSI, LVMOHBA, EXT, FILE; String _str; @@ -1066,7 +1066,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe } protected VBD createPatchVbd(Connection conn, String vmName, VM vm) throws XmlRpcException, XenAPIException { - + if( _host.systemvmisouuid == null ) { Set srs = SR.getByNameLabel(conn, "XenServer Tools"); if( srs.size() != 1 ) { @@ -1100,8 +1100,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe cdromVBDR.type = Types.VbdType.CD; VBD cdromVBD = VBD.create(conn, cdromVBDR); cdromVBD.insert(conn, VDI.getByUuid(conn, _host.systemvmisouuid)); - - return cdromVBD; + + return cdromVBD; } protected void destroyPatchVbd(Connection conn, String vmName) throws XmlRpcException, XenAPIException { @@ -3870,7 +3870,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe Map map = SR.getAllRecords(conn); for (Map.Entry entry : map.entrySet()) { SR.Record srRec = entry.getValue(); - if (SRType.EXT.equals(srRec.type)) { + if (SRType.FILE.equals(srRec.type) || SRType.EXT.equals(srRec.type)) { Set pbds = srRec.PBDs; if (pbds == null) { continue; @@ -3902,6 +3902,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe SR lvmsr = getLocalLVMSR(conn); if (lvmsr != null) { try { + _host.localSRuuid = lvmsr.getUuid(conn); + String lvmuuid = lvmsr.getUuid(conn); long cap = lvmsr.getPhysicalSize(conn); if (cap > 0) { @@ -3932,6 +3934,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe if (extsr != null) { try { String extuuid = extsr.getUuid(conn); + _host.localSRuuid = extuuid; long cap = extsr.getPhysicalSize(conn); if (cap > 0) { long avail = cap - extsr.getPhysicalUtilisation(conn); @@ -3956,6 +3959,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe s_logger.warn(msg); } } + return null; } @@ -4033,7 +4037,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe break; } Host.Record hr = myself.getRecord(conn); - _host.product_version = hr.softwareVersion.get("product_version").trim(); + + _host.product_version = hr.softwareVersion.get("product_version"); + if (_host.product_version == null) { + _host.product_version = hr.softwareVersion.get("platform_version"); + } else { + _host.product_version = _host.product_version.trim(); + } XsLocalNetwork privateNic = getManagementNetwork(conn); _privateNetworkName = privateNic.getNetworkRecord(conn).nameLabel; @@ -4493,8 +4503,10 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe } finally { sshConnection.close(); } + hr.tags.add("vmops-version-" + version); host.setTags(conn, hr.tags); + return true; } catch (XenAPIException e) { String msg = "Xen setup failed due to " + e.toString(); @@ -5106,13 +5118,19 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe if (details == null) { details = new HashMap(); } - details.put("product_brand", hr.softwareVersion.get("product_brand")); - details.put("product_version", hr.softwareVersion.get("product_version")); + + String productBrand = hr.softwareVersion.get("product_brand"); + if (productBrand == null) { + productBrand = hr.softwareVersion.get("platform_name"); + } + details.put("product_brand", productBrand); + details.put("product_version", _host.product_version); + if( hr.softwareVersion.get("product_version_text_short") != null ) { details.put("product_version_text_short", hr.softwareVersion.get("product_version_text_short")); cmd.setHypervisorVersion(hr.softwareVersion.get("product_version_text_short")); }else{ - cmd.setHypervisorVersion(hr.softwareVersion.get("product_version")); + cmd.setHypervisorVersion(_host.product_version); } if (_privateNetworkName != null) { details.put("private.network.device", _privateNetworkName); @@ -5165,9 +5183,9 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe cmd.setPrivateMacAddress(pifr.MAC); cmd.setPrivateNetmask(pifr.netmask); } else { - String msg = "Private network " + _privateNetworkName + " doesn't have IP address, please check the host network configuration"; - s_logger.error(msg); - throw new CloudRuntimeException(msg); + cmd.setPrivateIpAddress(_host.ip); + cmd.setPrivateMacAddress(pifr.MAC); + cmd.setPrivateNetmask("255.255.255.0"); } pif = PIF.getByUuid(conn, _host.storagePif1); @@ -5330,7 +5348,6 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe vdir.virtualSize = dskch.getSize(); vdi = VDI.create(conn, vdir); } - VDI.Record vdir; vdir = vdi.getRecord(conn); s_logger.debug("Succesfully created VDI for " + cmd + ". Uuid = " + vdir.uuid); @@ -6764,6 +6781,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe public int speed; public int cpus; public String product_version; + public String localSRuuid; @Override public String toString() { diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java new file mode 100644 index 00000000000..ef44f5effa0 --- /dev/null +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpOssResource.java @@ -0,0 +1,127 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package com.cloud.hypervisor.xen.resource; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.ejb.Local; + +import org.apache.log4j.Logger; +import org.apache.xmlrpc.XmlRpcException; + +import com.cloud.agent.api.Answer; +import com.cloud.agent.api.Command; +import com.cloud.agent.api.NetworkUsageAnswer; +import com.cloud.agent.api.NetworkUsageCommand; +import com.cloud.agent.api.StartupRoutingCommand; +import com.cloud.resource.ServerResource; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.utils.script.Script; +import com.xensource.xenapi.Connection; +import com.xensource.xenapi.Types; +import com.xensource.xenapi.VBD; +import com.xensource.xenapi.VDI; +import com.xensource.xenapi.VM; +import com.xensource.xenapi.Types.XenAPIException; + +@Local(value=ServerResource.class) +public class XcpOssResource extends CitrixResourceBase { + private final static Logger s_logger = Logger.getLogger(XcpServerResource.class); + @Override + protected List getPatchFiles() { + List files = new ArrayList(); + String patch = "scripts/vm/hypervisor/xenserver/xcposs/patch"; + String patchfilePath = Script.findScript("", patch); + if (patchfilePath == null) { + throw new CloudRuntimeException("Unable to find patch file " + patch); + } + File file = new File(patchfilePath); + files.add(file); + return files; + } + + @Override + protected void fillHostInfo(Connection conn, StartupRoutingCommand cmd) { + super.fillHostInfo(conn, cmd); + cmd.setCaps(cmd.getCapabilities() + " , hvm"); + } + + @Override + protected String getGuestOsType(String stdType, boolean bootFromCD) { + return CitrixHelper.getXcpGuestOsType(stdType); + } + + protected VBD createPatchVbd(Connection conn, String vmName, VM vm) throws XmlRpcException, XenAPIException { + if (_host.localSRuuid != null) { + //create an iso vdi on it + String result = callHostPlugin(conn, "vmops", "createISOVHD", "uuid", _host.localSRuuid); + if (result == null || result.equalsIgnoreCase("Failed")) { + throw new CloudRuntimeException("can not create systemvm vdi"); + } + + Set vdis = VDI.getByNameLabel(conn, "systemvm-vdi"); + if (vdis.size() != 1) { + throw new CloudRuntimeException("can not find systemvmiso"); + } + VDI systemvmVDI = vdis.iterator().next(); + + VBD.Record cdromVBDR = new VBD.Record(); + cdromVBDR.VM = vm; + cdromVBDR.empty = false; + cdromVBDR.bootable = false; + cdromVBDR.userdevice = "3"; + cdromVBDR.mode = Types.VbdMode.RO; + cdromVBDR.type = Types.VbdType.DISK; + cdromVBDR.VDI = systemvmVDI; + VBD cdromVBD = VBD.create(conn, cdromVBDR); + return cdromVBD; + } else { + throw new CloudRuntimeException("can not find local sr"); + } + } + + + protected NetworkUsageAnswer execute(NetworkUsageCommand cmd) { + try { + Connection conn = getConnection(); + if(cmd.getOption()!=null && cmd.getOption().equals("create") ){ + String result = networkUsage(conn, cmd.getPrivateIP(), "create", null); + NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, result, 0L, 0L); + return answer; + } + long[] stats = getNetworkStats(conn, cmd.getPrivateIP()); + NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, "", stats[0], stats[1]); + return answer; + } catch (Exception ex) { + s_logger.warn("Failed to get network usage stats due to ", ex); + return new NetworkUsageAnswer(cmd, ex); + } + } + + @Override + public Answer executeRequest(Command cmd) { + if (cmd instanceof NetworkUsageCommand) { + return execute((NetworkUsageCommand) cmd); + } else { + return super.executeRequest(cmd); + } + } +} diff --git a/scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py b/scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py new file mode 100644 index 00000000000..f18a12e73e5 --- /dev/null +++ b/scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py @@ -0,0 +1,258 @@ +#!/usr/bin/python +# Copyright 2012 Citrix Systems, Inc. Licensed under the +# Apache License, Version 2.0 (the "License"); you may not use this +# file except in compliance with the License. Citrix Systems, Inc. +# reserves all rights not expressly granted by the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Automatically generated by addcopyright.py at 04/03/2012 +# FileSR: local-file storage repository + +import SR, VDI, SRCommand, FileSR, util +import errno +import os, re, sys, stat +import time +import xml.dom.minidom +import xs_errors +import nfs +import vhdutil +from lock import Lock +import cleanup + +CAPABILITIES = ["SR_PROBE","SR_UPDATE", "SR_CACHING", \ + "VDI_CREATE","VDI_DELETE","VDI_ATTACH","VDI_DETACH", \ + "VDI_UPDATE", "VDI_CLONE","VDI_SNAPSHOT","VDI_RESIZE", \ + "VDI_RESIZE_ONLINE", "VDI_RESET_ON_BOOT", "ATOMIC_PAUSE"] + +CONFIGURATION = [ [ 'server', 'hostname or IP address of NFS server (required)' ], \ + [ 'serverpath', 'path on remote server (required)' ] ] + + +DRIVER_INFO = { + 'name': 'NFS VHD', + 'description': 'SR plugin which stores disks as VHD files on a remote NFS filesystem', + 'vendor': 'Citrix Systems Inc', + 'copyright': '(C) 2008 Citrix Systems Inc', + 'driver_version': '1.0', + 'required_api_version': '1.0', + 'capabilities': CAPABILITIES, + 'configuration': CONFIGURATION + } + + +# The mountpoint for the directory when performing an sr_probe. All probes +PROBE_MOUNTPOINT = "probe" +NFSPORT = 2049 +DEFAULT_TRANSPORT = "tcp" + + +class NFSSR(FileSR.FileSR): + """NFS file-based storage repository""" + def handles(type): + return type == 'nfs' + handles = staticmethod(handles) + + + def load(self, sr_uuid): + self.ops_exclusive = FileSR.OPS_EXCLUSIVE + self.lock = Lock(vhdutil.LOCK_TYPE_SR, self.uuid) + self.sr_vditype = SR.DEFAULT_TAP + if not self.dconf.has_key('server'): + raise xs_errors.XenError('ConfigServerMissing') + self.remoteserver = self.dconf['server'] + self.path = os.path.join(SR.MOUNT_BASE, sr_uuid) + + # Test for the optional 'nfsoptions' dconf attribute + self.transport = DEFAULT_TRANSPORT + if self.dconf.has_key('useUDP') and self.dconf['useUDP'] == 'true': + self.transport = "udp" + + + def validate_remotepath(self, scan): + if not self.dconf.has_key('serverpath'): + if scan: + try: + self.scan_exports(self.dconf['server']) + except: + pass + raise xs_errors.XenError('ConfigServerPathMissing') + if not self._isvalidpathstring(self.dconf['serverpath']): + raise xs_errors.XenError('ConfigServerPathBad', \ + opterr='serverpath is %s' % self.dconf['serverpath']) + + def check_server(self): + try: + nfs.check_server_tcp(self.remoteserver) + except nfs.NfsException, exc: + raise xs_errors.XenError('NFSVersion', + opterr=exc.errstr) + + + def mount(self, mountpoint, remotepath): + try: + nfs.soft_mount(mountpoint, self.remoteserver, remotepath, self.transport) + except nfs.NfsException, exc: + raise xs_errors.XenError('NFSMount', opterr=exc.errstr) + + + def attach(self, sr_uuid): + self.validate_remotepath(False) + #self.remotepath = os.path.join(self.dconf['serverpath'], sr_uuid) + self.remotepath = self.dconf['serverpath'] + util._testHost(self.dconf['server'], NFSPORT, 'NFSTarget') + self.mount_remotepath(sr_uuid) + + + def mount_remotepath(self, sr_uuid): + if not self._checkmount(): + self.check_server() + self.mount(self.path, self.remotepath) + + return super(NFSSR, self).attach(sr_uuid) + + + def probe(self): + # Verify NFS target and port + util._testHost(self.dconf['server'], NFSPORT, 'NFSTarget') + + self.validate_remotepath(True) + self.check_server() + + temppath = os.path.join(SR.MOUNT_BASE, PROBE_MOUNTPOINT) + + self.mount(temppath, self.dconf['serverpath']) + try: + return nfs.scan_srlist(temppath) + finally: + try: + nfs.unmount(temppath, True) + except: + pass + + + def detach(self, sr_uuid): + """Detach the SR: Unmounts and removes the mountpoint""" + if not self._checkmount(): + return + util.SMlog("Aborting GC/coalesce") + cleanup.abort(self.uuid) + + # Change directory to avoid unmount conflicts + os.chdir(SR.MOUNT_BASE) + + try: + nfs.unmount(self.path, True) + except nfs.NfsException, exc: + raise xs_errors.XenError('NFSUnMount', opterr=exc.errstr) + + return super(NFSSR, self).detach(sr_uuid) + + + def create(self, sr_uuid, size): + util._testHost(self.dconf['server'], NFSPORT, 'NFSTarget') + self.validate_remotepath(True) + if self._checkmount(): + raise xs_errors.XenError('NFSAttached') + + # Set the target path temporarily to the base dir + # so that we can create the target SR directory + self.remotepath = self.dconf['serverpath'] + try: + self.mount_remotepath(sr_uuid) + except Exception, exn: + try: + os.rmdir(self.path) + except: + pass + raise exn + + #newpath = os.path.join(self.path, sr_uuid) + #if util.ioretry(lambda: util.pathexists(newpath)): + # if len(util.ioretry(lambda: util.listdir(newpath))) != 0: + # self.detach(sr_uuid) + # raise xs_errors.XenError('SRExists') + #else: + # try: + # util.ioretry(lambda: util.makedirs(newpath)) + # except util.CommandException, inst: + # if inst.code != errno.EEXIST: + # self.detach(sr_uuid) + # raise xs_errors.XenError('NFSCreate', + # opterr='remote directory creation error is %d' + # % inst.code) + self.detach(sr_uuid) + + def delete(self, sr_uuid): + # try to remove/delete non VDI contents first + super(NFSSR, self).delete(sr_uuid) + try: + if self._checkmount(): + self.detach(sr_uuid) + + # Set the target path temporarily to the base dir + # so that we can remove the target SR directory + self.remotepath = self.dconf['serverpath'] + self.mount_remotepath(sr_uuid) + newpath = os.path.join(self.path, sr_uuid) + + if util.ioretry(lambda: util.pathexists(newpath)): + util.ioretry(lambda: os.rmdir(newpath)) + self.detach(sr_uuid) + except util.CommandException, inst: + self.detach(sr_uuid) + if inst.code != errno.ENOENT: + raise xs_errors.XenError('NFSDelete') + + def vdi(self, uuid, loadLocked = False): + if not loadLocked: + return NFSFileVDI(self, uuid) + return NFSFileVDI(self, uuid) + + def _checkmount(self): + return util.ioretry(lambda: util.pathexists(self.path)) \ + and util.ioretry(lambda: util.ismount(self.path)) + + def scan_exports(self, target): + util.SMlog("scanning2 (target=%s)" % target) + dom = nfs.scan_exports(target) + print >>sys.stderr,dom.toprettyxml() + +class NFSFileVDI(FileSR.FileVDI): + def attach(self, sr_uuid, vdi_uuid): + try: + vdi_ref = self.sr.srcmd.params['vdi_ref'] + self.session.xenapi.VDI.remove_from_xenstore_data(vdi_ref, \ + "vdi-type") + self.session.xenapi.VDI.remove_from_xenstore_data(vdi_ref, \ + "storage-type") + self.session.xenapi.VDI.add_to_xenstore_data(vdi_ref, \ + "storage-type", "nfs") + except: + util.logException("NFSSR:attach") + pass + return super(NFSFileVDI, self).attach(sr_uuid, vdi_uuid) + + def get_mtime(self, path): + st = util.ioretry_stat(lambda: os.stat(path)) + return st[stat.ST_MTIME] + + def clone(self, sr_uuid, vdi_uuid): + timestamp_before = int(self.get_mtime(self.sr.path)) + ret = super(NFSFileVDI, self).clone(sr_uuid, vdi_uuid) + timestamp_after = int(self.get_mtime(self.sr.path)) + if timestamp_after == timestamp_before: + util.SMlog("SR dir timestamp didn't change, updating") + timestamp_after += 1 + os.utime(self.sr.path, (timestamp_after, timestamp_after)) + return ret + + +if __name__ == '__main__': + SRCommand.run(NFSSR, DRIVER_INFO) +else: + SR.registerSR(NFSSR) diff --git a/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_from_secondarystorage.sh b/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_from_secondarystorage.sh new file mode 100644 index 00000000000..074b8420a84 --- /dev/null +++ b/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_from_secondarystorage.sh @@ -0,0 +1,184 @@ +#!/bin/bash +# Copyright 2012 Citrix Systems, Inc. Licensed under the +# Apache License, Version 2.0 (the "License"); you may not use this +# file except in compliance with the License. Citrix Systems, Inc. +# reserves all rights not expressly granted by the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Automatically generated by addcopyright.py at 04/03/2012 + +#set -x + +usage() { + printf "Usage: %s [vhd file in secondary storage] [uuid of the source sr] [name label] \n" $(basename $0) +} + +cleanup() +{ + if [ ! -z $localmp ]; then + umount -fl $localmp + if [ $? -eq 0 ]; then + rmdir $localmp + fi + fi +} + +if [ -z $1 ]; then + usage + echo "2#no mountpoint" + exit 0 +else + mountpoint=${1%/*} + vhdfilename=${1##*/} +fi + +if [ -z $2 ]; then + usage + echo "3#no uuid of the source sr" + exit 0 +else + sruuid=$2 +fi + +type=$(xe sr-param-get uuid=$sruuid param-name=type) +if [ $? -ne 0 ]; then + echo "4#sr $sruuid doesn't exist" + exit 0 +fi + +if [ -z $3 ]; then + usage + echo "3#no namelabel" + exit 0 +else + namelabel=$3 +fi + +localmp=/var/run/cloud_mount/$(uuidgen -r) + +mkdir -p $localmp +if [ $? -ne 0 ]; then + echo "5#can't make dir $localmp" + exit 0 +fi + +mount -o tcp,soft,ro,timeo=133,retrans=1 $mountpoint $localmp +if [ $? -ne 0 ]; then + echo "6#can't mount $mountpoint to $localmp" + exit 0 +fi + +vhdfile=$localmp/$vhdfilename +if [ ${vhdfile%.vhd} == ${vhdfile} ] ; then + vhdfile=$(ls $vhdfile/*.vhd) + if [ $? -ne 0 ]; then + echo "7#There is no vhd file under $mountpoint" + cleanup + exit 0 + fi +fi + + + +VHDUTIL="/usr/bin/vhd-util" + +copyvhd() +{ + local desvhd=$1 + local srcvhd=$2 + local vsize=$3 + local type=$4 + local parent=`$VHDUTIL query -p -n $srcvhd` + if [ $? -ne 0 ]; then + echo "30#failed to query $srcvhd" + cleanup + exit 0 + fi + if [ "${parent##*vhd has}" = " no parent" ]; then + dd if=$srcvhd of=$desvhd bs=2M + if [ $? -ne 0 ]; then + echo "31#failed to dd $srcvhd to $desvhd" + cleanup + exit 0 + fi + if [ $type != "nfs" -a $type != "ext" -a $type != "file" ]; then + dd if=$srcvhd of=$desvhd bs=512 seek=$(($(($vsize/512))-1)) count=1 + $VHDUTIL modify -s $vsize -n $desvhd + if [ $? -ne 0 ]; then + echo "32#failed to set new vhd physical size for vdi vdi $uuid" + cleanup + exit 0 + fi + fi + else + copyvhd $desvhd $parent $vsize $type + $VHDUTIL coalesce -p $desvhd -n $srcvhd + if [ $? -ne 0 ]; then + echo "32#failed to coalesce $desvhd to $srcvhd" + cleanup + exit 0 + fi + fi +} + +size=$($VHDUTIL query -v -n $vhdfile) +uuid=$(xe vdi-create sr-uuid=$sruuid virtual-size=${size}MiB type=user name-label=$namelabel) +if [ $? -ne 0 ]; then + echo "9#can not create vdi in sr $sruuid" + cleanup + exit 0 +fi + + +if [ $type == "nfs" -o $type == "ext" ]; then + desvhd=/run/sr-mount/$sruuid/$uuid.vhd + copyvhd $desvhd $vhdfile 0 $type + +elif [ $type == "lvmoiscsi" -o $type == "lvm" -o $type == "lvmohba" ]; then + lvsize=$(xe vdi-param-get uuid=$uuid param-name=physical-utilisation) + if [ $? -ne 0 ]; then + echo "12#failed to get physical size of vdi $uuid" + cleanup + exit 0 + fi + desvhd=/dev/VG_XenStorage-$sruuid/VHD-$uuid + lvchange -ay $desvhd + if [ $? -ne 0 ]; then + echo "10#lvm can not make VDI $uuid visible" + cleanup + exit 0 + fi + copyvhd $desvhd $vhdfile $lvsize $type +elif [ $type == "file" ]; then + pbd=`xe sr-param-list uuid=$sruuid |grep PBDs | awk '{print $3}'` + path=`xe pbd-param-list uuid=$pbd |grep device-config |awk '{print $4}'` + desvhd=$path/$uuid.vhd + copyvhd $desvhd $vhdfile 0 $type + +else + echo "15#doesn't support sr type $type" + cleanup + exit 0 +fi + +$VHDUTIL set -n $desvhd -f "hidden" -v "0" > /dev/null +if [ $? -ne 0 ]; then + echo "21#failed to set hidden to 0 $desvhd" + cleanup + exit 0 +fi +xe sr-scan uuid=$sruuid +if [ $? -ne 0 ]; then + echo "14#failed to scan sr $sruuid" + cleanup + exit 0 +fi + +echo "0#$uuid" +cleanup +exit 0 diff --git a/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_to_secondarystorage.sh b/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_to_secondarystorage.sh new file mode 100644 index 00000000000..e972db60c49 --- /dev/null +++ b/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_to_secondarystorage.sh @@ -0,0 +1,126 @@ +#!/bin/bash +# Copyright 2012 Citrix Systems, Inc. Licensed under the +# Apache License, Version 2.0 (the "License"); you may not use this +# file except in compliance with the License. Citrix Systems, Inc. +# reserves all rights not expressly granted by the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Automatically generated by addcopyright.py at 04/03/2012 + +#set -x + +usage() { + printf "Usage: %s [mountpoint in secondary storage] [uuid of the source vdi] [uuid of the source sr]\n" $(basename $0) +} + +cleanup() +{ + if [ ! -z $localmp ]; then + umount $localmp + if [ $? -eq 0 ]; then + rmdir $localmp + fi + fi +} + +if [ -z $1 ]; then + usage + echo "1#no mountpoint" + exit 0 +else + mountpoint=$1 +fi + +if [ -z $2 ]; then + usage + echo "2#no uuid of the source sr" + exit 0 +else + vdiuuid=$2 +fi + + +if [ -z $3 ]; then + usage + echo "3#no uuid of the source sr" + exit 0 +else + sruuid=$3 +fi + +type=$(xe sr-param-get uuid=$sruuid param-name=type) +if [ $? -ne 0 ]; then + echo "4#sr $sruuid doesn't exist" + exit 0 +fi + +localmp=/var/run/cloud_mount/$(uuidgen -r) + +mkdir -p $localmp +if [ $? -ne 0 ]; then + echo "5#can't make dir $localmp" + exit 0 +fi + +mount -o tcp,soft,timeo=133,retrans=1 $mountpoint $localmp +if [ $? -ne 0 ]; then + echo "6#can't mount $mountpoint to $localmp" + exit 0 +fi + +vhdfile=$localmp/${vdiuuid}.vhd + +if [ $type == "nfs" -o $type == "ext" ]; then + dd if=/var/run/sr-mount/$sruuid/${vdiuuid}.vhd of=$vhdfile bs=2M + if [ $? -ne 0 ]; then + rm -f $vhdfile + echo "8#failed to copy /var/run/sr-mount/$sruuid/${vdiuuid}.vhd to secondarystorage" + cleanup + exit 0 + fi +elif [ $type == "lvmoiscsi" -o $type == "lvm" -o $type == "lvmohba" ]; then + lvchange -ay /dev/VG_XenStorage-$sruuid/VHD-$vdiuuid + if [ $? -ne 0 ]; then + echo "9#lvm can not make VDI $vdiuuid visible" + cleanup + exit 0 + fi + size=$(vhd-util query -s -n /dev/VG_XenStorage-$sruuid/VHD-$vdiuuid) + if [ $? -ne 0 ]; then + echo "10#can not get physical size of /dev/VG_XenStorage-$sruuid/VHD-$vdiuuid" + cleanup + exit 0 + fi +#in 2M unit + size=$((size>>21)) + size=$((size+1)) + dd if=/dev/VG_XenStorage-$sruuid/VHD-$vdiuuid of=$vhdfile bs=2M count=$size + if [ $? -ne 0 ]; then + rm -f $vhdfile + echo "8#failed to copy /dev/VG_XenStorage-$sruuid/VHD-$vdiuuid to secondarystorage" + cleanup + exit 0 + fi +#in byte unit + size=$((size<<21)) + vhd-util modify -s $size -n $vhdfile + if [ $? -ne 0 ]; then + rm -f $vhdfile + echo "11#failed to change $vhdfile physical size" + cleanup + exit 0 + fi +else + echo "15#doesn't support sr type $type" + cleanup + exit 0 +fi + +echo "0#$vdiuuid" +cleanup +exit 0 diff --git a/scripts/vm/hypervisor/xenserver/xcposs/create_privatetemplate_from_snapshot.sh b/scripts/vm/hypervisor/xenserver/xcposs/create_privatetemplate_from_snapshot.sh new file mode 100644 index 00000000000..c9c9b909d7d --- /dev/null +++ b/scripts/vm/hypervisor/xenserver/xcposs/create_privatetemplate_from_snapshot.sh @@ -0,0 +1,134 @@ +#!/bin/bash +# Copyright 2012 Citrix Systems, Inc. Licensed under the +# Apache License, Version 2.0 (the "License"); you may not use this +# file except in compliance with the License. Citrix Systems, Inc. +# reserves all rights not expressly granted by the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Automatically generated by addcopyright.py at 04/03/2012 + +#set -x + +usage() { + printf "Usage: %s [vhd file in secondary storage] [template directory in secondary storage] [template local dir] \n" $(basename $0) +} +options='tcp,soft,timeo=133,retrans=1' +cleanup() +{ + if [ ! -z $snapshotdir ]; then + umount $snapshotdir + if [ $? -eq 0 ]; then + rmdir $snapshotdir + fi + fi + if [ ! -z $templatedir ]; then + umount $templatedir + if [ $? -eq 0 ]; then + rmdir $templatedir + fi + fi +} + +if [ -z $1 ]; then + usage + echo "2#no vhd file path" + exit 0 +else + snapshoturl=${1%/*} + vhdfilename=${1##*/} +fi + +if [ -z $2 ]; then + usage + echo "3#no template path" + exit 0 +else + templateurl=$2 +fi + +if [ -z $3 ]; then + usage + echo "3#no template local dir" + exit 0 +else + tmpltLocalDir=$3 +fi + + +snapshotdir=/run/cloud_mount/$(uuidgen -r) +mkdir -p $snapshotdir +if [ $? -ne 0 ]; then + echo "4#cann't make dir $snapshotdir" + exit 0 +fi + +mount -o $options $snapshoturl $snapshotdir +if [ $? -ne 0 ]; then + rmdir $snapshotdir + echo "5#can not mount $snapshoturl to $snapshotdir" + exit 0 +fi + +templatedir=/run/cloud_mount/$tmpltLocalDir +mkdir -p $templatedir +if [ $? -ne 0 ]; then + templatedir="" + cleanup + echo "6#cann't make dir $templatedir" + exit 0 +fi + +mount -o $options $templateurl $templatedir +if [ $? -ne 0 ]; then + rmdir $templatedir + templatedir="" + cleanup + echo "7#can not mount $templateurl to $templatedir" + exit 0 +fi + +VHDUTIL="vhd-util" + +copyvhd() +{ + local desvhd=$1 + local srcvhd=$2 + local parent= + parent=`$VHDUTIL query -p -n $srcvhd` + if [ $? -ne 0 ]; then + echo "30#failed to query $srcvhd" + cleanup + exit 0 + fi + if [[ "${parent}" =~ " no parent" ]]; then + dd if=$srcvhd of=$desvhd bs=2M + if [ $? -ne 0 ]; then + echo "31#failed to dd $srcvhd to $desvhd" + cleanup + exit 0 + fi + else + copyvhd $desvhd $parent + $VHDUTIL coalesce -p $desvhd -n $srcvhd + if [ $? -ne 0 ]; then + echo "32#failed to coalesce $desvhd to $srcvhd" + cleanup + exit 0 + fi + fi +} + +templateuuid=$(uuidgen -r) +desvhd=$templatedir/$templateuuid.vhd +srcvhd=$snapshotdir/$vhdfilename +copyvhd $desvhd $srcvhd +virtualSize=`$VHDUTIL query -v -n $desvhd` +physicalSize=`ls -l $desvhd | awk '{print $5}'` +cleanup +echo "0#$templateuuid#$physicalSize#$virtualSize" +exit 0 diff --git a/scripts/vm/hypervisor/xenserver/xcposs/patch b/scripts/vm/hypervisor/xenserver/xcposs/patch new file mode 100644 index 00000000000..8ddccc7577b --- /dev/null +++ b/scripts/vm/hypervisor/xenserver/xcposs/patch @@ -0,0 +1,49 @@ +# This file specifies the files that need +# to be transferred over to the XenServer. +# The format of this file is as follows: +# [Name of file]=[source path],[file permission],[destination path] +# [destination path] is required. +# If [file permission] is missing, 755 is assumed. +# If [source path] is missing, it looks in the same +# directory as the patch file. +# If [source path] starts with '/', then it is absolute path. +# If [source path] starts with '~', then it is path relative to management server home directory. +# If [source path] does not start with '/' or '~', then it is relative path to the location of the patch file. +NFSSR.py=/usr/lib/xcp/sm +vmops=.,0755,/usr/lib/xcp/plugins +ovsgre=..,0755,/usr/lib/xcp/plugins +ovstunnel=..,0755,/usr/lib/xcp/plugins +vmopsSnapshot=.,0755,/usr/lib/xcp/plugins +hostvmstats.py=..,0755,/usr/lib/xcp/sm +systemvm.iso=../../../../../vms,0644,/usr/share/xcp/packages/iso/ +id_rsa.cloud=../../../systemvm,0600,/root/.ssh +network_info.sh=..,0755,/usr/lib/xcp/bin +setupxenserver.sh=..,0755,/usr/lib/xcp/bin +make_migratable.sh=..,0755,/usr/lib/xcp/bin +setup_iscsi.sh=..,0755,/usr/lib/xcp/bin +pingtest.sh=../../..,0755,/usr/lib/xcp/bin +dhcp_entry.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin +ipassoc.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin +vm_data.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin +save_password_to_domr.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin +networkUsage.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin +call_firewall.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin +call_loadbalancer.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin +l2tp_vpn.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin +cloud-setup-bonding.sh=..,0755,/usr/lib/xcp/bin +copy_vhd_to_secondarystorage.sh=.,0755,/usr/lib/xcp/bin +copy_vhd_from_secondarystorage.sh=.,0755,/usr/lib/xcp/bin +setup_heartbeat_sr.sh=..,0755,/usr/lib/xcp/bin +setup_heartbeat_file.sh=..,0755,/usr/lib/xcp/bin +check_heartbeat.sh=..,0755,/usr/lib/xcp/bin +xenheartbeat.sh=..,0755,/usr/lib/xcp/bin +launch_hb.sh=..,0755,/usr/lib/xcp/bin +vhd-util=..,0755,/usr/lib/xcp/bin +vmopspremium=.,0755,/usr/lib/xcp/plugins +create_privatetemplate_from_snapshot.sh=.,0755,/usr/lib/xcp/bin +upgrade_snapshot.sh=..,0755,/usr/lib/xcp/bin +cloud-clean-vlan.sh=..,0755,/usr/lib/xcp/bin +cloud-prepare-upgrade.sh=..,0755,/usr/lib/xcp/bin +getRouterStatus.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin +bumpUpPriority.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin +getDomRVersion.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin diff --git a/scripts/vm/hypervisor/xenserver/xcposs/vmops b/scripts/vm/hypervisor/xenserver/xcposs/vmops new file mode 100644 index 00000000000..e4a2fdcd43f --- /dev/null +++ b/scripts/vm/hypervisor/xenserver/xcposs/vmops @@ -0,0 +1,1519 @@ +#!/usr/bin/python +# Version 2.2.8.2012-02-28T23:50:03Z +# +# A plugin for executing script needed by vmops cloud + +import os, sys, time +import XenAPIPlugin +sys.path.extend(["/usr/lib/xcp/sm/", "/usr/local/sbin/", "/sbin/"]) +import base64 +import hostvmstats +import socket +import stat +import tempfile +import util +import subprocess +import zlib +from util import CommandException + +def echo(fn): + def wrapped(*v, **k): + name = fn.__name__ + util.SMlog("#### VMOPS enter %s ####" % name ) + res = fn(*v, **k) + util.SMlog("#### VMOPS exit %s ####" % name ) + return res + return wrapped + +@echo +def gethostvmstats(session, args): + collect_host_stats = args['collectHostStats'] + consolidation_function = args['consolidationFunction'] + interval = args['interval'] + start_time = args['startTime'] + result = hostvmstats.get_stats(session, collect_host_stats, consolidation_function, interval, start_time) + return result + +@echo +def setup_iscsi(session, args): + uuid=args['uuid'] + try: + cmd = ["bash", "/usr/lib/xcp/bin/setup_iscsi.sh", uuid] + txt = util.pread2(cmd) + except: + txt = '' + return '> DONE <' + +@echo +def getvncport(session, args): + domid = args['domID'] + hvm = args['hvm'] + version = args['version'] + if hvm == 'true': + path1 = "/local/domain/" + domid + "/qemu-pid" + path2 = "/local/domain/" + domid + "/console/vnc-port" + else: + if version[:3] == '6.0': + path1 = "/local/domain/" + domid + "/vncterm-pid" + path2 = "/local/domain/" + domid + "/console/vnc-port" + else: + path1 = "/local/domain/" + domid + "/serial/0/vncterm-pid" + path2 = "/local/domain/" + domid + "/serial/0/vnc-port" + try: + cmd = ["xenstore-read", path1] + pid = util.pread2(cmd) + pid = pid.strip() + cmd = ["ps", pid] + util.pread2(cmd) + cmd = ["xenstore-read", path2] + vncport = util.pread2(cmd) + vncport = vncport.strip() + return vncport + except: + return '' + +@echo +def getgateway(session, args): + mgmt_ip = args['mgmtIP'] + try: + cmd = ["bash", "/usr/lib/xcp/bin/network_info.sh", "-g", mgmt_ip] + txt = util.pread2(cmd) + except: + txt = '' + + return txt + +@echo +def preparemigration(session, args): + uuid = args['uuid'] + try: + cmd = ["/usr/lib/xcp/bin/make_migratable.sh", uuid] + util.pread2(cmd) + txt = 'success' + except: + util.SMlog("Catch prepare migration exception" ) + txt = '' + + return txt + +@echo +def setIptables(session, args): + try: + '''cmd = ["/bin/bash", "/usr/lib/xcp/bin/setupxenserver.sh"] + txt = util.pread2(cmd)''' + txt = 'success' + except: + util.SMlog(" setIptables execution failed " ) + txt = '' + + return txt + +@echo +def pingdomr(session, args): + host = args['host'] + port = args['port'] + socket.setdefaulttimeout(3) + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + try: + s.connect((host,int(port))) + txt = 'success' + except: + txt = '' + + s.close() + + return txt + +@echo +def kill_copy_process(session, args): + namelabel = args['namelabel'] + try: + cmd = ["bash", "/usr/lib/xcp/bin/kill_copy_process.sh", namelabel] + txt = util.pread2(cmd) + except: + txt = 'false' + return txt + +@echo +def pingxenserver(session, args): + txt = 'success' + return txt + +@echo +def ipassoc(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/ipassoc.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + txt = 'success' + except: + util.SMlog(" ip associate failed " ) + txt = '' + + return txt + +@echo +def vm_data(session, args): + router_ip = args.pop('routerIP') + vm_ip = args.pop('vmIP') + + util.SMlog(" adding vmdata for VM with IP: " + vm_ip + " to router with IP: " + router_ip) + + for pair in args: + pairList = pair.split(',') + vmDataFolder = pairList[0] + vmDataFile = pairList[1] + vmDataValue = args[pair] + cmd = ["/bin/bash", "/usr/lib/xcp/bin/vm_data.sh", "-r", router_ip, "-v", vm_ip, "-F", vmDataFolder, "-f", vmDataFile] + + fd = None + tmp_path = None + + try: + fd,tmp_path = tempfile.mkstemp() + tmpfile = open(tmp_path, 'w') + + if vmDataFolder == "userdata" and vmDataValue != "none": + vmDataValue = base64.urlsafe_b64decode(vmDataValue) + + if vmDataValue != "none": + tmpfile.write(vmDataValue) + + tmpfile.close() + cmd.append("-d") + cmd.append(tmp_path) + except: + util.SMlog(" vmdata failed to write tempfile " ) + os.close(fd) + os.remove(tmp_path) + return '' + + try: + txt = util.pread2(cmd) + txt = 'success' + except: + util.SMlog(" vmdata failed with folder: " + vmDataFolder + " and file: " + vmDataFile) + txt = '' + + if (fd != None): + os.close(fd) + os.remove(tmp_path) + + return txt + +def pingtest(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/pingtest.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + txt = 'success' + except: + util.SMlog(" pingtest failed " ) + txt = '' + + return txt + +@echo +def savePassword(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/save_password_to_domr.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + txt = 'success' + except: + util.SMlog(" save password to domr failed " ) + txt = '' + + return txt + +@echo +def saveDhcpEntry(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/dhcp_entry.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + txt = 'success' + except: + util.SMlog(" save dhcp entry failed " ) + txt = '' + + return txt + +@echo +def lt2p_vpn(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/l2tp_vpn.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + txt = 'success' + except: + util.SMlog("l2tp vpn failed " ) + txt = '' + + return txt + +@echo +def setLinkLocalIP(session, args): + brName = args['brName'] + try: + cmd = ["ip", "route", "del", "169.254.0.0/16"] + txt = util.pread2(cmd) + except: + txt = '' + try: + cmd = ["ifconfig", brName, "169.254.0.1", "netmask", "255.255.0.0"] + txt = util.pread2(cmd) + except: + + try: + cmd = ["brctl", "addbr", brName] + txt = util.pread2(cmd) + except: + pass + + try: + cmd = ["ifconfig", brName, "169.254.0.1", "netmask", "255.255.0.0"] + txt = util.pread2(cmd) + except: + pass + try: + cmd = ["ip", "route", "add", "169.254.0.0/16", "dev", brName, "src", "169.254.0.1"] + txt = util.pread2(cmd) + except: + txt = '' + txt = 'success' + return txt + +@echo +def setFirewallRule(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/call_firewall.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + txt = 'success' + except: + util.SMlog(" set firewall rule failed " ) + txt = '' + + return txt + +@echo +def setLoadBalancerRule(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/call_loadbalancer.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + txt = 'success' + except: + util.SMlog(" set loadbalancer rule failed " ) + txt = '' + + return txt + +@echo +def createFile(session, args): + file_path = args['filepath'] + file_contents = args['filecontents'] + + try: + f = open(file_path, "w") + f.write(file_contents) + f.close() + txt = 'success' + except: + util.SMlog(" failed to create HA proxy cfg file ") + txt = '' + + return txt + +@echo +def deleteFile(session, args): + file_path = args["filepath"] + + try: + if os.path.isfile(file_path): + os.remove(file_path) + txt = 'success' + except: + util.SMlog(" failed to remove HA proxy cfg file ") + txt = '' + + return txt + + +@echo +def networkUsage(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/networkUsage.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + except: + util.SMlog(" network usage error " ) + txt = '' + + return txt + +def get_private_nic(session, args): + vms = session.xenapi.VM.get_all() + host_uuid = args.get('host_uuid') + host = session.xenapi.host.get_by_uuid(host_uuid) + piflist = session.xenapi.host.get_PIFs(host) + mgmtnic = 'eth0' + for pif in piflist: + pifrec = session.xenapi.PIF.get_record(pif) + network = pifrec.get('network') + nwrec = session.xenapi.network.get_record(network) + if nwrec.get('name_label') == 'cloud-guest': + return pifrec.get('device') + if pifrec.get('management'): + mgmtnic = pifrec.get('device') + + return mgmtnic + +def chain_name(vm_name): + if vm_name.startswith('i-') or vm_name.startswith('r-'): + if vm_name.endswith('untagged'): + return '-'.join(vm_name.split('-')[:-1]) + return vm_name + +def chain_name_def(vm_name): + if vm_name.startswith('i-'): + if vm_name.endswith('untagged'): + return '-'.join(vm_name.split('-')[:-2]) + "-def" + return '-'.join(vm_name.split('-')[:-1]) + "-def" + return vm_name + +def egress_chain_name(vm_name): + return chain_name(vm_name) + "-eg" + +@echo +def can_bridge_firewall(session, args): + try: + util.pread2(['ebtables', '-V']) + util.pread2(['ipset', '-V']) + except: + return 'false' + + host_uuid = args.get('host_uuid') + try: + util.pread2(['iptables', '-N', 'BRIDGE-FIREWALL']) + util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT']) + util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '-p', 'udp', '--dport', '67', '--sport', '68', '-j', 'ACCEPT']) + util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '-p', 'udp', '--dport', '68', '--sport', '67', '-j', 'ACCEPT']) + util.pread2(['iptables', '-D', 'FORWARD', '-j', 'RH-Firewall-1-INPUT']) + except: + util.SMlog('Chain BRIDGE-FIREWALL already exists') + privnic = get_private_nic(session, args) + result = 'true' + try: + util.pread2(['/bin/bash', '-c', 'iptables -n -L FORWARD | grep BRIDGE-FIREWALL']) + except: + try: + util.pread2(['iptables', '-I', 'FORWARD', '-m', 'physdev', '--physdev-is-bridged', '-j', 'BRIDGE-FIREWALL']) + util.pread2(['iptables', '-A', 'FORWARD', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', privnic, '-j', 'ACCEPT']) + util.pread2(['iptables', '-A', 'FORWARD', '-j', 'DROP']) + except: + return 'false' + default_ebtables_rules() + allow_egress_traffic(session) + if not os.path.exists('/var/run/cloud'): + os.makedirs('/var/run/cloud') + if not os.path.exists('/var/cache/cloud'): + os.makedirs('/var/cache/cloud') + #get_ipset_keyword() + + cleanup_rules_for_dead_vms(session) + cleanup_rules(session, args) + + return result + +@echo +def default_ebtables_rules(): + try: + util.pread2(['ebtables', '-N', 'DEFAULT_EBTABLES']) + util.pread2(['ebtables', '-A', 'FORWARD', '-j' 'DEFAULT_EBTABLES']) + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '--ip-proto', 'udp', '--ip-dport', '67', '-j', 'ACCEPT']) + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'ARP', '--arp-op', 'Request', '-j', 'ACCEPT']) + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'ARP', '--arp-op', 'Reply', '-j', 'ACCEPT']) + # deny mac broadcast and multicast + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-d', 'Broadcast', '-j', 'DROP']) + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-d', 'Multicast', '-j', 'DROP']) + # deny ip broadcast and multicast + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '-j', 'DROP']) + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '224.0.0.0/4', '-j', 'DROP']) + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-j', 'RETURN']) + # deny ipv6 + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv6', '-j', 'DROP']) + # deny vlan + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', '802_1Q', '-j', 'DROP']) + # deny all others (e.g., 802.1d, CDP) + util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-j', 'DROP']) + except: + util.SMlog('Chain DEFAULT_EBTABLES already exists') + + +@echo +def allow_egress_traffic(session): + devs = [] + for pif in session.xenapi.PIF.get_all(): + pif_rec = session.xenapi.PIF.get_record(pif) + vlan = pif_rec.get('VLAN') + dev = pif_rec.get('device') + if vlan == '-1': + devs.append(dev) + else: + devs.append(dev + "." + vlan) + for d in devs: + try: + util.pread2(['/bin/bash', '-c', "iptables -n -L FORWARD | grep '%s '" % d]) + except: + try: + util.pread2(['iptables', '-I', 'FORWARD', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', d, '-j', 'ACCEPT']) + except: + util.SMlog("Failed to add FORWARD rule through to %s" % d) + return 'false' + return 'true' + + +def ipset(ipsetname, proto, start, end, ips): + try: + util.pread2(['ipset', '-N', ipsetname, 'iptreemap']) + except: + util.SMlog("ipset chain already exists" + ipsetname) + + result = True + ipsettmp = ''.join(''.join(ipsetname.split('-')).split('_')) + str(int(time.time()) % 1000) + + try: + util.pread2(['ipset', '-N', ipsettmp, 'iptreemap']) + except: + util.SMlog("Failed to create temp ipset, reusing old name= " + ipsettmp) + try: + util.pread2(['ipset', '-F', ipsettmp]) + except: + util.SMlog("Failed to clear old temp ipset name=" + ipsettmp) + return False + + try: + for ip in ips: + try: + util.pread2(['ipset', '-A', ipsettmp, ip]) + except CommandException, cex: + if cex.reason.rfind('already in set') == -1: + raise + except: + util.SMlog("Failed to program ipset " + ipsetname) + util.pread2(['ipset', '-F', ipsettmp]) + util.pread2(['ipset', '-X', ipsettmp]) + return False + + try: + util.pread2(['ipset', '-W', ipsettmp, ipsetname]) + except: + util.SMlog("Failed to swap ipset " + ipsetname) + result = False + + try: + util.pread2(['ipset', '-F', ipsettmp]) + util.pread2(['ipset', '-X', ipsettmp]) + except: + # if the temporary name clashes next time we'll just reuse it + util.SMlog("Failed to delete temp ipset " + ipsettmp) + + return result + +@echo +def destroy_network_rules_for_vm(session, args): + vm_name = args.pop('vmName') + vmchain = chain_name(vm_name) + vmchain_egress = egress_chain_name(vm_name) + vmchain_default = chain_name_def(vm_name) + + delete_rules_for_vm_in_bridge_firewall_chain(vm_name) + if vm_name.startswith('i-') or vm_name.startswith('r-') or vm_name.startswith('l-'): + try: + util.pread2(['iptables', '-F', vmchain_default]) + util.pread2(['iptables', '-X', vmchain_default]) + except: + util.SMlog("Ignoring failure to delete chain " + vmchain_default) + + destroy_ebtables_rules(vmchain) + + try: + util.pread2(['iptables', '-F', vmchain]) + util.pread2(['iptables', '-X', vmchain]) + except: + util.SMlog("Ignoring failure to delete ingress chain " + vmchain) + + + try: + util.pread2(['iptables', '-F', vmchain_egress]) + util.pread2(['iptables', '-X', vmchain_egress]) + except: + util.SMlog("Ignoring failure to delete egress chain " + vmchain_egress) + + remove_rule_log_for_vm(vm_name) + + if 1 in [ vm_name.startswith(c) for c in ['r-', 's-', 'v-', 'l-'] ]: + return 'true' + + try: + setscmd = "ipset --save | grep " + vmchain + " | grep '^-N' | awk '{print $2}'" + setsforvm = util.pread2(['/bin/bash', '-c', setscmd]).split('\n') + for set in setsforvm: + if set != '': + util.pread2(['ipset', '-F', set]) + util.pread2(['ipset', '-X', set]) + except: + util.SMlog("Failed to destroy ipsets for %" % vm_name) + + + return 'true' + +@echo +def destroy_ebtables_rules(vm_chain): + + delcmd = "ebtables-save | grep " + vm_chain + " | sed 's/-A/-D/'" + delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n') + delcmds.pop() + for cmd in delcmds: + try: + dc = cmd.split(' ') + dc.insert(0, 'ebtables') + util.pread2(dc) + except: + util.SMlog("Ignoring failure to delete ebtables rules for vm " + vm_chain) + try: + util.pread2(['ebtables', '-F', vm_chain]) + util.pread2(['ebtables', '-X', vm_chain]) + except: + util.SMlog("Ignoring failure to delete ebtables chain for vm " + vm_chain) + +@echo +def destroy_arptables_rules(vm_chain): + delcmd = "arptables -vL FORWARD | grep " + vm_chain + " | sed 's/-i any//' | sed 's/-o any//' | awk '{print $1,$2,$3,$4}' " + delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n') + delcmds.pop() + for cmd in delcmds: + try: + dc = cmd.split(' ') + dc.insert(0, 'arptables') + dc.insert(1, '-D') + dc.insert(2, 'FORWARD') + util.pread2(dc) + except: + util.SMlog("Ignoring failure to delete arptables rules for vm " + vm_chain) + + try: + util.pread2(['arptables', '-F', vm_chain]) + util.pread2(['arptables', '-X', vm_chain]) + except: + util.SMlog("Ignoring failure to delete arptables chain for vm " + vm_chain) + +@echo +def default_ebtables_antispoof_rules(vm_chain, vifs, vm_ip, vm_mac): + if vm_mac == 'ff:ff:ff:ff:ff:ff': + util.SMlog("Ignoring since mac address is not valid") + return 'true' + + try: + util.pread2(['ebtables', '-N', vm_chain]) + except: + try: + util.pread2(['ebtables', '-F', vm_chain]) + except: + util.SMlog("Failed to create ebtables antispoof chain, skipping") + return 'true' + + # note all rules for packets into the bridge (-i) precede all output rules (-o) + # always start after the first rule in the FORWARD chain that jumps to DEFAULT_EBTABLES chain + try: + for vif in vifs: + util.pread2(['ebtables', '-I', 'FORWARD', '2', '-i', vif, '-j', vm_chain]) + util.pread2(['ebtables', '-A', 'FORWARD', '-o', vif, '-j', vm_chain]) + except: + util.SMlog("Failed to program default ebtables FORWARD rules for %s" % vm_chain) + return 'false' + + try: + for vif in vifs: + # only allow source mac that belongs to the vm + util.pread2(['ebtables', '-A', vm_chain, '-i', vif, '-s', '!', vm_mac, '-j', 'DROP']) + # do not allow fake dhcp responses + util.pread2(['ebtables', '-A', vm_chain, '-i', vif, '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '68', '-j', 'DROP']) + # do not allow snooping of dhcp requests + util.pread2(['ebtables', '-A', vm_chain, '-o', vif, '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '67', '-j', 'DROP']) + except: + util.SMlog("Failed to program default ebtables antispoof rules for %s" % vm_chain) + return 'false' + + return 'true' + +@echo +def default_arp_antispoof(vm_chain, vifs, vm_ip, vm_mac): + if vm_mac == 'ff:ff:ff:ff:ff:ff': + util.SMlog("Ignoring since mac address is not valid") + return 'true' + + try: + util.pread2(['arptables', '-N', vm_chain]) + except: + try: + util.pread2(['arptables', '-F', vm_chain]) + except: + util.SMlog("Failed to create arptables rule, skipping") + return 'true' + + # note all rules for packets into the bridge (-i) precede all output rules (-o) + try: + for vif in vifs: + util.pread2(['arptables', '-I', 'FORWARD', '-i', vif, '-j', vm_chain]) + util.pread2(['arptables', '-A', 'FORWARD', '-o', vif, '-j', vm_chain]) + except: + util.SMlog("Failed to program default arptables rules in FORWARD chain vm=" + vm_chain) + return 'false' + + try: + for vif in vifs: + #accept arp replies into the bridge as long as the source mac and ips match the vm + util.pread2(['arptables', '-A', vm_chain, '-i', vif, '--opcode', 'Reply', '--source-mac', vm_mac, '--source-ip', vm_ip, '-j', 'ACCEPT']) + #accept any arp requests from this vm. In the future this can be restricted to deny attacks on hosts + #also important to restrict source ip and src mac in these requests as they can be used to update arp tables on destination + util.pread2(['arptables', '-A', vm_chain, '-i', vif, '--opcode', 'Request', '--source-mac', vm_mac, '--source-ip', vm_ip, '-j', 'RETURN']) + #accept any arp requests to this vm as long as the request is for this vm's ip + util.pread2(['arptables', '-A', vm_chain, '-o', vif, '--opcode', 'Request', '--destination-ip', vm_ip, '-j', 'ACCEPT']) + #accept any arp replies to this vm as long as the mac and ip matches + util.pread2(['arptables', '-A', vm_chain, '-o', vif, '--opcode', 'Reply', '--destination-mac', vm_mac, '--destination-ip', vm_ip, '-j', 'ACCEPT']) + util.pread2(['arptables', '-A', vm_chain, '-j', 'DROP']) + + except: + util.SMlog("Failed to program default arptables rules") + return 'false' + + return 'true' + +@echo +def default_network_rules_systemvm(session, args): + vm_name = args.pop('vmName') + try: + vm = session.xenapi.VM.get_by_name_label(vm_name) + if len(vm) != 1: + return 'false' + vm_rec = session.xenapi.VM.get_record(vm[0]) + vm_vifs = vm_rec.get('VIFs') + vifnums = [session.xenapi.VIF.get_record(vif).get('device') for vif in vm_vifs] + domid = vm_rec.get('domid') + except: + util.SMlog("### Failed to get domid or vif list for vm ##" + vm_name) + return 'false' + + if domid == '-1': + util.SMlog("### Failed to get domid for vm (-1): " + vm_name) + return 'false' + + vifs = ["vif" + domid + "." + v for v in vifnums] + #vm_name = '-'.join(vm_name.split('-')[:-1]) + vmchain = chain_name(vm_name) + + + delete_rules_for_vm_in_bridge_firewall_chain(vm_name) + + try: + util.pread2(['iptables', '-N', vmchain]) + except: + util.pread2(['iptables', '-F', vmchain]) + + allow_egress_traffic(session) + + for vif in vifs: + try: + util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', vif, '-j', vmchain]) + util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '4', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', vif, '-j', vmchain]) + util.pread2(['iptables', '-I', vmchain, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', vif, '-j', 'RETURN']) + except: + util.SMlog("Failed to program default rules") + return 'false' + + + util.pread2(['iptables', '-A', vmchain, '-j', 'ACCEPT']) + + if write_rule_log_for_vm(vm_name, '-1', '_ignore_', domid, '_initial_', '-1') == False: + util.SMlog("Failed to log default network rules for systemvm, ignoring") + return 'true' + + +@echo +def default_network_rules(session, args): + vm_name = args.pop('vmName') + vm_ip = args.pop('vmIP') + vm_id = args.pop('vmID') + vm_mac = args.pop('vmMAC') + + try: + vm = session.xenapi.VM.get_by_name_label(vm_name) + if len(vm) != 1: + util.SMlog("### Failed to get record for vm " + vm_name) + return 'false' + vm_rec = session.xenapi.VM.get_record(vm[0]) + domid = vm_rec.get('domid') + except: + util.SMlog("### Failed to get domid for vm " + vm_name) + return 'false' + if domid == '-1': + util.SMlog("### Failed to get domid for vm (-1): " + vm_name) + return 'false' + + vif = "vif" + domid + ".0" + tap = "tap" + domid + ".0" + vifs = [vif] + try: + util.pread2(['ifconfig', tap]) + vifs.append(tap) + except: + pass + + delete_rules_for_vm_in_bridge_firewall_chain(vm_name) + + + vmchain = chain_name(vm_name) + vmchain_egress = egress_chain_name(vm_name) + vmchain_default = chain_name_def(vm_name) + + destroy_ebtables_rules(vmchain) + + + try: + util.pread2(['iptables', '-N', vmchain]) + except: + util.pread2(['iptables', '-F', vmchain]) + + try: + util.pread2(['iptables', '-N', vmchain_egress]) + except: + util.pread2(['iptables', '-F', vmchain_egress]) + + try: + util.pread2(['iptables', '-N', vmchain_default]) + except: + util.pread2(['iptables', '-F', vmchain_default]) + + try: + for v in vifs: + util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-j', vmchain_default]) + util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-j', vmchain_default]) + util.pread2(['iptables', '-A', vmchain_default, '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT']) + #allow dhcp + for v in vifs: + util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-p', 'udp', '--dport', '67', '--sport', '68', '-j', 'ACCEPT']) + util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-p', 'udp', '--dport', '68', '--sport', '67', '-j', 'ACCEPT']) + + #don't let vm spoof its ip address + for v in vifs: + util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '--source', vm_ip,'-p', 'udp', '--dport', '53', '-j', 'RETURN']) + util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '--source', '!', vm_ip, '-j', 'DROP']) + util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '--destination', '!', vm_ip, '-j', 'DROP']) + util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '--source', vm_ip, '-j', vmchain_egress]) + + for v in vifs: + util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-j', vmchain]) + except: + util.SMlog("Failed to program default rules for vm " + vm_name) + return 'false' + + default_arp_antispoof(vmchain, vifs, vm_ip, vm_mac) + default_ebtables_antispoof_rules(vmchain, vifs, vm_ip, vm_mac) + + if write_rule_log_for_vm(vm_name, vm_id, vm_ip, domid, '_initial_', '-1', vm_mac) == False: + util.SMlog("Failed to log default network rules, ignoring") + + util.SMlog("Programmed default rules for vm " + vm_name) + return 'true' + +@echo +def check_domid_changed(session, vmName): + curr_domid = '-1' + try: + vm = session.xenapi.VM.get_by_name_label(vmName) + if len(vm) != 1: + util.SMlog("### Could not get record for vm ## " + vmName) + else: + vm_rec = session.xenapi.VM.get_record(vm[0]) + curr_domid = vm_rec.get('domid') + except: + util.SMlog("### Failed to get domid for vm ## " + vmName) + + + logfilename = "/var/run/cloud/" + vmName +".log" + if not os.path.exists(logfilename): + return ['-1', curr_domid] + + lines = (line.rstrip() for line in open(logfilename)) + + [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno, _vmMac] = ['_', '-1', '_', '-1', '_', '-1', 'ff:ff:ff:ff:ff:ff'] + for line in lines: + try: + [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno,_vmMac] = line.split(',') + except ValueError,v: + [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno] = line.split(',') + break + + return [curr_domid, old_domid] + +@echo +def delete_rules_for_vm_in_bridge_firewall_chain(vmName): + vm_name = vmName + vmchain = chain_name_def(vm_name) + + delcmd = "iptables-save | grep '\-A BRIDGE-FIREWALL' | grep " + vmchain + " | sed 's/-A/-D/'" + delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n') + delcmds.pop() + for cmd in delcmds: + try: + dc = cmd.split(' ') + dc.insert(0, 'iptables') + dc.pop() + util.pread2(filter(None, dc)) + except: + util.SMlog("Ignoring failure to delete rules for vm " + vmName) + + +@echo +def network_rules_for_rebooted_vm(session, vmName): + vm_name = vmName + [curr_domid, old_domid] = check_domid_changed(session, vm_name) + + if curr_domid == old_domid: + return True + + if old_domid == '-1': + return True + + if curr_domid == '-1': + return True + + util.SMlog("Found a rebooted VM -- reprogramming rules for " + vm_name) + + delete_rules_for_vm_in_bridge_firewall_chain(vm_name) + if 1 in [ vm_name.startswith(c) for c in ['r-', 's-', 'v-', 'l-'] ]: + default_network_rules_systemvm(session, {"vmName":vm_name}) + return True + + vif = "vif" + curr_domid + ".0" + tap = "tap" + curr_domid + ".0" + vifs = [vif] + try: + util.pread2(['ifconfig', tap]) + vifs.append(tap) + except: + pass + vmchain = chain_name(vm_name) + vmchain_default = chain_name_def(vm_name) + + for v in vifs: + util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-j', vmchain_default]) + util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-j', vmchain_default]) + + #change antispoof rule in vmchain + try: + delcmd = "iptables-save | grep '\-A " + vmchain_default + "' | grep physdev-in | sed 's/-A/-D/'" + delcmd2 = "iptables-save | grep '\-A " + vmchain_default + "' | grep physdev-out | sed 's/-A/-D/'" + inscmd = "iptables-save | grep '\-A " + vmchain_default + "' | grep physdev-in | grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' " + inscmd2 = "iptables-save| grep '\-A " + vmchain_default + "' | grep physdev-in | grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/' " + inscmd3 = "iptables-save | grep '\-A " + vmchain_default + "' | grep physdev-out | grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' " + inscmd4 = "iptables-save| grep '\-A " + vmchain_default + "' | grep physdev-out | grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/' " + + ipts = [] + for cmd in [delcmd, delcmd2, inscmd, inscmd2, inscmd3, inscmd4]: + cmds = util.pread2(['/bin/bash', '-c', cmd]).split('\n') + cmds.pop() + for c in cmds: + ipt = c.split(' ') + ipt.insert(0, 'iptables') + ipt.pop() + ipts.append(ipt) + + for ipt in ipts: + try: + util.pread2(filter(None,ipt)) + except: + util.SMlog("Failed to rewrite antispoofing rules for vm " + vm_name) + + util.pread2(['/bin/bash', '-c', 'iptables -D ' + vmchain_default + " -j " + vmchain]) + util.pread2(['/bin/bash', '-c', 'iptables -A ' + vmchain_default + " -j " + vmchain]) + except: + util.SMlog("No rules found for vm " + vm_name) + + destroy_ebtables_rules(vmchain) + destroy_arptables_rules(vmchain) + [vm_ip, vm_mac] = get_vm_mac_ip_from_log(vmchain) + default_arp_antispoof(vmchain, vifs, vm_ip, vm_mac) + default_ebtables_antispoof_rules(vmchain, vifs, vm_ip, vm_mac) + rewrite_rule_log_for_vm(vm_name, curr_domid) + return True + +def rewrite_rule_log_for_vm(vm_name, new_domid): + logfilename = "/var/run/cloud/" + vm_name +".log" + if not os.path.exists(logfilename): + return + lines = (line.rstrip() for line in open(logfilename)) + + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '_', '-1', '_', '-1','ff:ff:ff:ff:ff:ff'] + for line in lines: + try: + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',') + break + except ValueError,v: + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',') + + write_rule_log_for_vm(_vmName, _vmID, _vmIP, new_domid, _signature, '-1', _vmMac) + +def get_rule_log_for_vm(session, vmName): + vm_name = vmName; + logfilename = "/var/run/cloud/" + vm_name +".log" + if not os.path.exists(logfilename): + return '' + + lines = (line.rstrip() for line in open(logfilename)) + + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '_', '-1', '_', '-1', 'ff:ff:ff:ff:ff:ff'] + for line in lines: + try: + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',') + break + except ValueError,v: + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',') + + return ','.join([_vmName, _vmID, _vmIP, _domID, _signature, _seqno]) + +@echo +def get_vm_mac_ip_from_log(vm_name): + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '0.0.0.0', '-1', '_', '-1','ff:ff:ff:ff:ff:ff'] + logfilename = "/var/run/cloud/" + vm_name +".log" + if not os.path.exists(logfilename): + return ['_', '_'] + + lines = (line.rstrip() for line in open(logfilename)) + for line in lines: + try: + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',') + break + except ValueError,v: + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',') + + return [ _vmIP, _vmMac] + +@echo +def get_rule_logs_for_vms(session, args): + host_uuid = args.pop('host_uuid') + try: + thishost = session.xenapi.host.get_by_uuid(host_uuid) + hostrec = session.xenapi.host.get_record(thishost) + vms = hostrec.get('resident_VMs') + except: + util.SMlog("Failed to get host from uuid " + host_uuid) + return ' ' + + result = [] + try: + for name in [session.xenapi.VM.get_name_label(x) for x in vms]: + if 1 not in [ name.startswith(c) for c in ['r-', 's-', 'v-', 'i-', 'l-'] ]: + continue + network_rules_for_rebooted_vm(session, name) + if name.startswith('i-'): + log = get_rule_log_for_vm(session, name) + result.append(log) + except: + util.SMlog("Failed to get rule logs, better luck next time!") + + return ";".join(result) + +@echo +def cleanup_rules_for_dead_vms(session): + try: + vms = session.xenapi.VM.get_all() + cleaned = 0 + for vm_name in [session.xenapi.VM.get_name_label(x) for x in vms]: + if 1 in [ vm_name.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-'] ]: + vm = session.xenapi.VM.get_by_name_label(vm_name) + if len(vm) != 1: + continue + vm_rec = session.xenapi.VM.get_record(vm[0]) + state = vm_rec.get('power_state') + if state != 'Running' and state != 'Paused': + util.SMlog("vm " + vm_name + " is not running, cleaning up") + destroy_network_rules_for_vm(session, {'vmName':vm_name}) + cleaned = cleaned+1 + + util.SMlog("Cleaned up rules for " + str(cleaned) + " vms") + except: + util.SMlog("Failed to cleanup rules for dead vms!") + + +@echo +def cleanup_rules(session, args): + instance = args.get('instance') + if not instance: + instance = 'VM' + resident_vms = [] + try: + hostname = util.pread2(['/bin/bash', '-c', 'hostname']).split('\n') + if len(hostname) < 1: + raise Exception('Could not find hostname of this host') + thishost = session.xenapi.host.get_by_name_label(hostname[0]) + if len(thishost) < 1: + raise Exception("Could not find host record from hostname %s of this host"%hostname[0]) + hostrec = session.xenapi.host.get_record(thishost[0]) + vms = hostrec.get('resident_VMs') + resident_vms = [session.xenapi.VM.get_name_label(x) for x in vms] + util.SMlog('cleanup_rules: found %s resident vms on this host %s' % (len(resident_vms)-1, hostname[0])) + + chainscmd = "iptables-save | grep '^:' | awk '{print $1}' | cut -d':' -f2 | sed 's/-def/-%s/'| sed 's/-eg//' | sort|uniq" % instance + chains = util.pread2(['/bin/bash', '-c', chainscmd]).split('\n') + vmchains = [ch for ch in chains if 1 in [ ch.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-']]] + util.SMlog('cleanup_rules: found %s iptables chains for vms on this host %s' % (len(vmchains), hostname[0])) + cleaned = 0 + cleanup = [] + for chain in vmchains: + vm = session.xenapi.VM.get_by_name_label(chain) + if len(vm) != 1: + vm = session.xenapi.VM.get_by_name_label(chain + "-untagged") + if len(vm) != 1: + util.SMlog("chain " + chain + " does not correspond to a vm, cleaning up") + cleanup.append(chain) + continue + if chain not in resident_vms: + util.SMlog("vm " + chain + " is not running, cleaning up") + cleanup.append(chain) + + for vm_name in cleanup: + destroy_network_rules_for_vm(session, {'vmName':vm_name}) + + util.SMlog("Cleaned up rules for " + str(len(cleanup)) + " chains") + return str(len(cleanup)) + except Exception, ex: + util.SMlog("Failed to cleanup rules, reason= " + str(ex)) + return '-1'; + +@echo +def check_rule_log_for_vm(vmName, vmID, vmIP, domID, signature, seqno): + vm_name = vmName; + logfilename = "/var/run/cloud/" + vm_name +".log" + if not os.path.exists(logfilename): + util.SMlog("Failed to find logfile %s" %logfilename) + return [True, True, True] + + lines = (line.rstrip() for line in open(logfilename)) + + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '_', '-1', '_', '-1', 'ff:ff:ff:ff:ff:ff'] + try: + for line in lines: + try: + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno, _vmMac] = line.split(',') + except ValueError,v: + [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',') + break + except: + util.SMlog("Failed to parse log file for vm " + vmName) + remove_rule_log_for_vm(vmName) + return [True, True, True] + + reprogramDefault = False + if (domID != _domID) or (vmID != _vmID) or (vmIP != _vmIP): + util.SMlog("Change in default info set of vm %s" % vmName) + return [True, True, True] + else: + util.SMlog("No change in default info set of vm %s" % vmName) + + reprogramChain = False + rewriteLog = True + if (int(seqno) > int(_seqno)): + if (_signature != signature): + reprogramChain = True + util.SMlog("Seqno increased from %s to %s: reprogamming "\ + "ingress rules for vm %s" % (_seqno, seqno, vmName)) + else: + util.SMlog("Seqno increased from %s to %s: but no change "\ + "in signature for vm: skip programming ingress "\ + "rules %s" % (_seqno, seqno, vmName)) + elif (int(seqno) < int(_seqno)): + util.SMlog("Seqno decreased from %s to %s: ignoring these "\ + "ingress rules for vm %s" % (_seqno, seqno, vmName)) + rewriteLog = False + elif (signature != _signature): + util.SMlog("Seqno %s stayed the same but signature changed from "\ + "%s to %s for vm %s" % (seqno, _signature, signature, vmName)) + rewriteLog = True + reprogramChain = True + else: + util.SMlog("Seqno and signature stayed the same: %s : ignoring these "\ + "ingress rules for vm %s" % (seqno, vmName)) + rewriteLog = False + + return [reprogramDefault, reprogramChain, rewriteLog] + + +@echo +def write_rule_log_for_vm(vmName, vmID, vmIP, domID, signature, seqno, vmMac='ff:ff:ff:ff:ff:ff'): + vm_name = vmName + logfilename = "/var/run/cloud/" + vm_name +".log" + util.SMlog("Writing log to " + logfilename) + logf = open(logfilename, 'w') + output = ','.join([vmName, vmID, vmIP, domID, signature, seqno, vmMac]) + result = True + try: + logf.write(output) + logf.write('\n') + except: + util.SMlog("Failed to write to rule log file " + logfilename) + result = False + + logf.close() + + return result + +@echo +def remove_rule_log_for_vm(vmName): + vm_name = vmName + logfilename = "/var/run/cloud/" + vm_name +".log" + + result = True + try: + os.remove(logfilename) + except: + util.SMlog("Failed to delete rule log file " + logfilename) + result = False + + return result + +@echo +def inflate_rules (zipped): + return zlib.decompress(base64.b64decode(zipped)) + +@echo +def cache_ipset_keyword(): + tmpname = 'ipsetqzvxtmp' + try: + util.pread2(['/bin/bash', '-c', 'ipset -N ' + tmpname + ' iptreemap']) + except: + util.pread2(['/bin/bash', '-c', 'ipset -F ' + tmpname]) + + try: + util.pread2(['/bin/bash', '-c', 'iptables -A INPUT -m set --set ' + tmpname + ' src' + ' -j ACCEPT']) + util.pread2(['/bin/bash', '-c', 'iptables -D INPUT -m set --set ' + tmpname + ' src' + ' -j ACCEPT']) + keyword = 'set' + except: + keyword = 'match-set' + + try: + util.pread2(['/bin/bash', '-c', 'ipset -X ' + tmpname]) + except: + pass + + cachefile = "/var/cache/cloud/ipset.keyword" + util.SMlog("Writing ipset keyword to " + cachefile) + cachef = open(cachefile, 'w') + try: + cachef.write(keyword) + cachef.write('\n') + except: + util.SMlog("Failed to write to cache file " + cachef) + + cachef.close() + return keyword + +@echo +def get_ipset_keyword(): + cachefile = "/var/cache/cloud/ipset.keyword" + keyword = 'match-set' + + if not os.path.exists(cachefile): + util.SMlog("Failed to find ipset keyword cachefile %s" %cachefile) + keyword = cache_ipset_keyword() + else: + lines = (line.rstrip() for line in open(cachefile)) + for line in lines: + keyword = line + break + + return keyword + +@echo +def network_rules(session, args): + try: + vm_name = args.get('vmName') + vm_ip = args.get('vmIP') + vm_id = args.get('vmID') + vm_mac = args.get('vmMAC') + signature = args.pop('signature') + seqno = args.pop('seqno') + deflated = 'false' + if 'deflated' in args: + deflated = args.pop('deflated') + + try: + vm = session.xenapi.VM.get_by_name_label(vm_name) + if len(vm) != 1: + util.SMlog("### Could not get record for vm ## " + vm_name) + return 'false' + vm_rec = session.xenapi.VM.get_record(vm[0]) + domid = vm_rec.get('domid') + except: + util.SMlog("### Failed to get domid for vm ## " + vm_name) + return 'false' + if domid == '-1': + util.SMlog("### Failed to get domid for vm (-1): " + vm_name) + return 'false' + + vif = "vif" + domid + ".0" + tap = "tap" + domid + ".0" + vifs = [vif] + try: + util.pread2(['ifconfig', tap]) + vifs.append(tap) + except: + pass + + + reason = 'seqno_change_or_sig_change' + [reprogramDefault, reprogramChain, rewriteLog] = \ + check_rule_log_for_vm (vm_name, vm_id, vm_ip, domid, signature, seqno) + + if not reprogramDefault and not reprogramChain: + util.SMlog("No changes detected between current state and received state") + reason = 'seqno_same_sig_same' + if rewriteLog: + reason = 'seqno_increased_sig_same' + write_rule_log_for_vm(vm_name, vm_id, vm_ip, domid, signature, seqno, vm_mac) + util.SMlog("Programming network rules for vm %s seqno=%s signature=%s guestIp=%s,"\ + " do nothing, reason=%s" % (vm_name, seqno, signature, vm_ip, reason)) + return 'true' + + if not reprogramChain: + util.SMlog("###Not programming any ingress rules since no changes detected?") + return 'true' + + if reprogramDefault: + util.SMlog("Change detected in vmId or vmIp or domId, resetting default rules") + default_network_rules(session, args) + reason = 'domid_change' + + rules = args.pop('rules') + if deflated.lower() == 'true': + rules = inflate_rules (rules) + keyword = '--' + get_ipset_keyword() + lines = rules.split(' ') + + util.SMlog("Programming network rules for vm %s seqno=%s numrules=%s signature=%s guestIp=%s,"\ + " update iptables, reason=%s" % (vm_name, seqno, len(lines), signature, vm_ip, reason)) + + cmds = [] + egressrules = 0 + for line in lines: + tokens = line.split(':') + if len(tokens) != 5: + continue + type = tokens[0] + protocol = tokens[1] + start = tokens[2] + end = tokens[3] + cidrs = tokens.pop(); + ips = cidrs.split(",") + ips.pop() + allow_any = False + + if type == 'E': + vmchain = egress_chain_name(vm_name) + action = "RETURN" + direction = "dst" + egressrules = egressrules + 1 + else: + vmchain = chain_name(vm_name) + action = "ACCEPT" + direction = "src" + if '0.0.0.0/0' in ips: + i = ips.index('0.0.0.0/0') + del ips[i] + allow_any = True + range = start + ":" + end + if ips: + ipsetname = vmchain + "_" + protocol + "_" + start + "_" + end + if start == "-1": + ipsetname = vmchain + "_" + protocol + "_any" + + if ipset(ipsetname, protocol, start, end, ips) == False: + util.SMlog(" failed to create ipset for rule " + str(tokens)) + + if protocol == 'all': + iptables = ['iptables', '-I', vmchain, '-m', 'state', '--state', 'NEW', '-m', 'set', keyword, ipsetname, direction, '-j', action] + elif protocol != 'icmp': + iptables = ['iptables', '-I', vmchain, '-p', protocol, '-m', protocol, '--dport', range, '-m', 'state', '--state', 'NEW', '-m', 'set', keyword, ipsetname, direction, '-j', action] + else: + range = start + "/" + end + if start == "-1": + range = "any" + iptables = ['iptables', '-I', vmchain, '-p', 'icmp', '--icmp-type', range, '-m', 'set', keyword, ipsetname, direction, '-j', action] + + cmds.append(iptables) + util.SMlog(iptables) + + if allow_any and protocol != 'all': + if protocol != 'icmp': + iptables = ['iptables', '-I', vmchain, '-p', protocol, '-m', protocol, '--dport', range, '-m', 'state', '--state', 'NEW', '-j', action] + else: + range = start + "/" + end + if start == "-1": + range = "any" + iptables = ['iptables', '-I', vmchain, '-p', 'icmp', '--icmp-type', range, '-j', action] + cmds.append(iptables) + util.SMlog(iptables) + + vmchain = chain_name(vm_name) + util.pread2(['iptables', '-F', vmchain]) + egress_vmchain = egress_chain_name(vm_name) + util.pread2(['iptables', '-F', egress_vmchain]) + + for cmd in cmds: + util.pread2(cmd) + + if egressrules == 0 : + util.pread2(['iptables', '-A', egress_vmchain, '-j', 'RETURN']) + else: + util.pread2(['iptables', '-A', egress_vmchain, '-j', 'DROP']) + + util.pread2(['iptables', '-A', vmchain, '-j', 'DROP']) + + if write_rule_log_for_vm(vm_name, vm_id, vm_ip, domid, signature, seqno, vm_mac) == False: + return 'false' + + return 'true' + except: + util.SMlog("Failed to network rule !") + +@echo +def checkRouter(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/getRouterStatus.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + except: + util.SMlog(" check router status fail! ") + txt = '' + + return txt + +@echo +def bumpUpPriority(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/bumpUpPriority.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + txt = 'success' + except: + util.SMlog("bump up priority fail! ") + txt = '' + + return txt + +@echo +def createISOVHD(session, args): + #hack for XCP on ubuntu 12.04, as can't attach iso to a vm + vdis = session.xenapi.VDI.get_by_name_label("systemvm-vdi"); + util.SMlog(vdis) + if len(vdis) > 0: + vdi_record = session.xenapi.VDI.get_record(vdis[0]) + vdi_uuid = vdi_record['uuid'] + return vdi_uuid + localsrUUid = args['uuid']; + sr = session.xenapi.SR.get_by_uuid(localsrUUid) + data = {'name_label': "systemvm-vdi", + 'SR': sr, + 'virtual_size': '50000000', + 'type': 'user', + 'sharable':False, + 'read_only':False, + 'other_config':{}, + } + vdi = session.xenapi.VDI.create(data); + vdi_record = session.xenapi.VDI.get_record(vdi) + + vdi_uuid = vdi_record['uuid'] + + vms = session.xenapi.VM.get_all() + ctrldom = None + for vm in vms: + dom0 = session.xenapi.VM.get_is_control_domain(vm) + if dom0 is False: + continue + else: + ctrldom = vm + + if ctrldom is None: + return "Failed" + + vbds = session.xenapi.VM.get_VBDs(ctrldom) + if len(vbds) == 0: + vbd = session.xenapi.VBD.create({"VDI": vdi, "VM": ctrldom, "type":"Disk", "device": "xvda4", "bootable": False, "mode": "RW", "userdevice": "4", "empty":False, + "other_config":{}, "qos_algorithm_type":"", "qos_algorithm_params":{}}) + else: + vbd = vbds[0] + + vbdr = session.xenapi.VBD.get_record(vbd) + if session.xenapi.VBD.get_currently_attached(vbd) is False: + session.xenapi.VBD.plug(vbd) + vbdr = session.xenapi.VBD.get_record(vbd) + util.pread2(["dd", "if=/usr/share/xcp/packages/iso/systemvm.iso", "of=" + "/dev/" + vbdr["device"]]) + session.xenapi.VBD.unplug(vbd) + session.xenapi.VBD.destroy(vbd) + return vdi_uuid + +@echo +def getDomRVersion(session, args): + sargs = args['args'] + cmd = sargs.split(' ') + cmd.insert(0, "/usr/lib/xcp/bin/getDomRVersion.sh") + cmd.insert(0, "/bin/bash") + try: + txt = util.pread2(cmd) + except: + util.SMlog(" get domR version fail! ") + txt = '' + + return txt + +if __name__ == "__main__": + XenAPIPlugin.dispatch({"pingtest": pingtest, "setup_iscsi":setup_iscsi, "gethostvmstats": gethostvmstats, + "getvncport": getvncport, "getgateway": getgateway, "preparemigration": preparemigration, + "setIptables": setIptables, "pingdomr": pingdomr, "pingxenserver": pingxenserver, + "ipassoc": ipassoc, "vm_data": vm_data, "savePassword": savePassword, + "saveDhcpEntry": saveDhcpEntry, "setFirewallRule": setFirewallRule, + "setLoadBalancerRule": setLoadBalancerRule, "createFile": createFile, "deleteFile": deleteFile, + "networkUsage": networkUsage, "network_rules":network_rules, + "can_bridge_firewall":can_bridge_firewall, "default_network_rules":default_network_rules, + "destroy_network_rules_for_vm":destroy_network_rules_for_vm, + "default_network_rules_systemvm":default_network_rules_systemvm, + "get_rule_logs_for_vms":get_rule_logs_for_vms, + "setLinkLocalIP":setLinkLocalIP, "lt2p_vpn":lt2p_vpn, + "cleanup_rules":cleanup_rules, "checkRouter":checkRouter, + "bumpUpPriority":bumpUpPriority, "getDomRVersion":getDomRVersion, + "kill_copy_process":kill_copy_process, + "createISOVHD":createISOVHD}) diff --git a/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot b/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot new file mode 100644 index 00000000000..15ea62f2106 --- /dev/null +++ b/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot @@ -0,0 +1,552 @@ +#!/usr/bin/python +# Version @VERSION@ +# +# A plugin for executing script needed by vmops cloud + +import os, sys, time +import XenAPIPlugin +sys.path.append("/usr/lib/xcp/sm/") +import SR, VDI, SRCommand, util, lvutil +from util import CommandException +import vhdutil +import shutil +import lvhdutil +import errno +import subprocess +import xs_errors +import cleanup +import stat +import random + +VHD_UTIL = 'vhd-util' +VHD_PREFIX = 'VHD-' +CLOUD_DIR = '/run/cloud_mount' + +def echo(fn): + def wrapped(*v, **k): + name = fn.__name__ + util.SMlog("#### VMOPS enter %s ####" % name ) + res = fn(*v, **k) + util.SMlog("#### VMOPS exit %s ####" % name ) + return res + return wrapped + + +@echo +def create_secondary_storage_folder(session, args): + local_mount_path = None + + util.SMlog("create_secondary_storage_folder, args: " + str(args)) + + try: + try: + # Mount the remote resource folder locally + remote_mount_path = args["remoteMountPath"] + local_mount_path = os.path.join(CLOUD_DIR, util.gen_uuid()) + mount(remote_mount_path, local_mount_path) + + # Create the new folder + new_folder = local_mount_path + "/" + args["newFolder"] + if not os.path.isdir(new_folder): + current_umask = os.umask(0) + os.makedirs(new_folder) + os.umask(current_umask) + except OSError, (errno, strerror): + errMsg = "create_secondary_storage_folder failed: errno: " + str(errno) + ", strerr: " + strerror + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + except: + errMsg = "create_secondary_storage_folder failed." + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + finally: + if local_mount_path != None: + # Unmount the local folder + umount(local_mount_path) + # Remove the local folder + os.system("rmdir " + local_mount_path) + + return "1" + +@echo +def delete_secondary_storage_folder(session, args): + local_mount_path = None + + util.SMlog("delete_secondary_storage_folder, args: " + str(args)) + + try: + try: + # Mount the remote resource folder locally + remote_mount_path = args["remoteMountPath"] + local_mount_path = os.path.join(CLOUD_DIR, util.gen_uuid()) + mount(remote_mount_path, local_mount_path) + + # Delete the specified folder + folder = local_mount_path + "/" + args["folder"] + if os.path.isdir(folder): + os.system("rm -f " + folder + "/*") + os.system("rmdir " + folder) + except OSError, (errno, strerror): + errMsg = "delete_secondary_storage_folder failed: errno: " + str(errno) + ", strerr: " + strerror + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + except: + errMsg = "delete_secondary_storage_folder failed." + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + finally: + if local_mount_path != None: + # Unmount the local folder + umount(local_mount_path) + # Remove the local folder + os.system("rmdir " + local_mount_path) + + return "1" + +@echo +def post_create_private_template(session, args): + local_mount_path = None + try: + try: + # get local template folder + templatePath = args["templatePath"] + local_mount_path = os.path.join(CLOUD_DIR, util.gen_uuid()) + mount(templatePath, local_mount_path) + # Retrieve args + filename = args["templateFilename"] + name = args["templateName"] + description = args["templateDescription"] + checksum = args["checksum"] + file_size = args["size"] + virtual_size = args["virtualSize"] + template_id = args["templateId"] + + # Create the template.properties file + template_properties_install_path = local_mount_path + "/template.properties" + f = open(template_properties_install_path, "w") + f.write("filename=" + filename + "\n") + f.write("vhd=true\n") + f.write("id=" + template_id + "\n") + f.write("vhd.filename=" + filename + "\n") + f.write("public=false\n") + f.write("uniquename=" + name + "\n") + f.write("vhd.virtualsize=" + virtual_size + "\n") + f.write("virtualsize=" + virtual_size + "\n") + f.write("checksum=" + checksum + "\n") + f.write("hvm=true\n") + f.write("description=" + description + "\n") + f.write("vhd.size=" + str(file_size) + "\n") + f.write("size=" + str(file_size) + "\n") + f.close() + util.SMlog("Created template.properties file") + + # Set permissions + permissions = stat.S_IREAD | stat.S_IWRITE | stat.S_IRGRP | stat.S_IWGRP | stat.S_IROTH | stat.S_IWOTH + os.chmod(template_properties_install_path, permissions) + util.SMlog("Set permissions on template and template.properties") + + except: + errMsg = "post_create_private_template failed." + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + + finally: + if local_mount_path != None: + # Unmount the local folder + umount(local_mount_path) + # Remove the local folder + os.system("rmdir " + local_mount_path) + return "1" + +def isfile(path, isISCSI): + errMsg = '' + exists = True + if isISCSI: + exists = checkVolumeAvailablility(path) + else: + exists = os.path.isfile(path) + + if not exists: + errMsg = "File " + path + " does not exist." + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + return errMsg + +def copyfile(fromFile, toFile, isISCSI): + util.SMlog("Starting to copy " + fromFile + " to " + toFile) + errMsg = '' + try: + cmd = ['dd', 'if=' + fromFile, 'of=' + toFile, 'bs=4M'] + txt = util.pread2(cmd) + except: + try: + os.system("rm -f " + toFile) + except: + txt = '' + txt = '' + errMsg = "Error while copying " + fromFile + " to " + toFile + " in secondary storage" + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + + util.SMlog("Successfully copied " + fromFile + " to " + toFile) + return errMsg + +def chdir(path): + try: + os.chdir(path) + except OSError, (errno, strerror): + errMsg = "Unable to chdir to " + path + " because of OSError with errno: " + str(errno) + " and strerr: " + strerror + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + util.SMlog("Chdired to " + path) + return + +def scanParent(path): + # Do a scan for the parent for ISCSI volumes + # Note that the parent need not be visible on the XenServer + parentUUID = '' + try: + lvName = os.path.basename(path) + dirname = os.path.dirname(path) + vgName = os.path.basename(dirname) + vhdInfo = vhdutil.getVHDInfoLVM(lvName, lvhdutil.extractUuid, vgName) + parentUUID = vhdInfo.parentUuid + except: + errMsg = "Could not get vhd parent of " + path + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + return parentUUID + +def getParent(path, isISCSI): + parentUUID = '' + try : + if isISCSI: + parentUUID = vhdutil.getParent(path, lvhdutil.extractUuid) + else: + parentUUID = vhdutil.getParent(path, cleanup.FileVDI.extractUuid) + except: + errMsg = "Could not get vhd parent of " + path + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + return parentUUID + +def getParentOfSnapshot(snapshotUuid, primarySRPath, isISCSI): + snapshotVHD = getVHD(snapshotUuid, isISCSI) + snapshotPath = os.path.join(primarySRPath, snapshotVHD) + + baseCopyUuid = '' + if isISCSI: + checkVolumeAvailablility(snapshotPath) + baseCopyUuid = scanParent(snapshotPath) + else: + baseCopyUuid = getParent(snapshotPath, isISCSI) + + util.SMlog("Base copy of snapshotUuid: " + snapshotUuid + " is " + baseCopyUuid) + return baseCopyUuid + +def setParent(parent, child): + try: + cmd = [VHD_UTIL, "modify", "-p", parent, "-n", child] + txt = util.pread2(cmd) + except: + errMsg = "Unexpected error while trying to set parent of " + child + " to " + parent + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + util.SMlog("Successfully set parent of " + child + " to " + parent) + return + +def rename(originalVHD, newVHD): + try: + os.rename(originalVHD, newVHD) + except OSError, (errno, strerror): + errMsg = "OSError while renaming " + origiinalVHD + " to " + newVHD + "with errno: " + str(errno) + " and strerr: " + strerror + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + return + +def makedirs(path): + if not os.path.isdir(path): + try: + os.makedirs(path) + except OSError, (errno, strerror): + umount(path) + if os.path.isdir(path): + return + errMsg = "OSError while creating " + path + " with errno: " + str(errno) + " and strerr: " + strerror + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + return + +def mount(remoteDir, localDir): + makedirs(localDir) + options = "soft,tcp,timeo=133,retrans=1" + try: + cmd = ['mount', '-o', options, remoteDir, localDir] + txt = util.pread2(cmd) + except: + txt = '' + errMsg = "Unexpected error while trying to mount " + remoteDir + " to " + localDir + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + util.SMlog("Successfully mounted " + remoteDir + " to " + localDir) + + return + +def umount(localDir): + try: + cmd = ['umount', localDir] + util.pread2(cmd) + except CommandException: + errMsg = "CommandException raised while trying to umount " + localDir + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + + util.SMlog("Successfully unmounted " + localDir) + return + +def mountSnapshotsDir(secondaryStorageMountPath, relativeDir, dcId, accountId, instanceId): + # The aim is to mount secondaryStorageMountPath on + # And create / dir on it, if it doesn't exist already. + # Assuming that secondaryStorageMountPath exists remotely + + # Alex's suggestion and currently implemented: + # Just mount secondaryStorageMountPath/ everytime + # Never unmount. + snapshotsDir = os.path.join(secondaryStorageMountPath, relativeDir) + + # Mkdir local mount point dir, if it doesn't exist. + localMountPointPath = os.path.join(CLOUD_DIR, dcId) + localMountPointPath = os.path.join(localMountPointPath, relativeDir) + + makedirs(localMountPointPath) + # if something is not mounted already on localMountPointPath, + # mount secondaryStorageMountPath on localMountPath + if os.path.ismount(localMountPointPath): + # There is only one secondary storage per zone. + # And we are mounting each sec storage under a zone-specific directory + # So two secondary storage snapshot dirs will never get mounted on the same point on the same XenServer. + util.SMlog("The remote snapshots directory has already been mounted on " + localMountPointPath) + else: + mount(snapshotsDir, localMountPointPath) + + # Create accountId/instanceId dir on localMountPointPath, if it doesn't exist + backupsDir = os.path.join(localMountPointPath, accountId) + backupsDir = os.path.join(backupsDir, instanceId) + makedirs(backupsDir) + return backupsDir + +@echo +def unmountSnapshotsDir(session, args): + dcId = args['dcId'] + localMountPointPath = os.path.join(CLOUD_DIR, dcId) + localMountPointPath = os.path.join(localMountPointPath, "snapshots") + try: + umount(localMountPointPath) + except: + util.SMlog("Ignoring the error while trying to unmount the snapshots dir.") + + return "1" + +def getPrimarySRPath(session, primaryStorageSRUuid, isISCSI): + sr = session.xenapi.SR.get_by_uuid(primaryStorageSRUuid) + srrec = session.xenapi.SR.get_record(sr) + srtype = srrec["type"] + if srtype == "file": + pbd = session.xenapi.SR.get_PBDs(sr)[0] + pbdrec = session.xenapi.PBD.get_record(pbd) + primarySRPath = pbdrec["device_config"]["location"] + return primarySRPath + if isISCSI: + primarySRDir = lvhdutil.VG_PREFIX + primaryStorageSRUuid + return os.path.join(lvhdutil.VG_LOCATION, primarySRDir) + else: + return os.path.join(SR.MOUNT_BASE, primaryStorageSRUuid) + +def getBackupVHD(UUID): + return UUID + '.' + SR.DEFAULT_TAP + +def getVHD(UUID, isISCSI): + if isISCSI: + return VHD_PREFIX + UUID + else: + return UUID + '.' + SR.DEFAULT_TAP + +def getIsTrueString(stringValue): + booleanValue = False + if (stringValue and stringValue == 'true'): + booleanValue = True + return booleanValue + +def makeUnavailable(uuid, primarySRPath, isISCSI): + if not isISCSI: + return + VHD = getVHD(uuid, isISCSI) + path = os.path.join(primarySRPath, VHD) + manageAvailability(path, '-an') + return + +def manageAvailability(path, value): + if path.__contains__("/var/run/sr-mount"): + return + util.SMlog("Setting availability of " + path + " to " + value) + try: + cmd = ['/usr/sbin/lvchange', value, path] + util.pread2(cmd) + except: #CommandException, (rc, cmdListStr, stderr): + #errMsg = "CommandException thrown while executing: " + cmdListStr + " with return code: " + str(rc) + " and stderr: " + stderr + errMsg = "Unexpected exception thrown by lvchange" + util.SMlog(errMsg) + if value == "-ay": + # Raise an error only if we are trying to make it available. + # Just warn if we are trying to make it unavailable after the + # snapshot operation is done. + raise xs_errors.XenError(errMsg) + return + + +def checkVolumeAvailablility(path): + try: + if not isVolumeAvailable(path): + # The VHD file is not available on XenSever. The volume is probably + # inactive or detached. + # Do lvchange -ay to make it available on XenServer + manageAvailability(path, '-ay') + except: + errMsg = "Could not determine status of ISCSI path: " + path + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + + success = False + i = 0 + while i < 6: + i = i + 1 + # Check if the vhd is actually visible by checking for the link + # set isISCSI to true + success = isVolumeAvailable(path) + if success: + util.SMlog("Made vhd: " + path + " available and confirmed that it is visible") + break + + # Sleep for 10 seconds before checking again. + time.sleep(10) + + # If not visible within 1 min fail + if not success: + util.SMlog("Could not make vhd: " + path + " available despite waiting for 1 minute. Does it exist?") + + return success + +def isVolumeAvailable(path): + # Check if iscsi volume is available on this XenServer. + status = "0" + try: + p = subprocess.Popen(["/bin/bash", "-c", "if [ -L " + path + " ]; then echo 1; else echo 0;fi"], stdout=subprocess.PIPE) + status = p.communicate()[0].strip("\n") + except: + errMsg = "Could not determine status of ISCSI path: " + path + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + + return (status == "1") + +def getVhdParent(session, args): + util.SMlog("getParent with " + str(args)) + primaryStorageSRUuid = args['primaryStorageSRUuid'] + snapshotUuid = args['snapshotUuid'] + isISCSI = getIsTrueString(args['isISCSI']) + + primarySRPath = getPrimarySRPath(session, primaryStorageSRUuid, isISCSI) + util.SMlog("primarySRPath: " + primarySRPath) + + baseCopyUuid = getParentOfSnapshot(snapshotUuid, primarySRPath, isISCSI) + + return baseCopyUuid + + +def backupSnapshot(session, args): + util.SMlog("Called backupSnapshot with " + str(args)) + primaryStorageSRUuid = args['primaryStorageSRUuid'] + dcId = args['dcId'] + accountId = args['accountId'] + volumeId = args['volumeId'] + secondaryStorageMountPath = args['secondaryStorageMountPath'] + snapshotUuid = args['snapshotUuid'] + prevBackupUuid = args['prevBackupUuid'] + backupUuid = args['backupUuid'] + isISCSI = getIsTrueString(args['isISCSI']) + + primarySRPath = getPrimarySRPath(session, primaryStorageSRUuid, isISCSI) + util.SMlog("primarySRPath: " + primarySRPath) + + baseCopyUuid = getParentOfSnapshot(snapshotUuid, primarySRPath, isISCSI) + baseCopyVHD = getVHD(baseCopyUuid, isISCSI) + baseCopyPath = os.path.join(primarySRPath, baseCopyVHD) + util.SMlog("Base copy path: " + baseCopyPath) + + + # Mount secondary storage mount path on XenServer along the path + # /var/run/sr-mount//snapshots/ and create / dir + # on it. + backupsDir = mountSnapshotsDir(secondaryStorageMountPath, "snapshots", dcId, accountId, volumeId) + util.SMlog("Backups dir " + backupsDir) + + # Check existence of snapshot on primary storage + isfile(baseCopyPath, isISCSI) + if prevBackupUuid: + # Check existence of prevBackupFile + prevBackupVHD = getBackupVHD(prevBackupUuid) + prevBackupFile = os.path.join(backupsDir, prevBackupVHD) + isfile(prevBackupFile, False) + + # copy baseCopyPath to backupsDir with new uuid + backupVHD = getBackupVHD(backupUuid) + backupFile = os.path.join(backupsDir, backupVHD) + util.SMlog("Back up " + baseCopyUuid + " to Secondary Storage as " + backupUuid) + copyfile(baseCopyPath, backupFile, isISCSI) + vhdutil.setHidden(backupFile, False) + + # Because the primary storage is always scanned, the parent of this base copy is always the first base copy. + # We don't want that, we want a chain of VHDs each of which is a delta from the previous. + # So set the parent of the current baseCopyVHD to prevBackupVHD + if prevBackupUuid: + # If there was a previous snapshot + setParent(prevBackupFile, backupFile) + + txt = "1#" + backupUuid + return txt + +@echo +def deleteSnapshotBackup(session, args): + util.SMlog("Calling deleteSnapshotBackup with " + str(args)) + dcId = args['dcId'] + accountId = args['accountId'] + volumeId = args['volumeId'] + secondaryStorageMountPath = args['secondaryStorageMountPath'] + backupUUID = args['backupUUID'] + + backupsDir = mountSnapshotsDir(secondaryStorageMountPath, "snapshots", dcId, accountId, volumeId) + # chdir to the backupsDir for convenience + chdir(backupsDir) + + backupVHD = getBackupVHD(backupUUID) + util.SMlog("checking existence of " + backupVHD) + + # The backupVHD is on secondary which is NFS and not ISCSI. + if not os.path.isfile(backupVHD): + util.SMlog("backupVHD " + backupVHD + "does not exist. Not trying to delete it") + return "1" + util.SMlog("backupVHD " + backupVHD + " exists.") + + # Just delete the backupVHD + try: + os.remove(backupVHD) + except OSError, (errno, strerror): + errMsg = "OSError while removing " + backupVHD + " with errno: " + str(errno) + " and strerr: " + strerror + util.SMlog(errMsg) + raise xs_errors.XenError(errMsg) + + return "1" + +if __name__ == "__main__": + XenAPIPlugin.dispatch({"getVhdParent":getVhdParent, "create_secondary_storage_folder":create_secondary_storage_folder, "delete_secondary_storage_folder":delete_secondary_storage_folder, "post_create_private_template":post_create_private_template, "backupSnapshot": backupSnapshot, "deleteSnapshotBackup": deleteSnapshotBackup, "unmountSnapshotsDir": unmountSnapshotsDir}) + diff --git a/scripts/vm/hypervisor/xenserver/xcposs/vmopspremium b/scripts/vm/hypervisor/xenserver/xcposs/vmopspremium new file mode 100644 index 00000000000..ce6cdbc9e33 --- /dev/null +++ b/scripts/vm/hypervisor/xenserver/xcposs/vmopspremium @@ -0,0 +1,129 @@ +#!/usr/bin/python +# Version @VERSION@ +# +# A plugin for executing script needed by vmops cloud + +import os, sys, time +import XenAPIPlugin +sys.path.append("/usr/lib/xcp/sm/") +import util +import socket + +def echo(fn): + def wrapped(*v, **k): + name = fn.__name__ + util.SMlog("#### VMOPS enter %s ####" % name ) + res = fn(*v, **k) + util.SMlog("#### VMOPS exit %s ####" % name ) + return res + return wrapped + +@echo +def forceShutdownVM(session, args): + domId = args['domId'] + try: + cmd = ["/usr/lib/xcp/debug/xenops", "destroy_domain", "-domid", domId] + txt = util.pread2(cmd) + except: + txt = '10#failed' + return txt + + +@echo +def create_privatetemplate_from_snapshot(session, args): + templatePath = args['templatePath'] + snapshotPath = args['snapshotPath'] + tmpltLocalDir = args['tmpltLocalDir'] + try: + cmd = ["bash", "/usr/lib/xcp/bin/create_privatetemplate_from_snapshot.sh",snapshotPath, templatePath, tmpltLocalDir] + txt = util.pread2(cmd) + except: + txt = '10#failed' + return txt + +@echo +def upgrade_snapshot(session, args): + templatePath = args['templatePath'] + snapshotPath = args['snapshotPath'] + try: + cmd = ["bash", "/usr/lib/xcp/bin/upgrate_snapshot.sh",snapshotPath, templatePath] + txt = util.pread2(cmd) + except: + txt = '10#failed' + return txt + +@echo +def copy_vhd_to_secondarystorage(session, args): + mountpoint = args['mountpoint'] + vdiuuid = args['vdiuuid'] + sruuid = args['sruuid'] + try: + cmd = ["bash", "/usr/lib/xcp/bin/copy_vhd_to_secondarystorage.sh", mountpoint, vdiuuid, sruuid] + txt = util.pread2(cmd) + except: + txt = '10#failed' + return txt + +@echo +def copy_vhd_from_secondarystorage(session, args): + mountpoint = args['mountpoint'] + sruuid = args['sruuid'] + namelabel = args['namelabel'] + try: + cmd = ["bash", "/usr/lib/xcp/bin/copy_vhd_from_secondarystorage.sh", mountpoint, sruuid, namelabel] + txt = util.pread2(cmd) + except: + txt = '10#failed' + return txt + +@echo +def setup_heartbeat_sr(session, args): + host = args['host'] + sr = args['sr'] + try: + cmd = ["bash", "/usr/lib/xcp/bin/setup_heartbeat_sr.sh", host, sr] + txt = util.pread2(cmd) + except: + txt = '' + return txt + +@echo +def setup_heartbeat_file(session, args): + host = args['host'] + sr = args['sr'] + add = args['add'] + try: + cmd = ["bash", "/usr/lib/xcp/bin/setup_heartbeat_file.sh", host, sr, add] + txt = util.pread2(cmd) + except: + txt = '' + return txt + +@echo +def check_heartbeat(session, args): + host = args['host'] + interval = args['interval'] + try: + cmd = ["bash", "/usr/lib/xcp/bin/check_heartbeat.sh", host, interval] + txt = util.pread2(cmd) + except: + txt='' + return txt + + +@echo +def heartbeat(session, args): + ''' + host = args['host'] + interval = args['interval'] + try: + cmd = ["/bin/bash", "/usr/lib/xcp/bin/launch_hb.sh", host, interval] + txt = util.pread2(cmd) + except: + txt='fail' + ''' + return '> DONE <' + +if __name__ == "__main__": + XenAPIPlugin.dispatch({"forceShutdownVM":forceShutdownVM, "upgrade_snapshot":upgrade_snapshot, "create_privatetemplate_from_snapshot":create_privatetemplate_from_snapshot, "copy_vhd_to_secondarystorage":copy_vhd_to_secondarystorage, "copy_vhd_from_secondarystorage":copy_vhd_from_secondarystorage, "setup_heartbeat_sr":setup_heartbeat_sr, "setup_heartbeat_file":setup_heartbeat_file, "check_heartbeat":check_heartbeat, "heartbeat": heartbeat}) + diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java index b6c1057a61a..f15e45ad264 100755 --- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java +++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java @@ -1508,7 +1508,9 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx throw new ConfigurationException(msg); } } else { - _serviceOffering = new ServiceOfferingVO("System Offering For Console Proxy", 1, DEFAULT_PROXY_VM_RAMSIZE, DEFAULT_PROXY_VM_CPUMHZ, 0, 0, false, null, useLocalStorage, true, null, true, VirtualMachine.Type.ConsoleProxy, true); + int ramSize = NumbersUtil.parseInt(_configDao.getValue("console.ram.size"), DEFAULT_PROXY_VM_RAMSIZE); + int cpuFreq = NumbersUtil.parseInt(_configDao.getValue("console.cpu.mhz"), DEFAULT_PROXY_VM_CPUMHZ); + _serviceOffering = new ServiceOfferingVO("System Offering For Console Proxy", 1, ramSize, cpuFreq, 0, 0, false, null, useLocalStorage, true, null, true, VirtualMachine.Type.ConsoleProxy, true); _serviceOffering.setUniqueName(ServiceOffering.consoleProxyDefaultOffUniqueName); _serviceOffering = _offeringDao.persistSystemServiceOffering(_serviceOffering); diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index d044d4f3525..fc8c0f7a4b3 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -603,8 +603,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian final Map configs = _configDao.getConfiguration("AgentManager", params); _mgmt_host = configs.get("host"); - _routerRamSize = NumbersUtil.parseInt(configs.get("router.ram.size"), DEFAULT_ROUTER_VM_RAMSIZE); - _routerCpuMHz = NumbersUtil.parseInt(configs.get("router.cpu.mhz"), DEFAULT_ROUTER_CPU_MHZ); + _routerRamSize = NumbersUtil.parseInt(_configDao.getValue("router.ram.size"), DEFAULT_ROUTER_VM_RAMSIZE); + _routerCpuMHz = NumbersUtil.parseInt(_configDao.getValue("router.cpu.mhz"), DEFAULT_ROUTER_CPU_MHZ); _routerExtraPublicNics = NumbersUtil.parseInt(_configDao.getValue(Config.RouterExtraPublicNics.key()), 2); diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java index 29a978244ee..0573b659aaf 100755 --- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java +++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java @@ -841,8 +841,10 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V throw new ConfigurationException(msg); } } else { + int ramSize = NumbersUtil.parseInt(_configDao.getValue("ssvm.ram.size"), DEFAULT_SS_VM_RAMSIZE); + int cpuFreq = NumbersUtil.parseInt(_configDao.getValue("ssvm.cpu.mhz"), DEFAULT_SS_VM_CPUMHZ); _useLocalStorage = Boolean.parseBoolean(configs.get(Config.SystemVMUseLocalStorage.key())); - _serviceOffering = new ServiceOfferingVO("System Offering For Secondary Storage VM", 1, DEFAULT_SS_VM_RAMSIZE, DEFAULT_SS_VM_CPUMHZ, null, null, false, null, _useLocalStorage, true, null, true, VirtualMachine.Type.SecondaryStorageVm, true); + _serviceOffering = new ServiceOfferingVO("System Offering For Secondary Storage VM", 1, ramSize, cpuFreq, null, null, false, null, _useLocalStorage, true, null, true, VirtualMachine.Type.SecondaryStorageVm, true); _serviceOffering.setUniqueName(ServiceOffering.ssvmDefaultOffUniqueName); _serviceOffering = _offeringDao.persistSystemServiceOffering(_serviceOffering); diff --git a/server/src/com/cloud/test/DatabaseConfig.java b/server/src/com/cloud/test/DatabaseConfig.java index 487e2c53991..9ab28685756 100755 --- a/server/src/com/cloud/test/DatabaseConfig.java +++ b/server/src/com/cloud/test/DatabaseConfig.java @@ -330,6 +330,8 @@ public class DatabaseConfig { s_defaultConfigurationValues.put("system.vm.use.local.storage", "false"); s_defaultConfigurationValues.put("use.local.storage", "false"); s_defaultConfigurationValues.put("init", "false"); + s_defaultConfigurationValues.put("cpu.overprovisioning.factor", "1"); + s_defaultConfigurationValues.put("mem.overprovisioning.factor", "1"); } protected DatabaseConfig() { diff --git a/setup/db/clouddev.sql b/setup/db/clouddev.sql new file mode 100644 index 00000000000..10ad3b2513e --- /dev/null +++ b/setup/db/clouddev.sql @@ -0,0 +1,33 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + +UPDATE `cloud`.`configuration` SET value = 'true' where name = 'use.local.storage'; +UPDATE `cloud`.`configuration` SET value = 'true' where name = 'system.vm.use.local.storage'; +INSERT INTO `cloud`.`disk_offering` (id, name, uuid, display_text, created, use_local_storage, type) VALUES (17, 'tinyOffering', UUID(), 'tinyOffering', NOW(), 1, 'Service'); +INSERT INTO `cloud`.`service_offering` (id, cpu, speed, ram_size) VALUES (17, 1, 100, 100); +INSERT INTO `cloud`.`disk_offering` (id, name, uuid, display_text, created, type, disk_size) VALUES (18, 'tinyDiskOffering', UUID(), 'tinyDiskOffering', NOW(), 'Disk', 1073741824); +INSERT INTO `cloud`.`configuration` (name,value) VALUE('router.ram.size', '100'); +INSERT INTO `cloud`.`configuration` (name,value) VALUE('router.cpu.mhz','100'); +INSERT INTO `cloud`.`configuration` (name,value) VALUE('console.ram.size','100'); +INSERT INTO `cloud`.`configuration` (name,value) VALUE('console.cpu.mhz', '100'); +INSERT INTO `cloud`.`configuration` (name,value) VALUE('ssvm.ram.size','100'); +INSERT INTO `cloud`.`configuration` (name,value) VALUE('ssvm.cpu.mhz','100'); +UPDATE `cloud`.`configuration` SET value='10' where name = 'storage.overprovisioning.factor'; +UPDATE `cloud`.`configuration` SET value='10' where name = 'cpu.overprovisioning.factor'; +UPDATE `cloud`.`configuration` SET value='10' where name = 'mem.overprovisioning.factor'; +UPDATE `cloud`.`vm_template` SET unique_name="tiny Linux",name="tiny Linux",url="http://nfs1.lab.vmops.com/templates/ttylinux_pv.vhd",checksum="046e134e642e6d344b34648223ba4bc1",display_text="tiny Linux" where id=5; diff --git a/setup/db/deploy-db-clouddev.sh b/setup/db/deploy-db-clouddev.sh new file mode 100644 index 00000000000..df2a38a7d40 --- /dev/null +++ b/setup/db/deploy-db-clouddev.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +mysql --user=cloud --password=cloud < clouddev.sql +if [ $? -ne 0 ]; then + printf "failed to init cloudev db" +fi From 8ca14c863748d02b349a30c81557ace8d8f76144 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Wed, 27 Jun 2012 23:45:10 -0700 Subject: [PATCH 25/37] need to copy build.xml to remote machine also --- build/build-clouddev.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/build-clouddev.xml b/build/build-clouddev.xml index d557ef6b883..20de53def36 100644 --- a/build/build-clouddev.xml +++ b/build/build-clouddev.xml @@ -68,6 +68,9 @@ + + + From e6a6f843615d6bafcf93298c87a4bd48fb11495e Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 28 Jun 2012 10:24:46 -0700 Subject: [PATCH 26/37] Pass context to instance wizard --- ui/scripts/ui-custom/instanceWizard.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index c92c0275337..4c1d7911eb4 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -20,6 +20,8 @@ */ cloudStack.instanceWizard = function(args) { return function(listViewArgs) { + var context = listViewArgs.context; + var instanceWizard = function(data) { var $wizard = $('#template').find('div.instance-wizard').clone(); var $progress = $wizard.find('div.progress ul li'); From c347c6bd095efa37387d5026124b85297a4dea07 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 28 Jun 2012 10:49:25 -0700 Subject: [PATCH 27/37] Add base VPC UI ** Note: this is a work-in-progress, and only contains dummy content Implement UI for managing VPC tiers, via a custom chart-like UI list tiers and allowing the management of VMs associated with the VPCs. --- ui/css/cloudstack3.css | 352 ++++++++++++++++- ui/images/bg-gradients.png | Bin 8322 -> 7539 bytes ui/index.jsp | 3 + ui/scripts/instanceWizard.js | 513 +++++++++++++++++++++++++ ui/scripts/instances.js | 513 +------------------------ ui/scripts/network.js | 87 ++++- ui/scripts/ui-custom/instanceWizard.js | 2 +- ui/scripts/ui-custom/vpc.js | 404 +++++++++++++++++++ ui/scripts/vpc.js | 469 ++++++++++++++++++++++ 9 files changed, 1825 insertions(+), 518 deletions(-) create mode 100644 ui/scripts/instanceWizard.js create mode 100644 ui/scripts/ui-custom/vpc.js create mode 100644 ui/scripts/vpc.js diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 573afe9daf9..7fbc3668733 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -8837,6 +8837,346 @@ div.panel.ui-dialog div.list-view div.fixed-header { background: #DFE1E3; } +/*VPC / vApps*/ +.vpc-chart { + width: 100%; + height: 93%; + overflow: auto; + position: relative; + margin: 30px 0 0; +} + +.vpc-chart .vpc-title { + font-size: 24px; + /*+placement:shift 50px 40px;*/ + position: relative; + left: 50px; + top: 40px; + position: absolute; + color: #5F768A; +} + +.vpc-chart ul.tiers { + padding: 0 0 0 26px; + margin: 79px 0 0 232px; + border-left: 3px solid #CCC; +} + +.vpc-chart li.tier { + display: block; + width: 258px; + height: 107px; + margin: -55px 0 90px; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; + border: 1px solid #50545A; + background: url(../images/bg-gradients.png) 0px -2637px; + /*+placement:shift 0px 58px;*/ + position: relative; + left: 0px; + top: 58px; + position: relative; + /*+box-shadow:0px 5px 7px #DADADA;*/ + -moz-box-shadow: 0px 5px 7px #DADADA; + -webkit-box-shadow: 0px 5px 7px #DADADA; + -o-box-shadow: 0px 5px 7px #DADADA; + box-shadow: 0px 5px 7px #DADADA; +} + +.vpc-chart li.tier .loading-overlay { + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; +} + +.vpc-chart li.tier .connect-line { + position: absolute; + width: 28px; + height: 3px; + background: #CCCCCC 0px -8px; + /*+placement:shift -29px 49px;*/ + position: relative; + left: -29px; + top: 49px; + position: absolute; +} + +.vpc-chart li.tier span.title { + color: #FFFFFF; + /*+placement:shift 11px 13px;*/ + position: relative; + left: 11px; + top: 13px; + position: absolute; + font-size: 24px; + /*+text-shadow:1px 2px 2px #000000;*/ + -moz-text-shadow: 1px 2px 2px #000000; + -webkit-text-shadow: 1px 2px 2px #000000; + -o-text-shadow: 1px 2px 2px #000000; + text-shadow: 1px 2px 2px #000000; +} + +.vpc-chart li.tier span.cidr { + /*+placement:shift 12px 46px;*/ + position: relative; + left: 12px; + top: 46px; + position: absolute; + font-size: 14px; + /*+text-shadow:0px -1px 1px #343E4C;*/ + -moz-text-shadow: 0px -1px 1px #343E4C; + -webkit-text-shadow: 0px -1px 1px #343E4C; + -o-text-shadow: 0px -1px 1px #343E4C; + text-shadow: 0px -1px 1px #343E4C; + color: #FFFFFF; +} + +.vpc-chart li.tier .actions { + width: 258px; + height: 35px; + background: #CCC; + /*+border-radius:0 0 4px 4px;*/ + -moz-border-radius: 0 0 4px 4px; + -webkit-border-radius: 0 0 4px 4px; + -khtml-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; + /*+placement:shift -1px 71px;*/ + position: relative; + left: -1px; + top: 71px; + position: absolute; + /*+box-shadow:inset 0px 1px #FFFFFF;*/ + -moz-box-shadow: inset 0px 1px #FFFFFF; + -webkit-box-shadow: inset 0px 1px #FFFFFF; + -o-box-shadow: inset 0px 1px #FFFFFF; + box-shadow: inset 0px 1px #FFFFFF; + border: 1px solid #808080; + border-top: 1px solid #4C545E; + position: absolute; +} + +.vpc-chart li.tier .actions .action { + cursor: pointer; + float: left; + width: 50px; + height: 24px; + text-align: center; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; + margin: 4px 0px 4px 4px; + border: 1px solid #909090; + color: #4B637A; + font-weight: bold; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; + background: url(../images/bg-gradients.png) 0px -2533px; +} + +.vpc-chart li.tier .actions .action.disabled, +.vpc-chart li.tier .actions .action.disabled:hover { + color: #9D9D9D; + background: #CFCFCF; + /*+text-shadow:none;*/ + -moz-text-shadow: none; + -webkit-text-shadow: none; + -o-text-shadow: none; + text-shadow: none; + border-color: #B5B5B5; + cursor: not-allowed; + /*+box-shadow:none;*/ + -moz-box-shadow: none; + -webkit-box-shadow: none; + -o-box-shadow: none; + box-shadow: none; +} + +.vpc-chart li.tier .actions .action:hover { + border: 1px solid #7A8B9A; + background-position: 0px -106px; + color: #5B7A96; + /*+box-shadow:inset 1px 2px 4px #808080;*/ + -moz-box-shadow: inset 1px 2px 4px #808080; + -webkit-box-shadow: inset 1px 2px 4px #808080; + -o-box-shadow: inset 1px 2px 4px #808080; + box-shadow: inset 1px 2px 4px #808080; +} + +.vpc-chart li.tier .actions .action span.label { + /*+placement:shift 1px 3px;*/ + position: relative; + left: 1px; + top: 3px; + font-size: 11px; +} + +.vpc-chart li.tier .actions .action.remove, +.vpc-chart li.tier .actions .action.remove:hover { + background: none; + width: 30px; + padding: 0; + float: right; + border: none; + /*+placement:shift -3px -2px;*/ + position: relative; + left: -3px; + top: -2px; + /*+box-shadow:none;*/ + -moz-box-shadow: none; + -webkit-box-shadow: none; + -o-box-shadow: none; + box-shadow: none; +} + +.vpc-chart li.tier .action span.icon { + background-image: url(../images/sprites.png); + cursor: pointer; + width: 37px; + height: 23px; + float: left; + /*+placement:shift 1px 3px;*/ + position: relative; + left: 1px; + top: 3px; +} + +.vpc-chart li.tier .vm-count { + font-size: 23px; + left: 134px; + top: 3px; + position: absolute; + color: #FFFFFF; + /*+text-shadow:1px 2px 2px #000000;*/ + -moz-text-shadow: 1px 2px 2px #000000; + -webkit-text-shadow: 1px 2px 2px #000000; + -o-text-shadow: 1px 2px 2px #000000; + text-shadow: 1px 2px 2px #000000; + cursor: pointer; + display: block; + padding: 5px; + text-align: center; + width: 100px; + border: 1px solid transparent; + margin: 4px; +} + +.vpc-chart li.tier .vm-count:hover { + border-radius: 4px; + border: 1px solid #4C545E; + background: url(../images/bg-gradients.png) 0px -2751px; +} + +.vpc-chart li.tier .vm-count .total { + padding-right: 4px; + font-size: 24px; +} + +.vpc-chart li.tier.placeholder { + background: #ECECEC; + border: dotted #ACACAC; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; + /*+box-shadow:none;*/ + -moz-box-shadow: none; + -webkit-box-shadow: none; + -o-box-shadow: none; + box-shadow: none; + cursor: pointer; +} + +.vpc-chart li.tier.placeholder:hover { + background: #D3D3D3; + /*+box-shadow:0px 2px 8px #A7A7A7;*/ + -moz-box-shadow: 0px 2px 8px #A7A7A7; + -webkit-box-shadow: 0px 2px 8px #A7A7A7; + -o-box-shadow: 0px 2px 8px #A7A7A7; + box-shadow: 0px 2px 8px #A7A7A7; +} + +.vpc-chart li.tier.placeholder span { + top: 40px; + left: 66px; + color: #9F9F9F; + /*+text-shadow:none;*/ + -moz-text-shadow: none; + -webkit-text-shadow: none; + -o-text-shadow: none; + text-shadow: none; +} + +.vpc-chart li.tier.placeholder:hover span { + color: #000000; + /*+text-shadow:0px 0px 7px #FFFFFF;*/ + -moz-text-shadow: 0px 0px 7px #FFFFFF; + -webkit-text-shadow: 0px 0px 7px #FFFFFF; + -o-text-shadow: 0px 0px 7px #FFFFFF; + text-shadow: 0px 0px 7px #FFFFFF; +} + +.vpc-chart li.tier.virtual-router { + margin: 0px; + width: 222px; + height: 65px; + /*+placement:shift 17px -36px;*/ + position: relative; + left: 17px; + top: -36px; + background-position: 0px -2519px; + border: 1px solid #ADADAD; +} + +.vpc-chart li.tier.virtual-router span { + color: #586E82; + font-size: 18px; + /*+text-shadow:0px 1px 3px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 3px #FFFFFF; + -webkit-text-shadow: 0px 1px 3px #FFFFFF; + -o-text-shadow: 0px 1px 3px #FFFFFF; + text-shadow: 0px 1px 3px #FFFFFF; + /*+placement:shift 53px 22px;*/ + position: relative; + left: 53px; + top: 22px; +} + +.vpc-chart li.tier.virtual-router .connect-line { + /*+placement:shift -47px 14px;*/ + position: relative; + left: -47px; + top: 14px; + width: 46px; +} + +/*Configure ACL dialog*/ +.ui-dialog.configure-acl { +} + +.ui-dialog.configure-acl .ui-dialog-buttonpane { + /*+placement:shift 709px -2px;*/ + position: relative; + left: 709px; + top: -2px; +} + +.ui-dialog.configure-acl .multi-edit .data { + width: 807px; + height: 370px; + overflow: auto; +} + /*Action icons*/ .action.edit .icon { background-position: 1px -1px; @@ -9005,13 +9345,15 @@ div.panel.ui-dialog div.list-view div.fixed-header { .create .icon, .createTemplate .icon, -.enableSwift .icon { +.enableSwift .icon, +.addVM .icon { background-position: -69px -63px; } .create:hover .icon, .createTemplate:hover .icon, -.enableSwift:hover .icon { +.enableSwift:hover .icon, +.addVM:hover .icon { background-position: -69px -645px; } @@ -9073,11 +9415,13 @@ div.panel.ui-dialog div.list-view div.fixed-header { background-position: -167px -648px; } -.generateKeys .icon { +.generateKeys .icon, +.networkACL .icon { background-position: -167px -95px; } -.generateKeys:hover .icon { +.generateKeys:hover .icon, +.networkACL:hover .icon { background-position: -167px -677px; } diff --git a/ui/images/bg-gradients.png b/ui/images/bg-gradients.png index 2ef74540bbf8aa6c7001afa9575456b65552db1f..52016f0cf487158c238037ef50e51ae64d124d9a 100644 GIT binary patch literal 7539 zcmcgxX+V=#mj(nOC=kUewcsS6s5LBMl}$p30zyQ=v8EI)kO)XgASUd)D6v)yRPza_ zRSGJf3pEu{6s(FhNGpOUf+CiJ3u{4T5h`=;`z8pAo%t~{@FVwqbC+|U^PK0Ld$Vip z8aFM?`I<^fN?IQ73?KMpD=E#mpfMd<^FB3r10SCXR&Esd^0o+~1Na;z7d9`DL-Gg@ z2o*EEGQI4Bc;Ti2sE=t(cm#}AQgU>Ti3kV^;|NHBoZwKd zlVR_rD~6;{wv*u()=YC|gexZ`)IE;R@r_%vJ}53M$c}C3yn^HyV-FLAa|8jTnDB47 z+w5bU46%9bp^aXf8IrIrf-omT+^CJrwIo*_pF^@XH8%+|w=pN#P)(_pR<^db6q1EG z)!fY7!i;KRLbbKGw6HffC&~W|VKqK`i@gtHm3%FDaxx4N2qNsw%%Y>CO`|PMdHi5A zs-2x3n#01v1bUcki{%OeVobQ(j1)64INO5wp%H>m9+!k>3<%^21x|)wDZYj9i1BH; z+vG3-U}iA^5oT0VbF?KzM<(;1yM~94_ueM(;k>hV%89qFkB#7%`Ea)Jg!~|I+!iCW zRD``NpA#V9@z?Ws-zZRA8^ROtwuSH_NUpxtBxXQRC>K3r{h3UA5AHTW05^!^!EiE! z8B9Y%+4knEtXwSUHr8}o27^jnNwu?eb#-yIwy|-svZd1LmWr_qUXU=H!xbpTvfquh z`RG_gh42VinZeZ4=Lz!)>+*a?nSyaM*1 z<~VKPVVw9JF0h>sw9ZwM7(+xo^I*8Fk7?>^W}fs9Zob)9GQcX@BdHwHIJ)js7JY{o zV~MK0Y^`eKgD370qza`QwoeMS=MOOTA{RdY>0sKv?`CUwRJu$LubM`#ji`^i-58%U z^V~VR_!lhykyp|FoiE!Zehl8_hK#Y-n;TYmH@^(N{c2BOhiS!|e;*gC@&~$D-sBTI z+=w>hllN}6bZGS&Q5xMxGhJ&pY8ILOn_;gG4(iMVLc`k!UQN{;0nF7#BV%LOUs& ze(QiZ5nfxpl5pr=qDQWm2X19?imJ8Gy0*!rV1Q~ROs>Mngq2C#ruWU1(h?-?ve`ru zUx!LoQDH=h2z_%>LYzdwVzt(vDQ=RKnC|@qWkWX!7)K=^rq98?`B4{EZ#D7EJhhs3 z*dghWZv;EEJN>IGk=K1S{#_o~ook(Kg`p-=iG+#gtFTO+b}SSZ!W2?hO?xTYOCh(Y zI=x=GZra&;wE}&ybN7|!OBbd-DjW0mCWjS`#Ay(fmp(t%W3p^!B_ONSMI^CE)rlly zu+hlVXtAmWhQywei9>%Ktyz<8%#Mz3@D-Kmy-76yAKdYi@TOUSuV`&D3;E8n2(!d= z+T+WSE#S@A-X2$P^41~;X%|r|EvDNV`nIPG9rf1Dze-RB2qUOgkO`^#IY+ztiQ* z8q$omu7=w&njR#-mf?%XiR&MZ)@|6EE1s?nonkuC$~09~QHm02hNRO`j#F z8Ddus&M)*m_=u)jph0Z;8#z5CWT7m0OxOshC;s&$^;5#uKW3#Hu#!F_0ythUBeEB! zKCZ-|rDy=6%9z`OU!w2iv!%pnqSb$G`>Y+_E(a2&gcy-Zd!75|WYcmNCtvfElwqB7 zhfF#@t4Xf%HAi^TQbPJmPu(2*E0VXi`^N5hsSBC19W&-R?kFH!jP1@Pc;t#5N_p{` z0iMnCPFx<)#23f*i5Zgb5ms}^;n`9M8Zb(+f4p7r^zi8NYi5o+4>omohm$;X`EN&K zy{~H5HWB)wXI`g`=58dZ1ZLpS0FyH*-dEEnJfZNwkos2rqTod~AU+a9PvG(NL=f1m z4VIktywi6jaet~uNi!+VKk3?#lfJ&GU3({eXvk@1r4zVfVw6|Ih9|~63Vi@X-0Cv= z%bE>IUoR$B`fA)798ggJiuPCARMxO5`MLrtIre~CMo(4ouJTrDTm7aAesig*F;iBh zyBI}B#h~R*7Afhui(J6qBPJ~ND2BRi+HR|in4P4 zi9+tKjU9Y8NS>`QNBrq!PR=YqT~g-dzR0uLRi;92m1P%lGh|t6jL#a$w?T0{n*q5( zQwPu>l4T1hft3=yQX5f}UF6pxb?qWHl8qVb94bWzuvQP53vcyV()wyL>ctUr!K76vO26-pGC78C}}tfdRK6yVUy0)u;S^)m7)ja`3c>x ziC!>V*U$mnD4Ur{36>CG%Tib1{sj=E-{R;AuzeKPjpP!2)?t?i>BO_Hss#lNo3O6M zM$6r!rVCbMK>Jm3aV~`^n0-_p3RtEsaXNNwK@wYTWgVh0=aW1Q{=Z+MV z9Z}%iu2PB)xyxiX(1w;G^C@N*Rc95Z8dc{Y)%TNJ=GaM9DR3oNNB=S`4=k6Uz11DRCbIt=Dx4r<`J|&@DqYXIiIAJuyT~D?`Y%X^4 zR>s4Kb}ltu1CZc$+(;RsEYq$$UhXk`Xm`NyY|{@y-?~0=P~Ew2IDWP)Fs#~Frt$(Y z-h>oDG7$enuzR|c&D4-P3#6^}*qI;I`dAzEMc(m0XP#0M7mOyjZ>&h4@lNb$s#CO! z%6e*BS_V(=_8|54z8N8}Bc0r@yi0|3X2W6nT#@q^S!z-%cscU+h$preV)FLSHQ6;; z9J-YixE4>-@ghR)bee=#M@zVHVBh8yx)L5=DgUZLf1Wef;pc4H`SUY9^hBHc=Bd>w z6Q;dLIY2zEZnuSAmr1$O*aTv=&k{UK$ch)mi&mu#MNqXWTXa08QDNQPD?0&E$C2-@ z1nH^qTP%Ab>&w&k5>2O#_UBwMnju2G zo=<3PsN9k|bZ9qLs)W2sSMrGOR+}BgZiM7^u_(Se8?rlzCOAi`NYAq&S9C7?hMvM` zH|t6VjZBrx7EP7?ROmcfyVw8T_q5S1o#x^lS2Ce4!g9(UwLZ72*s_h6FBny)L;f*_ z@Zhl^ohT}tW7-T_hkD!K};lf2O77{u_39pq9U>T~zHxs?d zORlI|Qq0N~2?v7`(jO*#_H|9g$uIpX*m~;+Z`|Gd8WP~9Hv`KK)9z>2UULuN6H~*||AfpaNI#MR(qM)LYEE`b4$I`Y1t;bAJ@%C8yw8Hf}AdLak zOFiWM`Yd!9oMG;V;cgs)msD6gM6q8MS=`&jT;DvM<3|fRFCcI5% zh>Ddt0_rPF0C}wW`)j2APzVASs-WZ2=Yb*guV&(P3`qU%qhPYdOWdIg((=l7n(kbX zhHt~TQoGhTld{8r<(}Qo+VJ?s9k4UD`t#?qewh6J_D6}&B*(=((W?<$<{BY&4<79?KG&;@eH2WJXwLQb_i)UF;A5KF=fE%!MZ+MfOpNRTzlU(b}Qa?>wFumS~H@}z_HK91fN*#sx!28-iI^Oa-4O%>N zRrwwDOHsAaesfkA)auV<{I3gBAAqdnfUmS#$?4^sS-Vt1zXMlIBdw_Jmn;Hnz`EaB zOB!6Eh6M7S)orbbc92>{uw#FRDjg!kxYFlegtM+}Iz&x^0E$=i97){=d&9~HC^L|6 zi&2f7vP7-Y5-Uc3ba6~C_)<4}f6HpkDFh#bjzRnOM11GdOBLOa`7z)DN0(a*h4xkOf;={wWQ3f zDDMN&qge@)3VxqxSw6R;=LOm(;zslFUaYAwe9|t}@4v1%f!Ph(v24=z6jeXAk>|gR zs#tJp03ZxScd{yR(E)r94HT&@Ev?{X(Aqrn(O}_=1v4{by?A+6O-1eV>YkE*8&QS?BU~1 zGx2O*V~ZuBj*T5rlR$<^6CoxM4U0HM59MAq7$1OnEob<~o#PnKHQZsY4dZid_+YL# zIFjq3QWnVZ$SXVfemDPmoPqX|vP1ZQdcJS;f8z7vM9Dvr7uP$bUn+%rYA^=Z$_xUx zPepN|f3N3-DM-pZ=&ZQ~3#$5muulzeX5_txyaFV-_8}L-WykyRxn8VTKtb1uJp>U` zjZvy?8&=yg(b_pe-$7K!jE8>8k{8E%!a64QLG(~C4h}bkI15T1)raFWR0szOv4YXj zb>uzAZh?n_CTTu1BA)}O{HDaQt)XXMrUfmuG0tFp^xJ9~D#2m1tDl2UVUB&vN% z@ufeiDIT`MmL&8sJdtl~6)`wdG+A$6l0eB?S%`1s)@ z3Qs-|skh5zUJNdii-J6eJZxY8`fRGC!#vpgjt!G_4Zr_%NlLpl5vG)o@bH$A=O4*S z?DN9n^0&W!vX^{(pnrd7#m+n{@?!6UujX_SPah(}?acJnhbeW&sv>lBg-q!wv3wpM2PBX|?7T??2zEmm8=;R!6``g3EpOk!o zC!N4h85w#;2i8x0MWqv5Alb zb#zGsIx#dYD=xP@KqPq#e+y@TQi`YlCP>|s*Rd3#4mpf2Lia#$pKJn`Qe2=`6r5oB z{hzp^8=2yAY5mC@xSS!>K7lhXoGL=-j;gl8)9Rsqup6_3cHK)=@7YVG{e2D}RzPxm zu+klCuUpmaS)7pE+IyZm_R`sVtkZj}Sm*Dbb>4=K{4tg=l9k+&JXRR>*Olvc$BI(N zZmW;p_0I3PyLe5wcx3yS&O_JH__1d}VGpm5&KuIJ8F?-&I~`QBd~sSw(|L5Xn+sQL zJ85$tColouG&nm1xJeA);01@){4A0&5DZ8M$0&5!FH65rv@Ddac=Ch81{{L2P{j=q z7liKSjQ@7NpgnXXIk6)-{I@I5eoU-Oj+Fi2s99|dzZxhK6O`uvk8O~I4=Yp}M&tjB p_sXra-tF^$vbKyeQmQmfY0kk;BlGjoY3OHAkCkf}XXsz2{TH-vhwK0V literal 8322 zcmbVQ2{e>#`+o*utWy*vnnB2#P}!#$GWKjS3DMY6#7jbHWSjE7*0M&W#E>Nw*&}I6 zh?MMamPFBKi>&|qnW6N)-#Ono|Km8%{XEb8-1l|;uIu-^u6wQ=G124Z*ueoo5Vt-- z#~fTq5QMB}X9c4rms)plL7pWL|9~J)KKLI2rQQ&PAP!S^JpRZLH!okWKis^|qV@53 z^jRM-7x&Z75OlsP-NMzm|@Mu*;^Tz$3pG3buR`^vdbO)HN(v_|evr$20A zd&uvA<>*yi$Yw9Z?_yZ53Vo1+_Uc=^ z5TK$`=xH;GvlwFMg7%tG!uLQdLC^`BnAmwJECu2}JY}shDN}$Nkp@Vm6l;`;tLlc> zvdek1SzF7CNHyyV$nfuXWO7W!%GU*?Y~L56%=`EBYY4g(w-tChy?nlzr=Yoce{>0t zgWOmR>#C@e)8NW*OWs*51by@kZe5X8c({YC&PqPBlDT_=#m%1cmfu{IOEE9@F?4IR z%X<1OjE(N?*s{*f;h~`q2K6{w$5+-DS6u5Ho?0)T{t>LPG&lQq^?-QDKD!V-mifQy zUe6e1?QDrhhB@_oiqTst77ek)q9?^I?Z%|B?i#XDLj_0Q>jS)x~P@q3={Zd)Y{ z^vfNo9Wy<58> zvWtGaHw4-1h|62PdZ_(^9fEXjg-9125}K(Mlzqy&vvyNYE$7mS{b4xq`Z^p6$3Y_R z^f|HT{$-q0L{pKl^a+J_tg!M^Gq;F@vpn*3R!?{|&+;xfvS-vvRfZs04$;{895G!K zgws_Uv1oRIl<;{>ErDfAlsNh&h2KonFiwS_XnxfaZAB2C()3|cjXZw1JWibk?Yq1b zQK_eREu`2?vz_ZPzAWd!jaG7J`i%yJH?eZcOefTnZwNLBt;W)3?E69Z~jp)=(JBU(uN=__I^tYp8_g~g0DXy zzU2yjpJZ7qlm3IdmTgqTo;m7u%zbR z%k9hMw3@bRw2YzJTU;zSY^7u|NJX|M=2_*YANgV-WZ_Cx&xy=+&GE9-z8g$jzQRg; zX7tPyf7k5R1Bb!N1~li%?GMk(Vm!F>BK$&B>LngDbzV3pU6H&jToI+2OTDd%S29qt zerP^@%|)ASFxh+lhOY^7L@GOJI{0cI|F=B@dxY*O83yl% zUof7Xey>Wmg18vMbLfSE!!@6_bDoAnu;C!M$$&oI@0<}PaHdcOtvJa@zAk*#EFth&+uca#4H=D zV|EV@=cniIeqWJak-a&)%p}1iFXO%Iv!cn8mnGEF?M1^MSi1{K&XinqbafJNEqz|_ zY$Bm5;bQs4zm_%GxFb7x@`R5G2mkTNhhOceT3>4OjS20G&u0=x6f-4>rY{hPXZ+5mPv+5NDm=QB<1c zpF8LHO+f3rme0*WtwD_gef#=|4zCY9Ev1zPvjMl8 z>t@2Uw^8M{$f_k`jVLAuul?r`N;+rTpS!2{{C7ul1k?%Fxr!>Z?r)`hz#o?uF_|Jr z8wbXJjjL1%5Pzm(*edqAvmFJ#Or3xa~*~!D92HPyZ71hm{f-}Td}LNwM$LYl~<~Xc^NWI zW)2d*KE{`1MHpJk3EO*dxTg_SNOu#|V!voK_se;TOO3bd1}X+9(kFA3H8Yqzh?ny>hjH zzgr+_>!lA;J?DpoBE4SKr1V^SM9r%&Bel4+xr~15lgqH>Nz6_9l*Hr7-P!esyZ`8; z@!9XX-3m!fQr#7yCHS&CH5yMUowHvyH>qn|-nE>uT(I0f(boIev18t|bwVhp^1Jfa zcipy?bIV#UtGlfbR>tpK-Z?MoFFu^pF1V6AI-j_B#xCFFjQ98p<~HVKHZh)(j@*Gdq20;UpE>C#Lnsj42{kq`{zWs)w<688Fc?6+uL2| zgk6OdPT^9gQV*wDq%PVz*_NBW)@pq}))%;>*S(APhO!1Rz+l?)rF+-t<+lm0Q!Rg{ zUr)anEdQhDM0aLM(8$T={!_eO-^x+GAKP?Sqej##)tiq`J@K6??jGi|eqx# zB_-6HxsbIy_Vmm4!tRE;29fHQ=am%gXO1q8*ZTMP3xB)Q&ucn#0ewko)$PZFS&KK> ziwWBk5>{E5lc$$XD#>+&eiMC?U~UXSfx97y911}{R>5@?g8cSE(AWtGQcH#)0k3$6 z=Z7I^YrekDAQTO-lC9xiVEgJWdpcMKn=fPrM?$<1@+G~Dk-&AKW*yA*p znhTr9yL)@{k`!We6=ys8gS#yVOl3a9SF=&=4PxwRv5tZo;o`C0kKTr`Q-nqNoNy$Z z5rurPm_#2KQIMNadWrN40wIdN9@@ldrkdfmE|hkdCm|7;oq9*T zN#WzDmZx#My@(Pz67^v;kHQZ76cnE*_!|%r)k_pJgrA0;Z;Tf+jF#0)%uv?8wGXoo zBcan*+=CyY6}LNs?cqOU9Man&DXkn_AG8nC;*r#oxDxQO+n8KqSTd?C^8EO9u}1SG zVW&u1oHMmCjGY1&XQAu_J7eE-4QwZc%*!^$?M7pVM4WIeER?S(zJWbZYcQ$>%~|hC zjFv@AcFFKD=|sx{}K7A(S~gOx6)1~qapD+15?)L97IXr7z^7#?qu`=>An0g%cn2=L?Gr8U#3-xhWw zBO{Q*OaNa~#0XyvFZK3sl)1KkaOe_~`m-X z7HZ|El*0Q0Ps!};Csf?)#tA{FTYrzgT%(8$nc6q-pCZAG5{UI8MG$V@>y zEPm6=z#ZugW#fHKI3g5-{z{wbAd^9`*P&~k ziEiE6xXtI{p5YD=yh-omq++aiY_BICF!RGY>Hzabi@h7}U{12bHpY$}TBEs<&W&k8TAMvI(Srxle8D(h?c02 z%X*2NeD47$J1mkJfOd6tg%j436Qs`k)`Pyja zbEsl01t=o58{rM~QECjMnIFI~IZ+z{Ws$U3{y<)g$*2c-n2f}+#PY8wb(lbA z?L3O23@Qat(!f)_L|H%h4g5Y@*3j-85M6a(>iUQ$PPlC<&KdMjv-3{&xCvBs2Nx@3`fTz}b6n?7yE(%;A=oVIqTt>Fmo6k8WcGw$Ne-C75SP5GQ z<=$lRTq zOLZgP4$Y?B5i`Yb-i50`G&w9}23sdFw8s?Vfg?k4!fVy(fS;W#rKNZPd!Z}Mk93AC zK0Jr7n-V+zOW{DO!~QS?b$v{DI~%hy8(t_c5puzMY&B9Rgew$rg{hM}G&^?FK))3! zZpY~qc7s=eogk+x7&dJ0!!&TCP&xu|+=0Gt`MhQbCHgWFy$SD0EgG!D+;+av# z6S3MWvma8fv-tRu2zA({D>YKFA_PGKFQ~%WGz$swaoSW;zA?p!pvmV1Do9!6lSnrS z3a`Lh?9ytiGKz1@rs7UtnBdkmK;tBaZ6zIv^f>+0Mn-I6-+x)1nQ&MNlSY#M;~(@4 zyR@5)FB6HnbU|W*#ze=*`6wp zvVbxo;7>}4EfQ-CJ6Jp9Srt?57k`d~P{ecz{Z+Ko zmJK?kU-5y*Z8*Ch-xV(Q2w6JVpKr9FFa><~GsSQWjV6I+Beoe2%F`_Q$rZSI!yhJ= z(^mkQJoLC@U1O)ZJm@9O2C$h?05VWR{h-VrSz&jvu@C%Bq1ScU_qJbuz;sYBNzih2 zN~V7Xq+Q?q3a@7PePlor=>PWYr|}A z;Z1rOXZ048Y$M9O2@I$+ZcdTs8x7QpHCRB}ft(3w^sz_+onD8o1J|$|2;^2_qK*-e zN5)#&s)oI0}$XdP-O5zT>pox%r_@DU}vSXl`km( zEWUVX;!l4=-z0xU~R5 z2E|~ltYeRJIn!wk-vf$xj!Ecnnh-kY#V$q5jpQ|mBS4oSGA;TBs)PyB-wvmq6=J z!|{`gBJdLwMWbbn$>2a?o5;Yl_-cneNF&(XPbQR0{o}N@`nX{g_!v?un}Ra5lYo0U z;v&x^>^}Ye`4MnDk@W+mik>EGoe3h7ADozAx;L>-qT_xuLbM$iz{%#~&J zn?JhXRe#FO^PcwQK=`NzM2BXs@cby~P1fE0uT_JA@IwC*>-CN6AQ)>#jd+1h>bGs- zxIH>w#oKR8ZxjzFmhS@W{r42#;H;)~?Sd;}rsvqiC_TyqF~i>MZ|ec4=fSU9MsML_ zf^$4!v2&R~$$;)_JqtkVxpDltX9=OSR`2PtxLQt4YPIYA_XnBI)4Hnvn7OF*fMJb{ zVefA!W!_3F4`L`V-13c9{0o;h?DFS9aH#oJ!8ppP6*>PEg=#6rN#s#+`?&rxAu zh9$9il^3*ZAV$ZCW5M_6Zj-^}GjMwR>?Gjzvp249)@Ixr(+-EA^{cQGs2p$r&dB=7 z{N{bU=a|;TjTw-6H?90q|CtSEBOUz%egePkW$??FzhwO`nKje#ba$q9uZ2&@u-D|D zi{4zzfqc-^GE8tkx&8qod@?nH3y&Dp3|03rF9`zh6V63~AG5o$3yX@#F{iFy(@s2&Io?oKd+0=vC&)~~CO&C)RJ7VDC z4kGkZI_cxqx*ypmekRTu4#&!<6}i8K=Z$f%*CWuO(z6?00}fcrZ>C6%-kWg!&0H2b zB+Tm@tf&3&px>$ z`i>sQH8q3r$z6N*pgo^Kp1ar6%JUfy=}r_+MBNU$y{>n2RgC`s?)5Cs-{}J4p}Urs zB>$;NbaNCTy^U z+2xnd zX|kBSFP~~uJ&sJu>nl8jimi)*}}dBsE?s4PE=cls;uw&Te1U%0I8h{ z|1brU56GgPEyJmGG&frNx$?rl;8|Ptny-a|)}{Yu%*P9hKVkaa{&hBTOK*%XQ)bmg bRY?5C&d + + + diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js new file mode 100644 index 00000000000..8559477573d --- /dev/null +++ b/ui/scripts/instanceWizard.js @@ -0,0 +1,513 @@ +(function($, cloudStack) { + var zoneObjs, hypervisorObjs, featuredTemplateObjs, communityTemplateObjs, myTemplateObjs, featuredIsoObjs, community + var selectedZoneObj, selectedTemplateObj, selectedHypervisor, selectedDiskOfferingObj; + var step5ContainerType = 'nothing-to-select'; //'nothing-to-select', 'select-network', 'select-security-group' + + cloudStack.instanceWizard = { + maxDiskOfferingSize: function() { + return g_capabilities.customdiskofferingmaxsize; + }, + steps: [ + // Step 1: Setup + function(args) { + $.ajax({ + url: createURL("listZones&available=true"), + dataType: "json", + async: false, + success: function(json) { + zoneObjs = json.listzonesresponse.zone; + args.response.success({ data: {zones: zoneObjs}}); + } + }); + }, + + // Step 2: Select template + function(args) { + $(zoneObjs).each(function(){ + if(this.id == args.currentData.zoneid) { + selectedZoneObj = this; + return false; //break the $.each() loop + } + }); + if(selectedZoneObj == null) { + alert("error: can't find matched zone object"); + return; + } + + $.ajax({ + url: createURL("listHypervisors&zoneid="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + hypervisorObjs = json.listhypervisorsresponse.hypervisor; + } + }); + + //***** get templates/ISOs (begin) ***** + var selectedTemplate = args.currentData['select-template']; + if (selectedTemplate == 'select-template') { + var hypervisorArray = []; + $(hypervisorObjs).each(function(index, item) { + hypervisorArray.push(item.name); + }); + + $.ajax({ + url: createURL("listTemplates&templatefilter=featured&zoneid="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + featuredTemplateObjs = $.grep(json.listtemplatesresponse.template, function(item, index) { + if($.inArray(item.hypervisor, hypervisorArray) > -1) + return true; + }); + } + }); + $.ajax({ + url: createURL("listTemplates&templatefilter=community&zoneid="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + communityTemplateObjs = $.grep(json.listtemplatesresponse.template, function(item, index) { + if($.inArray(item.hypervisor, hypervisorArray) > -1) + return true; + }); + } + }); + $.ajax({ + url: createURL("listTemplates&templatefilter=selfexecutable&zoneid="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + myTemplateObjs = $.grep(json.listtemplatesresponse.template, function(item, index) { + if($.inArray(item.hypervisor, hypervisorArray) > -1) + return true; + }); + } + }); + } else if (selectedTemplate == 'select-iso') { + $.ajax({ + url: createURL("listIsos&isofilter=featured&zoneid=" + args.currentData.zoneid + "&bootable=true"), + dataType: "json", + async: false, + success: function(json) { + featuredIsoObjs = json.listisosresponse.iso; + } + }); + $.ajax({ + url: createURL("listIsos&isofilter=community&zoneid=" + args.currentData.zoneid + "&bootable=true"), + dataType: "json", + async: false, + success: function(json) { + communityIsoObjs = json.listisosresponse.iso; + } + }); + $.ajax({ + url: createURL("listIsos&isofilter=selfexecutable&zoneid=" + args.currentData.zoneid + "&bootable=true"), + dataType: "json", + async: false, + success: function(json) { + myIsoObjs = json.listisosresponse.iso; + } + }); + } + //***** get templates/ISOs (end) ***** + + + var templatesObj = {}; + if (selectedTemplate == 'select-template') { + templatesObj = { + featuredtemplates: featuredTemplateObjs, + communitytemplates: communityTemplateObjs, + mytemplates: myTemplateObjs + } + } else if (selectedTemplate == 'select-iso') { + templatesObj = { + featuredisos: featuredIsoObjs, + communityisos: communityIsoObjs, + myisos: myIsoObjs + } + } + args.response.success({ + hypervisor: { + idField: 'name', + nameField: 'name' + }, + data: { + templates: templatesObj, + hypervisors: hypervisorObjs + } + }); + }, + + // Step 3: Service offering + function(args) { + if(args.currentData["select-template"] == "select-template") { + if(featuredTemplateObjs != null && featuredTemplateObjs.length > 0) { + for(var i=0; i < featuredTemplateObjs.length; i++) { + if(featuredTemplateObjs[i].id == args.currentData.templateid) { + selectedTemplateObj = featuredTemplateObjs[i]; + break; + } + } + } + if(selectedTemplateObj == null) { + if(communityTemplateObjs != null && communityTemplateObjs.length > 0) { + for(var i=0; i < communityTemplateObjs.length; i++) { + if(communityTemplateObjs[i].id == args.currentData.templateid) { + selectedTemplateObj = communityTemplateObjs[i]; + break; + } + } + } + } + if(selectedTemplateObj == null) { + if(myTemplateObjs != null && myTemplateObjs.length > 0) { + for(var i=0; i < myTemplateObjs.length; i++) { + if(myTemplateObjs[i].id == args.currentData.templateid) { + selectedTemplateObj = myTemplateObjs[i]; + break; + } + } + } + } + if(selectedTemplateObj == null) + alert("unable to find matched template object"); + else + selectedHypervisor = selectedTemplateObj.hypervisor; + } + else { //(args.currentData["select-template"] == "select-iso" + selectedHypervisor = args.currentData.hypervisorid; + } + + $.ajax({ + url: createURL("listServiceOfferings&issystem=false"), + dataType: "json", + async: true, + success: function(json) { + serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering; + args.response.success({ + data: {serviceOfferings: serviceOfferingObjs} + }); + } + }); + }, + + // Step 4: Data disk offering + function(args) { + var isRequred = (args.currentData["select-template"] == "select-iso"? true: false); + $.ajax({ + url: createURL("listDiskOfferings"), + dataType: "json", + async: true, + success: function(json) { + diskOfferingObjs = json.listdiskofferingsresponse.diskoffering; + args.response.success({ + required: isRequred, + customFlag: 'iscustomized', // Field determines if custom slider is shown + data: {diskOfferings: diskOfferingObjs} + }); + } + }); + }, + + // Step 5: Network + function(args) { + if(diskOfferingObjs != null && diskOfferingObjs.length > 0) { + for(var i=0; i < diskOfferingObjs.length; i++) { + if(diskOfferingObjs[i].id == args.currentData.diskofferingid) { + selectedDiskOfferingObj = diskOfferingObjs[i]; + break; + } + } + } + + if (selectedZoneObj.networktype == "Advanced") { //Advanced zone. Show network list. + step5ContainerType = 'select-network'; + } + else { //Basic zone. Show securigy group list or nothing(when no SecurityGroup service in guest network) + var includingSecurityGroupService = false; + $.ajax({ + url: createURL("listNetworks&trafficType=Guest&zoneId=" + selectedZoneObj.id), + dataType: "json", + async: false, + success: function(json) { + //basic zone should have only one guest network returned in this API call + var items = json.listnetworksresponse.network; + if(items != null && items.length > 0) { + var networkObj = items[0]; //basic zone has only one guest network + var serviceObjArray = networkObj.service; + for(var k = 0; k < serviceObjArray.length; k++) { + if(serviceObjArray[k].name == "SecurityGroup") { + includingSecurityGroupService = true; + break; + } + } + } + } + }); + + if(includingSecurityGroupService == false || selectedHypervisor == "VMware") { + step5ContainerType = 'nothing-to-select'; + } + else { + step5ContainerType = 'select-security-group'; + } + } + + //step5ContainerType = 'nothing-to-select'; //for testing only, comment it out before checking in + if(step5ContainerType == 'select-network') { + var defaultNetworkArray = [], optionalNetworkArray = []; + var networkData = { + zoneId: args.currentData.zoneid + }; + + if (!(cloudStack.context.projects && cloudStack.context.projects[0])) { + networkData.domainid = g_domainid; + networkData.account = g_account; + } + + var networkObjs; + $.ajax({ + url: createURL('listNetworks'), + data: networkData, + dataType: "json", + async: false, + success: function(json) { + networkObjs = json.listnetworksresponse.network ? json.listnetworksresponse.network : []; + } + }); + + + var apiCmd = "listNetworkOfferings&guestiptype=Isolated&supportedServices=sourceNat&state=Enabled&specifyvlan=false&zoneid=" + args.currentData.zoneid ; + var array1 = []; + var guestTrafficTypeTotal = 0; + + $.ajax({ + url: createURL(apiCmd + array1.join("")), //get the network offering for isolated network with sourceNat + dataType: "json", + async: false, + success: function(json) { + networkOfferingObjs = json.listnetworkofferingsresponse.networkoffering; + } + }); + //get network offerings (end) *** + + + args.response.success({ + type: 'select-network', + data: { + myNetworks: [], //not used any more + sharedNetworks: networkObjs, + securityGroups: [], + networkOfferings: networkOfferingObjs + } + }); + } + + else if(step5ContainerType == 'select-security-group') { + var securityGroupArray = []; + var data = { + domainid: g_domainid, + account: g_account + }; + + $.ajax({ + url: createURL("listSecurityGroups"), + dataType: "json", + async: false, + data: cloudStack.context.projects ? {} : data, + success: function(json) { + var items = json.listsecuritygroupsresponse.securitygroup; + if (items != null && items.length > 0) { + for (var i = 0; i < items.length; i++) { + if(items[i].name != "default") //exclude default security group because it is always applied + securityGroupArray.push(items[i]); + } + } + } + }); + args.response.success({ + type: 'select-security-group', + data: { + myNetworks: [], //not used any more + sharedNetworks: [], + securityGroups: securityGroupArray, + networkOfferings: [] + } + }); + } + + else if(step5ContainerType == 'nothing-to-select') { + args.response.success({ + type: 'nothing-to-select', + data: { + myNetworks: [], //not used any more + sharedNetworks: [], + securityGroups: [], + networkOfferings: [] + } + }); + } + + }, + + // Step 6: Review + function(args) { + return false; + } + ], + action: function(args) { +/* +var isValid = true; +isValid &= validateString("Name", $thisPopup.find("#wizard_vm_name"), $thisPopup.find("#wizard_vm_name_errormsg"), true); //optional +isValid &= validateString("Group", $thisPopup.find("#wizard_vm_group"), $thisPopup.find("#wizard_vm_group_errormsg"), true); //optional +if (!isValid) +return; +*/ + + // Create a new VM!!!! + var array1 = []; + + //step 1 : select zone + array1.push("&zoneId=" + args.data.zoneid); + + //step 2: select template + array1.push("&templateId=" + args.data.templateid); + array1.push("&hypervisor=" + selectedHypervisor); + + //step 3: select service offering + array1.push("&serviceOfferingId=" + args.data.serviceofferingid); + + //step 4: select disk offering + if(args.data.diskofferingid != null && args.data.diskofferingid != "0") { + array1.push("&diskOfferingId=" + args.data.diskofferingid); + if(selectedDiskOfferingObj.iscustomized == true) + array1.push("&size=" + args.data.size); + } + + //step 5: select network + if (step5ContainerType == 'select-network') { + var array2 = []; + var defaultNetworkId = args.data.defaultNetwork; //args.data.defaultNetwork might be equal to string "new-network" or a network ID + + var checkedNetworkIdArray; + if(typeof(args.data["my-networks"]) == "object" && args.data["my-networks"].length != null) { //args.data["my-networks"] is an array of string, e.g. ["203", "202"], + checkedNetworkIdArray = args.data["my-networks"]; + } + else if(typeof(args.data["my-networks"]) == "string" && args.data["my-networks"].length > 0) { //args.data["my-networks"] is a string, e.g. "202" + checkedNetworkIdArray = []; + checkedNetworkIdArray.push(args.data["my-networks"]); + } + else { // typeof(args.data["my-networks"]) == null + checkedNetworkIdArray = []; + } + + //create new network starts here + if(args.data["new-network"] == "create-new-network") { + var isCreateNetworkSuccessful = true; + $.ajax({ + url: createURL("createNetwork&networkOfferingId="+args.data["new-network-networkofferingid"]+"&name="+todb(args.data["new-network-name"])+"&displayText="+todb(args.data["new-network-name"])+"&zoneId="+selectedZoneObj.id), + dataType: "json", + async: false, + success: function(json) { + newNetwork = json.createnetworkresponse.network; + checkedNetworkIdArray.push(newNetwork.id); + if(defaultNetworkId == "new-network") + defaultNetworkId = newNetwork.id; + }, + error: function(XMLHttpResponse) { + isCreateNetworkSuccessful = false; + var errorMsg = "Failed to create new network, unable to proceed to deploy VM. Error: " + parseXMLHttpResponse(XMLHttpResponse); + //alert(errorMsg); + args.response.error(errorMsg); //args.response.error(errorMsg) here doesn't show errorMsg. Waiting for Brian to fix it. use alert(errorMsg) to show errorMsg for now. + } + }); + if(isCreateNetworkSuccessful == false) + return; + } + //create new network ends here + + //add default network first + if(defaultNetworkId != null && defaultNetworkId.length > 0) + array2.push(defaultNetworkId); + + //then, add other checked networks + if(checkedNetworkIdArray.length > 0) { + for(var i=0; i < checkedNetworkIdArray.length; i++) { + if(checkedNetworkIdArray[i] != defaultNetworkId) //exclude defaultNetworkId that has been added to array2 + array2.push(checkedNetworkIdArray[i]); + } + } + + array1.push("&networkIds=" + array2.join(",")); + } + else if (step5ContainerType == 'select-security-group') { + var checkedSecurityGroupIdArray; + if(typeof(args.data["security-groups"]) == "object" && args.data["security-groups"].length != null) { //args.data["security-groups"] is an array of string, e.g. ["2375f8cc-8a73-4b8d-9b26-50885a25ffe0", "27c60d2a-de7f-4bb7-96e5-a602cec681df","c6301d77-99b5-4e8a-85e2-3ea2ab31c342"], + checkedSecurityGroupIdArray = args.data["security-groups"]; + } + else if(typeof(args.data["security-groups"]) == "string" && args.data["security-groups"].length > 0) { //args.data["security-groups"] is a string, e.g. "2375f8cc-8a73-4b8d-9b26-50885a25ffe0" + checkedSecurityGroupIdArray = []; + checkedSecurityGroupIdArray.push(args.data["security-groups"]); + } + else { // typeof(args.data["security-groups"]) == null + checkedSecurityGroupIdArray = []; + } + + if(checkedSecurityGroupIdArray.length > 0) + array1.push("&securitygroupids=" + checkedSecurityGroupIdArray.join(",")); + } + + var displayname = args.data.displayname; + if(displayname != null && displayname.length > 0) { + array1.push("&displayname="+todb(displayname)); + array1.push("&name="+todb(displayname)); + } + + var group = args.data.groupname; + if (group != null && group.length > 0) + array1.push("&group="+todb(group)); + + //array1.push("&startVm=false"); //for testing only, comment it out before checking in + + $.ajax({ + url: createURL("deployVirtualMachine"+array1.join("")), + dataType: "json", + success: function(json) { + var jid = json.deployvirtualmachineresponse.jobid; + var vmid = json.deployvirtualmachineresponse.id; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + var item = json.queryasyncjobresultresponse.jobresult.virtualmachine; + if (item.password != null) + alert("Password of new VM " + item.displayname + " is " + item.password); + return item; + }, + getActionFilter: function() { + return vmActionfilter; + }, + getUpdatedItemWhenAsyncJobFails: function() { + var item; + $.ajax({ + url: createURL("listVirtualMachines&id="+vmid), + dataType: "json", + async: false, + success: function(json) { + item = json.listvirtualmachinesresponse.virtualmachine[0]; + } + }); + return item; + } + } + } + ); + }, + error: function(XMLHttpResponse) { + args.response.error(parseXMLHttpResponse(XMLHttpResponse)); //wait for Brian to implement + } + }); + } + }; +}(jQuery, cloudStack)); diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index 77688c978a6..5e9b3f3bb32 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -15,11 +15,6 @@ // specific language governing permissions and limitations // under the License. (function($, cloudStack) { - - var zoneObjs, hypervisorObjs, featuredTemplateObjs, communityTemplateObjs, myTemplateObjs, featuredIsoObjs, communityIsoObjs, myIsoObjs, serviceOfferingObjs, diskOfferingObjs, networkOfferingObjs, physicalNetworkObjs; - var selectedZoneObj, selectedTemplateObj, selectedHypervisor, selectedDiskOfferingObj; - var step5ContainerType = 'nothing-to-select'; //'nothing-to-select', 'select-network', 'select-security-group' - cloudStack.sections.instances = { title: 'label.instances', id: 'instances', @@ -69,513 +64,7 @@ label: 'label.vm.add', action: { - custom: cloudStack.instanceWizard({ - maxDiskOfferingSize: function() { - return g_capabilities.customdiskofferingmaxsize; - }, - steps: [ - // Step 1: Setup - function(args) { - $.ajax({ - url: createURL("listZones&available=true"), - dataType: "json", - async: false, - success: function(json) { - zoneObjs = json.listzonesresponse.zone; - args.response.success({ data: {zones: zoneObjs}}); - } - }); - }, - - // Step 2: Select template - function(args) { - $(zoneObjs).each(function(){ - if(this.id == args.currentData.zoneid) { - selectedZoneObj = this; - return false; //break the $.each() loop - } - }); - if(selectedZoneObj == null) { - alert("error: can't find matched zone object"); - return; - } - - $.ajax({ - url: createURL("listHypervisors&zoneid="+args.currentData.zoneid), - dataType: "json", - async: false, - success: function(json) { - hypervisorObjs = json.listhypervisorsresponse.hypervisor; - } - }); - - //***** get templates/ISOs (begin) ***** - var selectedTemplate = args.currentData['select-template']; - if (selectedTemplate == 'select-template') { - var hypervisorArray = []; - $(hypervisorObjs).each(function(index, item) { - hypervisorArray.push(item.name); - }); - - $.ajax({ - url: createURL("listTemplates&templatefilter=featured&zoneid="+args.currentData.zoneid), - dataType: "json", - async: false, - success: function(json) { - featuredTemplateObjs = $.grep(json.listtemplatesresponse.template, function(item, index) { - if($.inArray(item.hypervisor, hypervisorArray) > -1) - return true; - }); - } - }); - $.ajax({ - url: createURL("listTemplates&templatefilter=community&zoneid="+args.currentData.zoneid), - dataType: "json", - async: false, - success: function(json) { - communityTemplateObjs = $.grep(json.listtemplatesresponse.template, function(item, index) { - if($.inArray(item.hypervisor, hypervisorArray) > -1) - return true; - }); - } - }); - $.ajax({ - url: createURL("listTemplates&templatefilter=selfexecutable&zoneid="+args.currentData.zoneid), - dataType: "json", - async: false, - success: function(json) { - myTemplateObjs = $.grep(json.listtemplatesresponse.template, function(item, index) { - if($.inArray(item.hypervisor, hypervisorArray) > -1) - return true; - }); - } - }); - } else if (selectedTemplate == 'select-iso') { - $.ajax({ - url: createURL("listIsos&isofilter=featured&zoneid=" + args.currentData.zoneid + "&bootable=true"), - dataType: "json", - async: false, - success: function(json) { - featuredIsoObjs = json.listisosresponse.iso; - } - }); - $.ajax({ - url: createURL("listIsos&isofilter=community&zoneid=" + args.currentData.zoneid + "&bootable=true"), - dataType: "json", - async: false, - success: function(json) { - communityIsoObjs = json.listisosresponse.iso; - } - }); - $.ajax({ - url: createURL("listIsos&isofilter=selfexecutable&zoneid=" + args.currentData.zoneid + "&bootable=true"), - dataType: "json", - async: false, - success: function(json) { - myIsoObjs = json.listisosresponse.iso; - } - }); - } - //***** get templates/ISOs (end) ***** - - - var templatesObj = {}; - if (selectedTemplate == 'select-template') { - templatesObj = { - featuredtemplates: featuredTemplateObjs, - communitytemplates: communityTemplateObjs, - mytemplates: myTemplateObjs - } - } else if (selectedTemplate == 'select-iso') { - templatesObj = { - featuredisos: featuredIsoObjs, - communityisos: communityIsoObjs, - myisos: myIsoObjs - } - } - args.response.success({ - hypervisor: { - idField: 'name', - nameField: 'name' - }, - data: { - templates: templatesObj, - hypervisors: hypervisorObjs - } - }); - }, - - // Step 3: Service offering - function(args) { - if(args.currentData["select-template"] == "select-template") { - if(featuredTemplateObjs != null && featuredTemplateObjs.length > 0) { - for(var i=0; i < featuredTemplateObjs.length; i++) { - if(featuredTemplateObjs[i].id == args.currentData.templateid) { - selectedTemplateObj = featuredTemplateObjs[i]; - break; - } - } - } - if(selectedTemplateObj == null) { - if(communityTemplateObjs != null && communityTemplateObjs.length > 0) { - for(var i=0; i < communityTemplateObjs.length; i++) { - if(communityTemplateObjs[i].id == args.currentData.templateid) { - selectedTemplateObj = communityTemplateObjs[i]; - break; - } - } - } - } - if(selectedTemplateObj == null) { - if(myTemplateObjs != null && myTemplateObjs.length > 0) { - for(var i=0; i < myTemplateObjs.length; i++) { - if(myTemplateObjs[i].id == args.currentData.templateid) { - selectedTemplateObj = myTemplateObjs[i]; - break; - } - } - } - } - if(selectedTemplateObj == null) - alert("unable to find matched template object"); - else - selectedHypervisor = selectedTemplateObj.hypervisor; - } - else { //(args.currentData["select-template"] == "select-iso" - selectedHypervisor = args.currentData.hypervisorid; - } - - $.ajax({ - url: createURL("listServiceOfferings&issystem=false"), - dataType: "json", - async: true, - success: function(json) { - serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering; - args.response.success({ - data: {serviceOfferings: serviceOfferingObjs} - }); - } - }); - }, - - // Step 4: Data disk offering - function(args) { - var isRequred = (args.currentData["select-template"] == "select-iso"? true: false); - $.ajax({ - url: createURL("listDiskOfferings"), - dataType: "json", - async: true, - success: function(json) { - diskOfferingObjs = json.listdiskofferingsresponse.diskoffering; - args.response.success({ - required: isRequred, - customFlag: 'iscustomized', // Field determines if custom slider is shown - data: {diskOfferings: diskOfferingObjs} - }); - } - }); - }, - - // Step 5: Network - function(args) { - if(diskOfferingObjs != null && diskOfferingObjs.length > 0) { - for(var i=0; i < diskOfferingObjs.length; i++) { - if(diskOfferingObjs[i].id == args.currentData.diskofferingid) { - selectedDiskOfferingObj = diskOfferingObjs[i]; - break; - } - } - } - - if (selectedZoneObj.networktype == "Advanced") { //Advanced zone. Show network list. - step5ContainerType = 'select-network'; - } - else { //Basic zone. Show securigy group list or nothing(when no SecurityGroup service in guest network) - var includingSecurityGroupService = false; - $.ajax({ - url: createURL("listNetworks&trafficType=Guest&zoneId=" + selectedZoneObj.id), - dataType: "json", - async: false, - success: function(json) { - //basic zone should have only one guest network returned in this API call - var items = json.listnetworksresponse.network; - if(items != null && items.length > 0) { - var networkObj = items[0]; //basic zone has only one guest network - var serviceObjArray = networkObj.service; - for(var k = 0; k < serviceObjArray.length; k++) { - if(serviceObjArray[k].name == "SecurityGroup") { - includingSecurityGroupService = true; - break; - } - } - } - } - }); - - if(includingSecurityGroupService == false || selectedHypervisor == "VMware") { - step5ContainerType = 'nothing-to-select'; - } - else { - step5ContainerType = 'select-security-group'; - } - } - - //step5ContainerType = 'nothing-to-select'; //for testing only, comment it out before checking in - if(step5ContainerType == 'select-network') { - var defaultNetworkArray = [], optionalNetworkArray = []; - var networkData = { - zoneId: args.currentData.zoneid - }; - - if (!(cloudStack.context.projects && cloudStack.context.projects[0])) { - networkData.domainid = g_domainid; - networkData.account = g_account; - } - - var networkObjs; - $.ajax({ - url: createURL('listNetworks'), - data: networkData, - dataType: "json", - async: false, - success: function(json) { - networkObjs = json.listnetworksresponse.network ? json.listnetworksresponse.network : []; - } - }); - - - var apiCmd = "listNetworkOfferings&guestiptype=Isolated&supportedServices=sourceNat&state=Enabled&specifyvlan=false&zoneid=" + args.currentData.zoneid ; - var array1 = []; - var guestTrafficTypeTotal = 0; - - $.ajax({ - url: createURL(apiCmd + array1.join("")), //get the network offering for isolated network with sourceNat - dataType: "json", - async: false, - success: function(json) { - networkOfferingObjs = json.listnetworkofferingsresponse.networkoffering; - } - }); - //get network offerings (end) *** - - - args.response.success({ - type: 'select-network', - data: { - myNetworks: [], //not used any more - sharedNetworks: networkObjs, - securityGroups: [], - networkOfferings: networkOfferingObjs - } - }); - } - - else if(step5ContainerType == 'select-security-group') { - var securityGroupArray = []; - var data = { - domainid: g_domainid, - account: g_account - }; - - $.ajax({ - url: createURL("listSecurityGroups"), - dataType: "json", - async: false, - data: cloudStack.context.projects ? {} : data, - success: function(json) { - var items = json.listsecuritygroupsresponse.securitygroup; - if (items != null && items.length > 0) { - for (var i = 0; i < items.length; i++) { - if(items[i].name != "default") //exclude default security group because it is always applied - securityGroupArray.push(items[i]); - } - } - } - }); - args.response.success({ - type: 'select-security-group', - data: { - myNetworks: [], //not used any more - sharedNetworks: [], - securityGroups: securityGroupArray, - networkOfferings: [] - } - }); - } - - else if(step5ContainerType == 'nothing-to-select') { - args.response.success({ - type: 'nothing-to-select', - data: { - myNetworks: [], //not used any more - sharedNetworks: [], - securityGroups: [], - networkOfferings: [] - } - }); - } - - }, - - // Step 6: Review - function(args) { - return false; - } - ], - action: function(args) { - /* - var isValid = true; - isValid &= validateString("Name", $thisPopup.find("#wizard_vm_name"), $thisPopup.find("#wizard_vm_name_errormsg"), true); //optional - isValid &= validateString("Group", $thisPopup.find("#wizard_vm_group"), $thisPopup.find("#wizard_vm_group_errormsg"), true); //optional - if (!isValid) - return; - */ - - // Create a new VM!!!! - var array1 = []; - - //step 1 : select zone - array1.push("&zoneId=" + args.data.zoneid); - - //step 2: select template - array1.push("&templateId=" + args.data.templateid); - array1.push("&hypervisor=" + selectedHypervisor); - - //step 3: select service offering - array1.push("&serviceOfferingId=" + args.data.serviceofferingid); - - //step 4: select disk offering - if(args.data.diskofferingid != null && args.data.diskofferingid != "0") { - array1.push("&diskOfferingId=" + args.data.diskofferingid); - if(selectedDiskOfferingObj.iscustomized == true) - array1.push("&size=" + args.data.size); - } - - //step 5: select network - if (step5ContainerType == 'select-network') { - var array2 = []; - var defaultNetworkId = args.data.defaultNetwork; //args.data.defaultNetwork might be equal to string "new-network" or a network ID - - var checkedNetworkIdArray; - if(typeof(args.data["my-networks"]) == "object" && args.data["my-networks"].length != null) { //args.data["my-networks"] is an array of string, e.g. ["203", "202"], - checkedNetworkIdArray = args.data["my-networks"]; - } - else if(typeof(args.data["my-networks"]) == "string" && args.data["my-networks"].length > 0) { //args.data["my-networks"] is a string, e.g. "202" - checkedNetworkIdArray = []; - checkedNetworkIdArray.push(args.data["my-networks"]); - } - else { // typeof(args.data["my-networks"]) == null - checkedNetworkIdArray = []; - } - - //create new network starts here - if(args.data["new-network"] == "create-new-network") { - var isCreateNetworkSuccessful = true; - $.ajax({ - url: createURL("createNetwork&networkOfferingId="+args.data["new-network-networkofferingid"]+"&name="+todb(args.data["new-network-name"])+"&displayText="+todb(args.data["new-network-name"])+"&zoneId="+selectedZoneObj.id), - dataType: "json", - async: false, - success: function(json) { - newNetwork = json.createnetworkresponse.network; - checkedNetworkIdArray.push(newNetwork.id); - if(defaultNetworkId == "new-network") - defaultNetworkId = newNetwork.id; - }, - error: function(XMLHttpResponse) { - isCreateNetworkSuccessful = false; - var errorMsg = "Failed to create new network, unable to proceed to deploy VM. Error: " + parseXMLHttpResponse(XMLHttpResponse); - //alert(errorMsg); - args.response.error(errorMsg); //args.response.error(errorMsg) here doesn't show errorMsg. Waiting for Brian to fix it. use alert(errorMsg) to show errorMsg for now. - } - }); - if(isCreateNetworkSuccessful == false) - return; - } - //create new network ends here - - //add default network first - if(defaultNetworkId != null && defaultNetworkId.length > 0) - array2.push(defaultNetworkId); - - //then, add other checked networks - if(checkedNetworkIdArray.length > 0) { - for(var i=0; i < checkedNetworkIdArray.length; i++) { - if(checkedNetworkIdArray[i] != defaultNetworkId) //exclude defaultNetworkId that has been added to array2 - array2.push(checkedNetworkIdArray[i]); - } - } - - array1.push("&networkIds=" + array2.join(",")); - } - else if (step5ContainerType == 'select-security-group') { - var checkedSecurityGroupIdArray; - if(typeof(args.data["security-groups"]) == "object" && args.data["security-groups"].length != null) { //args.data["security-groups"] is an array of string, e.g. ["2375f8cc-8a73-4b8d-9b26-50885a25ffe0", "27c60d2a-de7f-4bb7-96e5-a602cec681df","c6301d77-99b5-4e8a-85e2-3ea2ab31c342"], - checkedSecurityGroupIdArray = args.data["security-groups"]; - } - else if(typeof(args.data["security-groups"]) == "string" && args.data["security-groups"].length > 0) { //args.data["security-groups"] is a string, e.g. "2375f8cc-8a73-4b8d-9b26-50885a25ffe0" - checkedSecurityGroupIdArray = []; - checkedSecurityGroupIdArray.push(args.data["security-groups"]); - } - else { // typeof(args.data["security-groups"]) == null - checkedSecurityGroupIdArray = []; - } - - if(checkedSecurityGroupIdArray.length > 0) - array1.push("&securitygroupids=" + checkedSecurityGroupIdArray.join(",")); - } - - var displayname = args.data.displayname; - if(displayname != null && displayname.length > 0) { - array1.push("&displayname="+todb(displayname)); - array1.push("&name="+todb(displayname)); - } - - var group = args.data.groupname; - if (group != null && group.length > 0) - array1.push("&group="+todb(group)); - - //array1.push("&startVm=false"); //for testing only, comment it out before checking in - - $.ajax({ - url: createURL("deployVirtualMachine"+array1.join("")), - dataType: "json", - success: function(json) { - var jid = json.deployvirtualmachineresponse.jobid; - var vmid = json.deployvirtualmachineresponse.id; - args.response.success( - {_custom: - {jobId: jid, - getUpdatedItem: function(json) { - var item = json.queryasyncjobresultresponse.jobresult.virtualmachine; - if (item.password != null) - alert("Password of new VM " + item.displayname + " is " + item.password); - return item; - }, - getActionFilter: function() { - return vmActionfilter; - }, - getUpdatedItemWhenAsyncJobFails: function() { - var item; - $.ajax({ - url: createURL("listVirtualMachines&id="+vmid), - dataType: "json", - async: false, - success: function(json) { - item = json.listvirtualmachinesresponse.virtualmachine[0]; - } - }); - return item; - } - } - } - ); - }, - error: function(XMLHttpResponse) { - args.response.error(parseXMLHttpResponse(XMLHttpResponse)); //wait for Brian to implement - } - }); - } - }) + custom: cloudStack.uiCustom.instanceWizard(cloudStack.instanceWizard) }, messages: { diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 597186ee257..150ade27846 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -177,7 +177,7 @@ } }); - var sectionsToShow = ['networks']; + var sectionsToShow = ['networks', 'vpc']; if(havingSecurityGroupNetwork == true) sectionsToShow.push('securityGroups'); @@ -3105,6 +3105,91 @@ } } } + }, + vpc: { + type: 'select', + title: 'VPC', + id: 'vpc', + listView: { + id: 'vpc', + label: 'VPC', + fields: { + name: { label: 'Name' }, + zone: { label: 'Zone' }, + cidr: { label: 'CIDR' } + }, + dataProvider: function(args) { + args.response.success({ + data: [ + { + name: 'VPC 1', + zone: 'San Jose', + cidr: '0.0.0.0/0', + networkdomain: 'testdomain', + accountdomain: 'testdomain' + }, + { + name: 'VPC 2', + zone: 'San Jose', + cidr: '0.0.0.0/0', + networkdomain: 'testdomain', + accountdomain: 'testdomain' + }, + { + name: 'VPC 3', + zone: 'Cupertino', + cidr: '0.0.0.0/0', + networkdomain: 'testdomain', + accountdomain: 'testdomain' + }, + { + name: 'VPC 4', + zone: 'San Jose', + cidr: '0.0.0.0/0', + networkdomain: 'testdomain', + accountdomain: 'testdomain' + } + ] + }); + }, + actions: { + add: { + label: 'Add VPC', + createForm: { + title: 'Add new VPC', + fields: { + name: { label: 'Name', validation: { required: true } }, + zone: { + label: 'Zone', + validation: { required: true }, + select: function(args) { + args.response.success({ + data: [ + { id: 'zone1', description: 'Zone 1' }, + { id: 'zone2', description: 'Zone 2' }, + { id: 'zone3', description: 'Zone 3' } + ] + }); + } + } + } + }, + messages: { + notification: function(args) { return 'Add new VPC'; } + }, + action: function(args) { + args.response.success(); + }, + notification: { poll: function(args) { args.complete(); } } + }, + editVpc: { + label: 'Edit VPC', + action: { + custom: cloudStack.uiCustom.vpc(cloudStack.vpc) + } + } + } + } } } }; diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index 4c1d7911eb4..0dfcdf9d698 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -18,7 +18,7 @@ /** * Instance wizard */ - cloudStack.instanceWizard = function(args) { + cloudStack.uiCustom.instanceWizard = function(args) { return function(listViewArgs) { var context = listViewArgs.context; diff --git a/ui/scripts/ui-custom/vpc.js b/ui/scripts/ui-custom/vpc.js new file mode 100644 index 00000000000..3804386c656 --- /dev/null +++ b/ui/scripts/ui-custom/vpc.js @@ -0,0 +1,404 @@ +(function($, cloudStack) { + var elems = { + router: function() { + var $router = $('
  • ').addClass('tier virtual-router'); + var $title = $('').addClass('title').html('Virtual Router'); + + $router.append($title); + + // Append horizontal chart line + $router.append($('
    ').addClass('connect-line')); + + return $router; + }, + tier: function(args) { + var name = args.name; + var cidr = args.cidr; + var context = args.context; + var vmListView = args.vmListView; + var disabledActions = args.actionPreFilter ? args.actionPreFilter({ + context: context + }) : true; + var actions = $.map( + args.actions ? args.actions : {}, function(value, key) { + return { + id: key, + action: value, + isDisabled: $.isArray(disabledActions) && + $.inArray(key, disabledActions) != -1 + }; + } + ); + var isPlaceholder = args.isPlaceholder; + var virtualMachines = args.virtualMachines; + var $tier = $('
  • ').addClass('tier'); + var $title = $('').addClass('title'); + var $cidr = $('').addClass('cidr'); + var $vmCount = $('').addClass('vm-count'); + var $actions = $('
    ').addClass('actions'); + + // Ignore special actions + // -- Add tier action is handled separately + actions = $.grep(actions, function(action) { + return action.id != 'add'; + }); + + // VM count shows instance list + $vmCount.click(function() { + var $dialog = $('
    '); + var $listView = $('
    ').listView($.extend(true, {}, vmListView, { + context: context + })); + + $dialog.append($listView); + $dialog.dialog({ + title: 'VMs in this tier', + dialogClass: 'multi-edit-add-list panel configure-acl', + width: 825, + height: 600, + buttons: { + 'Done': function() { + $(':ui-dialog').remove(); + $('.overlay').remove(); + } + } + }).closest('.ui-dialog').overlay(); + }); + + if (isPlaceholder) { + $tier.addClass('placeholder'); + $title.html('Create Tier'); + } else { + $title.html(name); + $cidr.html(cidr); + $vmCount.append( + $('').addClass('total').html(virtualMachines.length), + ' VMs' + ); + $tier.append($actions); + + // Build action buttons + $(actions).map(function(index, action) { + var $action = $('
    ').addClass('action'); + var shortLabel = action.action.shortLabel; + var label = action.action.label; + var isDisabled = action.isDisabled; + + $action.addClass(action.id); + + if (action.id != 'remove') { + $action.append($('').addClass('label').html(shortLabel)); + } else { + $action.append($('').addClass('icon').html(' ')); + } + $actions.append($action); + $action.attr('title', label); + + if (isDisabled) $action.addClass('disabled'); + + // Action event + $action.click(function() { + if (isDisabled) { + return false; + } + + tierAction({ + action: action, + context: context, + $tier: $tier + }); + + return true; + }); + }); + } + + $tier.prepend($title); + + if (!isPlaceholder) { + $tier.append($title, $cidr, $vmCount); + } + + // Append horizontal chart line + $tier.append($('
    ').addClass('connect-line')); + + return $tier; + }, + chart: function(args) { + var tiers = args.tiers; + var vmListView = args.vmListView; + var actions = args.actions; + var actionPreFilter = args.actionPreFilter; + var vpcName = args.vpcName; + var context = args.context; + var $tiers = $('
      ').addClass('tiers'); + var $router = elems.router(); + var $chart = $('
      ').addClass('vpc-chart'); + var $title = $('
      ').addClass('vpc-title').html(vpcName); + + var showAddTierDialog = function() { + if ($(this).find('.loading-overlay').size()) { + return false; + } + + addTierDialog({ + $tiers: $tiers, + context: context, + actions: actions, + vmListView: vmListView, + actionPreFilter: actionPreFilter + }); + + return true; + }; + + if (tiers.length) { + $(tiers).map(function(index, tier) { + var $tier = elems.tier({ + name: tier.name, + cidr: tier.cidr, + virtualMachines: tier.virtualMachines, + vmListView: vmListView, + actions: actions, + actionPreFilter: actionPreFilter, + context: $.extend(true, {}, context, { + tiers: [tier] + }) + }); + + $tier.appendTo($tiers); + }); + + } + + elems.tier({ isPlaceholder: true }).appendTo($tiers) + .click(showAddTierDialog); + $tiers.prepend($router); + $chart.append($title, $tiers); + + if (!tiers || !tiers.length) { + showAddTierDialog(); + } + + return $chart; + } + }; + + // Handles tier action, including UI effects + var tierAction = function(args) { + var $tier = args.$tier; + var $loading = $('
      ').addClass('loading-overlay'); + var actionArgs = args.action.action; + var action = actionArgs.action; + var actionID = args.action.id; + var notification = actionArgs.notification; + var label = actionArgs.label; + var context = args.context; + + var success = function(args) { + var remove = args ? args.remove : false; + + cloudStack.ui.notifications.add( + // Notification + { + desc: label, + poll: notification.poll + }, + + // Success + function(args) { + if (remove) { + $tier.remove(); + } else { + $loading.remove(); + } + + if (actionID == 'addVM') { + // Increment VM total + var $total = $tier.find('.vm-count .total'); + var prevTotal = parseInt($total.html()); + var newTotal = prevTotal + 1; + + $total.html(newTotal); + } + }, + + {}, + + // Error + function(args) { + $loading.remove(); + } + ); + }; + + switch(actionID) { + case 'addVM': + action({ + context: context, + complete: function(args) { + $loading.appendTo($tier); + success(args); + } + }); + break; + case 'remove': + $loading.appendTo($tier); + action({ + context: context, + response: { + success: function(args) { + success({ remove: true }); + } + } + }); + break; + case 'acl': + // Show ACL dialog + $('
      ').multiEdit( + $.extend(true, {}, actionArgs.multiEdit, { + context: context + }) + ).dialog({ + title: 'Configure ACL', + dialogClass: 'configure-acl', + width: 820, + height: 600, + buttons: { + 'Done': function() { + $(':ui-dialog').remove(); + $('.overlay').remove(); + } + } + }).closest('.ui-dialog').overlay(); + break; + default: + $loading.appendTo($tier); + action({ + context: context, + complete: success, + response: { + success: success, + error: function(args) { $loading.remove(); } + } + }); + } + }; + + // Appends a new tier to chart + var addNewTier = function(args) { + var actions = args.actions; + var vmListView = args.vmListView; + var actionPreFilter = args.actionPreFilter; + var tier = $.extend(args.tier, { + vmListView: vmListView, + actions: actions, + actionPreFilter: actionPreFilter, + virtualMachines: [] + }); + var $tiers = args.$tiers; + + $tiers.find('li.placeholder') + .before( + elems.tier(tier) + .hide() + .fadeIn('slow') + ); + }; + + // Renders the add tier form, in a dialog + var addTierDialog = function(args) { + var actions = args.actions; + var context = args.context; + var vmListView = args.vmListView; + var actionPreFilter = args.actionPreFilter; + var $tiers = args.$tiers; + + cloudStack.dialog.createForm({ + form: actions.add.createForm, + after: function(args) { + var $loading = $('
      ').addClass('loading-overlay').prependTo($tiers.find('li.placeholder')); + actions.add.action({ + context: context, + data: args.data, + response: { + success: function(args) { + var tier = args.data; + + cloudStack.ui.notifications.add( + // Notification + { + desc: actions.add.label, + poll: actions.add.notification.poll + }, + + // Success + function(args) { + $loading.remove(); + addNewTier({ + tier: tier, + $tiers: $tiers, + actions: actions, + actionPreFilter: actionPreFilter, + vmListView: vmListView + }); + }, + + {}, + + // Error + function(args) { + $loading.remove(); + } + ); + } + } + }); + } + }); + }; + + cloudStack.uiCustom.vpc = function(args) { + var vmListView = args.vmListView; + var tierArgs = args.tiers; + + return function(args) { + var context = args.context; + var $browser = $('#browser .container'); + var $toolbar = $('
      ').addClass('toolbar'); + var vpc = args.context.vpc[0]; + + $browser.cloudBrowser('addPanel', { + maximizeIfSelected: true, + title: 'Configure VPC: ' + vpc.name, + complete: function($panel) { + var $loading = $('
      ').addClass('loading-overlay').appendTo($panel); + + $panel.append($toolbar); + + // Load data + tierArgs.dataProvider({ + context: context, + response: { + success: function(args) { + var tiers = args.data.tiers; + var $chart = elems.chart({ + vmListView: vmListView, + context: context, + actions: tierArgs.actions, + actionPreFilter: tierArgs.actionPreFilter, + vpcName: vpc.name, + tiers: tiers + }).appendTo($panel); + + $loading.remove(); + $chart.fadeIn(function() { + }); + } + } + }); + } + }); + }; + }; +}(jQuery, cloudStack)); \ No newline at end of file diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js new file mode 100644 index 00000000000..a3b9afb99f3 --- /dev/null +++ b/ui/scripts/vpc.js @@ -0,0 +1,469 @@ +(function($, cloudStack) { + var aclMultiEdit = { + noSelect: true, + fields: { + 'cidrlist': { edit: true, label: 'Source CIDR' }, + 'protocol': { + label: 'Protocol', + select: function(args) { + args.$select.change(function() { + var $inputs = args.$form.find('input'); + var $icmpFields = $inputs.filter(function() { + var name = $(this).attr('name'); + + return $.inArray(name, [ + 'icmptype', + 'icmpcode' + ]) > -1; + }); + var $otherFields = $inputs.filter(function() { + var name = $(this).attr('name'); + + return name != 'icmptype' && name != 'icmpcode' && name != 'cidrlist'; + }); + + if ($(this).val() == 'icmp') { + $icmpFields.attr('disabled', false); + $otherFields.attr('disabled', 'disabled'); + } else { + $otherFields.attr('disabled', false); + $icmpFields.attr('disabled', 'disabled'); + } + }); + + args.response.success({ + data: [ + { name: 'tcp', description: 'TCP' }, + { name: 'udp', description: 'UDP' }, + { name: 'icmp', description: 'ICMP' } + ] + }); + } + }, + 'startport': { edit: true, label: 'Start Port' }, + 'endport': { edit: true, label: 'End Port' }, + 'icmptype': { edit: true, label: 'ICMP Type', isDisabled: true }, + 'icmpcode': { edit: true, label: 'ICMP Code', isDisabled: true }, + 'add-rule': { + label: 'Add', + addButton: true + } + }, + add: { + label: 'Add', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Add ACL rule', + poll: function(args) { args.complete(); } + } + }); + }, 500); + } + }, + actions: { + destroy: { + label: 'Remove Rule', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Remove ACL rule', + poll: function(args) { args.complete(); } + } + }); + }, 500); + } + } + }, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: [ + { + "id": 11, + "protocol": "icmp", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/0", + "icmptype": 2, + "icmpcode": 22 + }, + { + "id": 10, + "protocol": "udp", + "startport": "500", + "endport": "10000", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 9, + "protocol": "tcp", + "startport": "20", + "endport": "200", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 11, + "protocol": "icmp", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/0", + "icmptype": 2, + "icmpcode": 22 + }, + { + "id": 10, + "protocol": "udp", + "startport": "500", + "endport": "10000", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 9, + "protocol": "tcp", + "startport": "20", + "endport": "200", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 11, + "protocol": "icmp", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/0", + "icmptype": 2, + "icmpcode": 22 + }, + { + "id": 10, + "protocol": "udp", + "startport": "500", + "endport": "10000", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 9, + "protocol": "tcp", + "startport": "20", + "endport": "200", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 11, + "protocol": "icmp", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/0", + "icmptype": 2, + "icmpcode": 22 + }, + { + "id": 10, + "protocol": "udp", + "startport": "500", + "endport": "10000", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 9, + "protocol": "tcp", + "startport": "20", + "endport": "200", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 11, + "protocol": "icmp", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/0", + "icmptype": 2, + "icmpcode": 22 + }, + { + "id": 10, + "protocol": "udp", + "startport": "500", + "endport": "10000", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 9, + "protocol": "tcp", + "startport": "20", + "endport": "200", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + } + ] + }); + }, 100); + } + }; + + cloudStack.vpc = { + vmListView: { + id: 'vpcTierInstances', + listView: { + filters: { + mine: { label: 'My instances' }, + all: { label: 'All instances' }, + running: { label: 'Running instances' }, + destroyed: { label: 'Destroyed instances' } + }, + fields: { + name: { label: 'Name', editable: true }, + account: { label: 'Account' }, + zonename: { label: 'Zone' }, + state: { + label: 'Status', + indicator: { + 'Running': 'on', + 'Stopped': 'off', + 'Destroyed': 'off' + } + } + }, + + // List view actions + actions: { + restart: { + label: 'Restart instance', + action: function(args) { + setTimeout(function() { + args.response.success({ + data: { + state: 'Restarting' + } + }); + }, 1000); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to restart ' + args.name + '?'; + }, + notification: function(args) { + return 'Rebooting VM: ' + args.name; + } + }, + notification: { + poll: function(args) { args.complete(); } + } + }, + stop: { + label: 'Stop instance', + action: function(args) { + setTimeout(function() { + args.response.success({ + data: { state: 'Stopping' } + }); + }, 500); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to shutdown ' + args.name + '?'; + }, + notification: function(args) { + return 'Rebooting VM: ' + args.name; + } + }, + notification: { + poll: function(args) { args.complete(); } + } + }, + start: { + label: 'Start instance', + action: function(args) { + setTimeout(function() { + args.response.success({ + data: { state: 'Starting' } + }); + }, 500); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to start ' + args.name + '?'; + }, + notification: function(args) { + return 'Starting VM: ' + args.name; + } + }, + notification: { + poll: function(args) { args.complete(); } + } + }, + destroy: { + label: 'Destroy instance', + messages: { + confirm: function(args) { + return 'Are you sure you want to destroy ' + args.name + '?'; + }, + notification: function(args) { + return 'Destroyed VM: ' + args.name; + } + }, + action: function(args) { + setTimeout(function() { + args.response.success({ data: { state: 'Destroying' }}); + }, 200); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL('listVirtualMachines'), + success: function(json) { + args.response.success({ data: json.listvirtualmachinesresponse.virtualmachine }); + } + }); + } + } + }, + tiers: { + actionPreFilter: function(args) { + return ['start']; + }, + actions: { + // Add new tier + add: { + label: 'Add new tier to VPC', + action: function(args) { + setTimeout(function() { + args.response.success({ + data: { + name: args.data.name, + cidr: args.data.cidr + } + }); + }, 500); + }, + + createForm: { + title: 'Add new tier', + desc: 'Please fill in the following to add a new VPC tier.', + fields: { + name: { label: 'label.name', validation: { required: true } }, + cidr: { label: 'label.cidr', validation: { required: true } } + } + }, + + notification: { + poll: function(args) { args.complete(); } + } + }, + start: { + label: 'Start tier', + shortLabel: 'Start', + action: function(args) { + args.response.success(); + }, + notification: { + poll: function(args) { args.complete(); } + } + }, + stop: { + label: 'Stop tier', + shortLabel: 'Stop', + action: function(args) { + args.response.success(); + }, + notification: { + poll: function(args) { args.complete(); } + } + }, + addVM: { + label: 'Add VM to tier', + shortLabel: 'Add VM', + action: cloudStack.uiCustom.instanceWizard( + cloudStack.instanceWizard + ), + notification: { + poll: function(args) { args.complete(); } + } + }, + acl: { + label: 'Configure ACL for tier', + shortLabel: 'ACL', + multiEdit: aclMultiEdit + }, + remove: { + label: 'Remove tier', + action: function(args) { + args.response.success(); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + }, + + // Get tiers + dataProvider: function(args) { + var tiers = [ // Dummy content + { + id: 1, + name: 'web', + cidr: '192.168.0.0/24', + virtualMachines: [ + { name: 'i-2-VM' }, + { name: 'i-3-VM' } + ] + }, + { + id: 2, + name: 'app', + cidr: '10.0.0.0/24', + virtualMachines: [] + } + ]; + + setTimeout(function() { + args.response.success({ + data: { + tiers: tiers + } + }); + }, 1000); + } + } + }; +}(jQuery, cloudStack)); From 808a3d75d9881cd7e058e598c97185bd00f855f1 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 28 Jun 2012 11:12:26 -0700 Subject: [PATCH 28/37] Instance wizard: Don't try to add a new row if list view isn't present --- ui/scripts/ui-custom/instanceWizard.js | 33 +++++++++++++++----------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index 0dfcdf9d698..13719d45b45 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -44,27 +44,32 @@ args.action({ // Populate data + context: context, data: data, response: { success: function(args) { - var $loading = $('.list-view').listView('prependItem', { - data: [ - { - name: data.displayname ? data.displayname : _l('label.new.vm'), - zonename: $wizard.find('select[name=zoneid] option').filter(function() { - return $(this).val() == data.zoneid; - }).html(), - state: 'Creating' - } - ], - actionFilter: function(args) { return []; } - }); + var $listView = $('.list-view.instances'); + + if ($listView.size()) { + var $loading = $('.list-view.instances').listView('prependItem', { + data: [ + { + name: data.displayname ? data.displayname : _l('label.new.vm'), + zonename: $wizard.find('select[name=zoneid] option').filter(function() { + return $(this).val() == data.zoneid; + }).html(), + state: 'Creating' + } + ], + actionFilter: function(args) { return []; } + }); + } listViewArgs.complete({ _custom: args._custom, messageArgs: cloudStack.serializeForm($form), - $item: $loading - }); + $item: $listView.size()? $loading : $('
      ') + }); close(); }, From 2fe2a0e2fba8368e3236667c1fa019854f9d68c3 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 28 Jun 2012 12:29:18 -0700 Subject: [PATCH 29/37] Fix missing actionFilter causing instance wizard to never complete --- ui/scripts/instanceWizard.js | 2 +- ui/scripts/instances.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js index 8559477573d..a223bc53226 100644 --- a/ui/scripts/instanceWizard.js +++ b/ui/scripts/instanceWizard.js @@ -486,7 +486,7 @@ return; return item; }, getActionFilter: function() { - return vmActionfilter; + return cloudStack.actionFilter.vmActionFilter; }, getUpdatedItemWhenAsyncJobFails: function() { var item; diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index 5e9b3f3bb32..15c8efc563d 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -1255,7 +1255,7 @@ } }; - var vmActionfilter = function(args) { + var vmActionfilter = cloudStack.actionFilter.vmActionFilter = function(args) { var jsonObj = args.context.item; var allowedActions = []; From 80e2a6faa01c25b8dc08ddd7b157287b34057ceb Mon Sep 17 00:00:00 2001 From: Edison Su Date: Thu, 28 Jun 2012 13:28:38 -0700 Subject: [PATCH 30/37] add ASF license --- .../vm/hypervisor/xenserver/xcposs/NFSSR.py | 28 +++++++++++-------- .../xcposs/copy_vhd_from_secondarystorage.sh | 26 +++++++++-------- .../xcposs/copy_vhd_to_secondarystorage.sh | 26 +++++++++-------- .../create_privatetemplate_from_snapshot.sh | 26 +++++++++-------- scripts/vm/hypervisor/xenserver/xcposs/patch | 17 +++++++++++ scripts/vm/hypervisor/xenserver/xcposs/vmops | 19 ++++++++++++- .../hypervisor/xenserver/xcposs/vmopsSnapshot | 17 +++++++++++ .../hypervisor/xenserver/xcposs/vmopspremium | 17 +++++++++++ 8 files changed, 130 insertions(+), 46 deletions(-) diff --git a/scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py b/scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py index f18a12e73e5..7342aaf863e 100644 --- a/scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py +++ b/scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py @@ -1,18 +1,22 @@ #!/usr/bin/python -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 -# FileSR: local-file storage repository +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# FileSR: local-file storage repository import SR, VDI, SRCommand, FileSR, util import errno import os, re, sys, stat diff --git a/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_from_secondarystorage.sh b/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_from_secondarystorage.sh index 074b8420a84..a4e977bdd59 100644 --- a/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_from_secondarystorage.sh +++ b/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_from_secondarystorage.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. #set -x diff --git a/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_to_secondarystorage.sh b/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_to_secondarystorage.sh index e972db60c49..b315c07b356 100644 --- a/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_to_secondarystorage.sh +++ b/scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_to_secondarystorage.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. #set -x diff --git a/scripts/vm/hypervisor/xenserver/xcposs/create_privatetemplate_from_snapshot.sh b/scripts/vm/hypervisor/xenserver/xcposs/create_privatetemplate_from_snapshot.sh index c9c9b909d7d..4213efcc43e 100644 --- a/scripts/vm/hypervisor/xenserver/xcposs/create_privatetemplate_from_snapshot.sh +++ b/scripts/vm/hypervisor/xenserver/xcposs/create_privatetemplate_from_snapshot.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by the License. -# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at # -# Automatically generated by addcopyright.py at 04/03/2012 +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. #set -x diff --git a/scripts/vm/hypervisor/xenserver/xcposs/patch b/scripts/vm/hypervisor/xenserver/xcposs/patch index 8ddccc7577b..2ab94219498 100644 --- a/scripts/vm/hypervisor/xenserver/xcposs/patch +++ b/scripts/vm/hypervisor/xenserver/xcposs/patch @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + # This file specifies the files that need # to be transferred over to the XenServer. # The format of this file is as follows: diff --git a/scripts/vm/hypervisor/xenserver/xcposs/vmops b/scripts/vm/hypervisor/xenserver/xcposs/vmops index e4a2fdcd43f..3ea127e88ba 100644 --- a/scripts/vm/hypervisor/xenserver/xcposs/vmops +++ b/scripts/vm/hypervisor/xenserver/xcposs/vmops @@ -1,5 +1,22 @@ #!/usr/bin/python -# Version 2.2.8.2012-02-28T23:50:03Z +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Version @VERSION@ # # A plugin for executing script needed by vmops cloud diff --git a/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot b/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot index 15ea62f2106..f7b2e0e6d7b 100644 --- a/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot +++ b/scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot @@ -1,4 +1,21 @@ #!/usr/bin/python +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + # Version @VERSION@ # # A plugin for executing script needed by vmops cloud diff --git a/scripts/vm/hypervisor/xenserver/xcposs/vmopspremium b/scripts/vm/hypervisor/xenserver/xcposs/vmopspremium index ce6cdbc9e33..9066ee0e2f8 100644 --- a/scripts/vm/hypervisor/xenserver/xcposs/vmopspremium +++ b/scripts/vm/hypervisor/xenserver/xcposs/vmopspremium @@ -1,4 +1,21 @@ #!/usr/bin/python +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + # Version @VERSION@ # # A plugin for executing script needed by vmops cloud From dfb6670fe8d7bea81083159d6a697ce640075eaf Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 28 Jun 2012 13:33:22 -0700 Subject: [PATCH 31/37] CS-15211: More noticable 'Back' button on quick install Original patch by: Pranav Saxena reviewed-by: Brian Federle --- ui/css/cloudstack3.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 7fbc3668733..9d1c75e48e7 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -561,7 +561,7 @@ div.list-view div.toolbar div.section-switcher div.section-select label { .install-wizard .button.advanced-installation, .install-wizard .button.go-back { background: #E0DEDE; - color: #7D7D7D; + color: #3B3B3B; border: 1px solid #C7C2C2; /*+text-shadow:0px 0px #FFFFFF;*/ -moz-text-shadow: 0px 0px #FFFFFF; From 6d78cc4000bd6d4d92cfb1e8cbffe315f6be0491 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 28 Jun 2012 13:40:19 -0700 Subject: [PATCH 32/37] Add Apache license to new JS files --- ui/scripts/instanceWizard.js | 16 ++++++++++++++++ ui/scripts/ui-custom/vpc.js | 18 +++++++++++++++++- ui/scripts/vpc.js | 16 ++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js index a223bc53226..3cf669423b6 100644 --- a/ui/scripts/instanceWizard.js +++ b/ui/scripts/instanceWizard.js @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { var zoneObjs, hypervisorObjs, featuredTemplateObjs, communityTemplateObjs, myTemplateObjs, featuredIsoObjs, community var selectedZoneObj, selectedTemplateObj, selectedHypervisor, selectedDiskOfferingObj; diff --git a/ui/scripts/ui-custom/vpc.js b/ui/scripts/ui-custom/vpc.js index 3804386c656..6b27a4fbca5 100644 --- a/ui/scripts/ui-custom/vpc.js +++ b/ui/scripts/ui-custom/vpc.js @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { var elems = { router: function() { @@ -401,4 +417,4 @@ }); }; }; -}(jQuery, cloudStack)); \ No newline at end of file +}(jQuery, cloudStack)); diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index a3b9afb99f3..be561a56d5a 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. (function($, cloudStack) { var aclMultiEdit = { noSelect: true, From 9bbbc4e356a8bb24034d99e4f167984c49930107 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 28 Jun 2012 14:20:17 -0700 Subject: [PATCH 33/37] Pass _custom correctly to VPC tier add VM action --- ui/scripts/ui-custom/vpc.js | 4 +++- ui/scripts/vpc.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/scripts/ui-custom/vpc.js b/ui/scripts/ui-custom/vpc.js index 6b27a4fbca5..0ba70e5aad4 100644 --- a/ui/scripts/ui-custom/vpc.js +++ b/ui/scripts/ui-custom/vpc.js @@ -213,12 +213,14 @@ var success = function(args) { var remove = args ? args.remove : false; + var _custom = args ? args._custom : {}; cloudStack.ui.notifications.add( // Notification { desc: label, - poll: notification.poll + poll: notification.poll, + _custom: _custom }, // Success diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index be561a56d5a..94e6dcbf5dd 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -433,7 +433,7 @@ cloudStack.instanceWizard ), notification: { - poll: function(args) { args.complete(); } + poll: pollAsyncJobResult } }, acl: { From 28e49e88804865f56d6d9d1a1b8767f77b8676e8 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 28 Jun 2012 14:50:13 -0700 Subject: [PATCH 34/37] VPC UI: Refactor tier action filter handling For reusability, move action filter handling for VPC tier actions to a separate function. This allows for easier refreshing of actions after a tier's state has changed. --- ui/scripts/ui-custom/vpc.js | 45 ++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/ui/scripts/ui-custom/vpc.js b/ui/scripts/ui-custom/vpc.js index 0ba70e5aad4..6db1f619dc4 100644 --- a/ui/scripts/ui-custom/vpc.js +++ b/ui/scripts/ui-custom/vpc.js @@ -32,16 +32,12 @@ var cidr = args.cidr; var context = args.context; var vmListView = args.vmListView; - var disabledActions = args.actionPreFilter ? args.actionPreFilter({ - context: context - }) : true; + var actionPreFilter = args.actionPreFilter; var actions = $.map( args.actions ? args.actions : {}, function(value, key) { return { id: key, - action: value, - isDisabled: $.isArray(disabledActions) && - $.inArray(key, disabledActions) != -1 + action: value }; } ); @@ -98,7 +94,6 @@ var $action = $('
      ').addClass('action'); var shortLabel = action.action.shortLabel; var label = action.action.label; - var isDisabled = action.isDisabled; $action.addClass(action.id); @@ -107,14 +102,14 @@ } else { $action.append($('').addClass('icon').html(' ')); } + $actions.append($action); $action.attr('title', label); - - if (isDisabled) $action.addClass('disabled'); + $action.data('vpc-tier-action-id', action.id); // Action event $action.click(function() { - if (isDisabled) { + if ($action.hasClass('disabled')) { return false; } @@ -138,6 +133,13 @@ // Append horizontal chart line $tier.append($('
      ').addClass('connect-line')); + // Handle action filter + filterActions({ + $actions: $actions, + actionPreFilter: actionPreFilter, + context: context + }); + return $tier; }, chart: function(args) { @@ -200,6 +202,29 @@ } }; + var filterActions = function(args) { + var $actions = args.$actions; + var actionPreFilter = args.actionPreFilter; + var context = args.context; + var disabledActions, allowedActions; + + disabledActions = actionPreFilter ? actionPreFilter({ + context: context + }) : []; + + // Visual appearance for disabled actions + $actions.find('.action').map(function(index, action) { + var $action = $(action); + var actionID = $action.data('vpc-tier-action-id'); + + if ($.inArray(actionID, disabledActions) > -1) { + $action.addClass('disabled'); + } else { + $action.removeClass('disabled'); + } + }); + }; + // Handles tier action, including UI effects var tierAction = function(args) { var $tier = args.$tier; From b1a5ec13cd3705272926b8d12fd000b09ede9886 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 28 Jun 2012 15:19:06 -0700 Subject: [PATCH 35/37] VPC tier UI: Update state after performing actions After performing an action that changes state, namely starting and stopping a tier, run through the action pre-filter again, to make sure that the allowable actions are properly refreshed. Conflicts: ui/scripts/ui-custom/vpc.js --- ui/scripts/ui-custom/vpc.js | 27 ++++++++++++++++++++++----- ui/scripts/vpc.js | 11 ++++++++--- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/ui/scripts/ui-custom/vpc.js b/ui/scripts/ui-custom/vpc.js index 6db1f619dc4..c728becf399 100644 --- a/ui/scripts/ui-custom/vpc.js +++ b/ui/scripts/ui-custom/vpc.js @@ -112,11 +112,13 @@ if ($action.hasClass('disabled')) { return false; } - + tierAction({ action: action, + actionPreFilter: actionPreFilter, context: context, - $tier: $tier + $tier: $tier, + $actions: $actions }); return true; @@ -158,7 +160,7 @@ if ($(this).find('.loading-overlay').size()) { return false; } - + addTierDialog({ $tiers: $tiers, context: context, @@ -210,7 +212,7 @@ disabledActions = actionPreFilter ? actionPreFilter({ context: context - }) : []; + }) : []; // Visual appearance for disabled actions $actions.find('.action').map(function(index, action) { @@ -229,12 +231,14 @@ var tierAction = function(args) { var $tier = args.$tier; var $loading = $('
      ').addClass('loading-overlay'); + var $actions = args.$actions; var actionArgs = args.action.action; var action = actionArgs.action; var actionID = args.action.id; var notification = actionArgs.notification; var label = actionArgs.label; var context = args.context; + var actionPreFilter = args.actionPreFilter; var success = function(args) { var remove = args ? args.remove : false; @@ -250,6 +254,13 @@ // Success function(args) { + var newData = args.data ? args.data : {}; + var newTier = $.extend(true, {}, context.tiers[0], newData); + var newContext = $.extend(true, {}, context); + + // Update data + newContext.tiers = [newTier]; + if (remove) { $tier.remove(); } else { @@ -264,6 +275,12 @@ $total.html(newTotal); } + + filterActions({ + $actions: $actions, + actionPreFilter: actionPreFilter, + context: newContext + }); }, {}, @@ -367,7 +384,7 @@ response: { success: function(args) { var tier = args.data; - + cloudStack.ui.notifications.add( // Notification { diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index 94e6dcbf5dd..e4f13df2d85 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -376,7 +376,10 @@ }, tiers: { actionPreFilter: function(args) { - return ['start']; + var tier = args.context.tiers[0]; + var state = tier.state; + + return state == 'Running' ? ['start'] : ['stop']; }, actions: { // Add new tier @@ -413,7 +416,7 @@ args.response.success(); }, notification: { - poll: function(args) { args.complete(); } + poll: function(args) { args.complete({ data: { state: 'Running' } }); } } }, stop: { @@ -423,7 +426,7 @@ args.response.success(); }, notification: { - poll: function(args) { args.complete(); } + poll: function(args) { args.complete({ data: { state: 'Stopped' } }); } } }, addVM: { @@ -459,6 +462,7 @@ id: 1, name: 'web', cidr: '192.168.0.0/24', + state: 'Running', virtualMachines: [ { name: 'i-2-VM' }, { name: 'i-3-VM' } @@ -467,6 +471,7 @@ { id: 2, name: 'app', + state: 'Stopped', cidr: '10.0.0.0/24', virtualMachines: [] } From 4c6738266d941696bccff6be3ef086a03dc94c81 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 28 Jun 2012 15:32:18 -0700 Subject: [PATCH 36/37] Fix add tier UI Properly pass context for add tier dialog, which broke due to recent changes that requires context to be present, for the action filter. --- ui/scripts/ui-custom/vpc.js | 5 +++++ ui/scripts/vpc.js | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/scripts/ui-custom/vpc.js b/ui/scripts/ui-custom/vpc.js index c728becf399..4e601387e3d 100644 --- a/ui/scripts/ui-custom/vpc.js +++ b/ui/scripts/ui-custom/vpc.js @@ -350,7 +350,9 @@ var actions = args.actions; var vmListView = args.vmListView; var actionPreFilter = args.actionPreFilter; + var context = args.context; var tier = $.extend(args.tier, { + context: context, vmListView: vmListView, actions: actions, actionPreFilter: actionPreFilter, @@ -396,6 +398,9 @@ function(args) { $loading.remove(); addNewTier({ + context: $.extend(true, {}, context, { + tiers: [tier] + }), tier: tier, $tiers: $tiers, actions: actions, diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index e4f13df2d85..768894633bf 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -390,7 +390,8 @@ args.response.success({ data: { name: args.data.name, - cidr: args.data.cidr + cidr: args.data.cidr, + state: 'Stopped' } }); }, 500); @@ -480,7 +481,7 @@ setTimeout(function() { args.response.success({ data: { - tiers: tiers + tiers: [] } }); }, 1000); From c41094154d8956b2c4b134a4807f0972d545e170 Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Thu, 28 Jun 2012 17:23:41 -0700 Subject: [PATCH 37/37] moving out OVS code to plugins/network-elements/ovs --- build/build-cloud-plugins.xml | 11 +- client/tomcatconf/components.xml.in | 3 + plugins/network-elements/ovs/.classpath | 11 ++ plugins/network-elements/ovs/.project | 17 +++ plugins/network-elements/ovs/build.xml | 129 ++++++++++++++++++ .../com/cloud/network/element/OvsElement.java | 0 .../network/guru/OvsGuestNetworkGuru.java | 0 .../cloud/network/ovs/GreTunnelException.java | 0 .../network/ovs/OvsCreateGreTunnelAnswer.java | 0 .../ovs/OvsCreateGreTunnelCommand.java | 0 .../network/ovs/OvsCreateTunnelAnswer.java | 0 .../network/ovs/OvsCreateTunnelCommand.java | 0 .../network/ovs/OvsDeleteFlowCommand.java | 0 .../network/ovs/OvsDestroyBridgeCommand.java | 0 .../network/ovs/OvsDestroyTunnelCommand.java | 0 .../network/ovs/OvsFetchInterfaceAnswer.java | 0 .../network/ovs/OvsFetchInterfaceCommand.java | 0 .../network/ovs/OvsSetTagAndFlowAnswer.java | 0 .../network/ovs/OvsSetTagAndFlowCommand.java | 0 .../network/ovs/OvsSetupBridgeCommand.java | 0 .../cloud/network/ovs/OvsTunnelManager.java | 0 .../network/ovs/OvsTunnelManagerImpl.java | 0 .../ovs/dao/OvsTunnelInterfaceDao.java | 0 .../ovs/dao/OvsTunnelInterfaceDaoImpl.java | 0 .../network/ovs/dao/OvsTunnelInterfaceVO.java | 0 .../network/ovs/dao/OvsTunnelNetworkDao.java | 0 .../ovs/dao/OvsTunnelNetworkDaoImpl.java | 0 .../network/ovs/dao/OvsTunnelNetworkVO.java | 0 .../DefaultComponentLibrary.java | 6 - .../guru/ExternalGuestNetworkGuru.java | 21 +-- 30 files changed, 180 insertions(+), 18 deletions(-) create mode 100644 plugins/network-elements/ovs/.classpath create mode 100644 plugins/network-elements/ovs/.project create mode 100755 plugins/network-elements/ovs/build.xml rename {server => plugins/network-elements/ovs}/src/com/cloud/network/element/OvsElement.java (100%) rename {server => plugins/network-elements/ovs}/src/com/cloud/network/guru/OvsGuestNetworkGuru.java (100%) rename {server => plugins/network-elements/ovs}/src/com/cloud/network/ovs/GreTunnelException.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java (100%) rename {api => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java (100%) rename {server => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsTunnelManager.java (100%) rename {server => plugins/network-elements/ovs}/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java (100%) rename {server => plugins/network-elements/ovs}/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDao.java (100%) rename {server => plugins/network-elements/ovs}/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java (100%) rename {server => plugins/network-elements/ovs}/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceVO.java (100%) rename {server => plugins/network-elements/ovs}/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDao.java (100%) rename {server => plugins/network-elements/ovs}/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDaoImpl.java (100%) rename {server => plugins/network-elements/ovs}/src/com/cloud/network/ovs/dao/OvsTunnelNetworkVO.java (100%) diff --git a/build/build-cloud-plugins.xml b/build/build-cloud-plugins.xml index 53dc1d34d85..a464de99661 100755 --- a/build/build-cloud-plugins.xml +++ b/build/build-cloud-plugins.xml @@ -207,7 +207,7 @@ - + @@ -279,8 +279,8 @@ - - + + @@ -297,4 +297,9 @@ + + + + + diff --git a/client/tomcatconf/components.xml.in b/client/tomcatconf/components.xml.in index 5add24cfd55..be3218e0ae4 100755 --- a/client/tomcatconf/components.xml.in +++ b/client/tomcatconf/components.xml.in @@ -158,6 +158,7 @@ + @@ -165,6 +166,8 @@ + + diff --git a/plugins/network-elements/ovs/.classpath b/plugins/network-elements/ovs/.classpath new file mode 100644 index 00000000000..a3f5d12a4c8 --- /dev/null +++ b/plugins/network-elements/ovs/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/plugins/network-elements/ovs/.project b/plugins/network-elements/ovs/.project new file mode 100644 index 00000000000..0423b307112 --- /dev/null +++ b/plugins/network-elements/ovs/.project @@ -0,0 +1,17 @@ + + + ovs + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugins/network-elements/ovs/build.xml b/plugins/network-elements/ovs/build.xml new file mode 100755 index 00000000000..718720b7736 --- /dev/null +++ b/plugins/network-elements/ovs/build.xml @@ -0,0 +1,129 @@ + + + + + + + Cloud Stack ant build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/network/element/OvsElement.java b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java similarity index 100% rename from server/src/com/cloud/network/element/OvsElement.java rename to plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java diff --git a/server/src/com/cloud/network/guru/OvsGuestNetworkGuru.java b/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java similarity index 100% rename from server/src/com/cloud/network/guru/OvsGuestNetworkGuru.java rename to plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java diff --git a/server/src/com/cloud/network/ovs/GreTunnelException.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/GreTunnelException.java similarity index 100% rename from server/src/com/cloud/network/ovs/GreTunnelException.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/GreTunnelException.java diff --git a/api/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelAnswer.java diff --git a/api/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateGreTunnelCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelAnswer.java diff --git a/api/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsCreateTunnelCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDeleteFlowCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyBridgeCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsDestroyTunnelCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceAnswer.java diff --git a/api/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsFetchInterfaceCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowAnswer.java diff --git a/api/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetTagAndFlowCommand.java diff --git a/api/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java similarity index 100% rename from api/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsSetupBridgeCommand.java diff --git a/server/src/com/cloud/network/ovs/OvsTunnelManager.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java similarity index 100% rename from server/src/com/cloud/network/ovs/OvsTunnelManager.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManager.java diff --git a/server/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java similarity index 100% rename from server/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDao.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDao.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDao.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDao.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceVO.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceVO.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceVO.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelInterfaceVO.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDao.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDao.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDao.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDao.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDaoImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDaoImpl.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDaoImpl.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkDaoImpl.java diff --git a/server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkVO.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkVO.java similarity index 100% rename from server/src/com/cloud/network/ovs/dao/OvsTunnelNetworkVO.java rename to plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/OvsTunnelNetworkVO.java diff --git a/server/src/com/cloud/configuration/DefaultComponentLibrary.java b/server/src/com/cloud/configuration/DefaultComponentLibrary.java index 61b6861df89..ca0b406f6fc 100755 --- a/server/src/com/cloud/configuration/DefaultComponentLibrary.java +++ b/server/src/com/cloud/configuration/DefaultComponentLibrary.java @@ -99,9 +99,6 @@ import com.cloud.network.firewall.FirewallManagerImpl; import com.cloud.network.lb.ElasticLoadBalancerManagerImpl; import com.cloud.network.lb.LoadBalancingRulesManagerImpl; import com.cloud.network.lb.dao.ElasticLbVmMapDaoImpl; -import com.cloud.network.ovs.OvsTunnelManagerImpl; -import com.cloud.network.ovs.dao.OvsTunnelInterfaceDaoImpl; -import com.cloud.network.ovs.dao.OvsTunnelNetworkDaoImpl; import com.cloud.network.router.VirtualNetworkApplianceManagerImpl; import com.cloud.network.rules.RulesManagerImpl; import com.cloud.network.rules.dao.PortForwardingRulesDaoImpl; @@ -286,8 +283,6 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com addDao("UsageEventDao", UsageEventDaoImpl.class); addDao("ClusterDetailsDao", ClusterDetailsDaoImpl.class); addDao("UserVmDetailsDao", UserVmDetailsDaoImpl.class); - addDao("OvsTunnelInterfaceDao", OvsTunnelInterfaceDaoImpl.class); - addDao("OvsTunnelAccountDao", OvsTunnelNetworkDaoImpl.class); addDao("StoragePoolWorkDao", StoragePoolWorkDaoImpl.class); addDao("HostTagsDao", HostTagsDaoImpl.class); addDao("NetworkDomainDao", NetworkDomainDaoImpl.class); @@ -360,7 +355,6 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com addManager("LoadBalancingRulesManager", LoadBalancingRulesManagerImpl.class); addManager("RulesManager", RulesManagerImpl.class); addManager("RemoteAccessVpnManager", RemoteAccessVpnManagerImpl.class); - addManager("OvsTunnelManager", OvsTunnelManagerImpl.class); addManager("Capacity Manager", CapacityManagerImpl.class); addManager("VirtualMachineManager", ClusteredVirtualMachineManagerImpl.class); addManager("HypervisorGuruManager", HypervisorGuruManagerImpl.class); diff --git a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java index 6c381f2b18e..b887fc6b307 100644 --- a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java +++ b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java @@ -35,7 +35,6 @@ import com.cloud.network.Networks.BroadcastDomainType; import com.cloud.network.PhysicalNetworkVO; import com.cloud.network.dao.NetworkDao; import com.cloud.network.dao.PhysicalNetworkDao; -import com.cloud.network.ovs.OvsTunnelManager; import com.cloud.network.rules.PortForwardingRuleVO; import com.cloud.network.rules.dao.PortForwardingRulesDao; import com.cloud.offering.NetworkOffering; @@ -64,12 +63,13 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru { DataCenterDao _zoneDao; @Inject PortForwardingRulesDao _pfRulesDao; - @Inject - OvsTunnelManager _tunnelMgr; + //FIXME: why there is dependency on Ovs tunnel manager. + @Override public Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, Account owner) { - if (_tunnelMgr.isOvsTunnelEnabled()) { + + if (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))) { return null; } @@ -88,7 +88,7 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru { public Network implement(Network config, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException { assert (config.getState() == State.Implementing) : "Why are we implementing " + config; - if (_tunnelMgr.isOvsTunnelEnabled()) { + if (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))) { return null; } @@ -171,7 +171,8 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru { NicProfile profile = super.allocate(config, nic, vm); - if (_tunnelMgr.isOvsTunnelEnabled()) { + boolean _isEnabled = Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key())); + if (_isEnabled) { return null; } @@ -190,7 +191,7 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru { public void deallocate(Network config, NicProfile nic, VirtualMachineProfile vm) { super.deallocate(config, nic, vm); - if (_tunnelMgr.isOvsTunnelEnabled()) { + if (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))) { return; } @@ -207,7 +208,8 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru { public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException { assert (nic.getReservationStrategy() == ReservationStrategy.Start) : "What can I do for nics that are not allocated at start? "; - if (_tunnelMgr.isOvsTunnelEnabled()) { + boolean _isEnabled = Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key())); + if (_isEnabled) { return; } @@ -241,7 +243,8 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru { @Override public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) { - if (_tunnelMgr.isOvsTunnelEnabled()) { + + if (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))) { return true; }